@ -868,8 +868,11 @@ after the end of the search results."
|
|||||||
mu4e--search-msgid-target nil)
|
mu4e--search-msgid-target nil)
|
||||||
(when (mu4e~headers-docid-at-point)
|
(when (mu4e~headers-docid-at-point)
|
||||||
(mu4e~headers-highlight (mu4e~headers-docid-at-point)))))
|
(mu4e~headers-highlight (mu4e~headers-docid-at-point)))))
|
||||||
;; run-hooks
|
;; maybe enable thread folding
|
||||||
(run-hooks 'mu4e-headers-found-hook))
|
(when mu4e-search-threads
|
||||||
|
(mu4e-thread-mode))
|
||||||
|
;; run-hooks
|
||||||
|
(run-hooks 'mu4e-headers-found-hook))
|
||||||
|
|
||||||
|
|
||||||
;;; Marking
|
;;; Marking
|
||||||
@ -932,12 +935,6 @@ after the end of the search results."
|
|||||||
(define-key map (kbd "<C-kp-subtract>")
|
(define-key map (kbd "<C-kp-subtract>")
|
||||||
#'mu4e-headers-split-view-shrink)
|
#'mu4e-headers-split-view-shrink)
|
||||||
|
|
||||||
;; threads
|
|
||||||
(define-key map (kbd "<S-left>") #'mu4e-thread-goto-root)
|
|
||||||
(define-key map (kbd "<tab>") #'mu4e-thread-fold-toggle-goto-next)
|
|
||||||
(define-key map (kbd "<C-tab>") #'mu4e-thread-fold-toggle-goto-next)
|
|
||||||
(define-key map (kbd "<backtab>") #'mu4e-thread-fold-toggle-all)
|
|
||||||
|
|
||||||
;; switching to view mode (if it's visible)
|
;; switching to view mode (if it's visible)
|
||||||
(define-key map "y" #'mu4e-select-other-view)
|
(define-key map "y" #'mu4e-select-other-view)
|
||||||
|
|
||||||
|
|||||||
@ -32,10 +32,14 @@
|
|||||||
;; Similarly, when a thread has marked messages, the folding stops at the first
|
;; Similarly, when a thread has marked messages, the folding stops at the first
|
||||||
;; marked message.
|
;; marked message.
|
||||||
|
|
||||||
|
;; Note, you can only use these functions when threads are available, roughly
|
||||||
|
;; when `mu4e-search-threads' in non-nil.
|
||||||
|
|
||||||
;;; Usage example:
|
;;; Usage example:
|
||||||
;;
|
;;
|
||||||
;; This enforces folding after a new search
|
;; After a search, mu4e-thread-mode will be enable when threads
|
||||||
;; (add-hook 'mu4e-headers-found-hook #'mu4e-thread-fold-apply-all)
|
;; are available; so, to automatically sort them:
|
||||||
|
;; (add-hook 'mu4e-thread-mode-hook #'mu4e-thread-fold-apply-all)
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
@ -273,5 +277,19 @@ Reset individual folding states."
|
|||||||
(mu4e-thread-unfold)
|
(mu4e-thread-unfold)
|
||||||
(mu4e-thread-goto-next)))
|
(mu4e-thread-goto-next)))
|
||||||
|
|
||||||
|
(define-minor-mode mu4e-thread-mode
|
||||||
|
"Mode for thread-support."
|
||||||
|
:global nil
|
||||||
|
:init-value nil ;; disabled by default
|
||||||
|
:group 'mu4e
|
||||||
|
:lighter ""
|
||||||
|
:keymap
|
||||||
|
(let ((map (make-sparse-keymap)))
|
||||||
|
(define-key map (kbd "<S-left>") #'mu4e-thread-goto-root)
|
||||||
|
(define-key map (kbd "<tab>") #'mu4e-thread-fold-toggle-goto-next)
|
||||||
|
(define-key map (kbd "<C-tab>") #'mu4e-thread-fold-toggle-goto-next)
|
||||||
|
(define-key map (kbd "<backtab>") #'mu4e-thread-fold-toggle-all)
|
||||||
|
map))
|
||||||
|
|
||||||
(provide 'mu4e-thread)
|
(provide 'mu4e-thread)
|
||||||
;;; mu4e-thread.el ends here
|
;;; mu4e-thread.el ends here
|
||||||
|
|||||||
@ -1118,15 +1118,19 @@ Folding stops at the @emph{first unread message}, unless you set
|
|||||||
the folding stops at the first marked message. Marking folded messages is not
|
the folding stops at the first marked message. Marking folded messages is not
|
||||||
allowed as it is too error-prone.
|
allowed as it is too error-prone.
|
||||||
|
|
||||||
|
Thread-mode functionality is only available with @code{mu4e-search-threads}
|
||||||
|
enabled; this triggers a minor mode @code{mu4e-thread-mode} in the headers-view.
|
||||||
|
For now, this functionality is not available in the message view, due to the
|
||||||
|
conflicting key bindings.
|
||||||
|
|
||||||
If you want to automatically fold all threads after a query, you can use a hook:
|
If you want to automatically fold all threads after a query, you can use a hook:
|
||||||
@lisp
|
@lisp
|
||||||
(add-hook 'mu4e-headers-found-hook #'mu4e-thread-fold-apply-all)
|
(add-hook 'mu4e-thread-mode-hook #'mu4e-thread-fold-apply-all)
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
By default, single-child threads are @emph{not} collapsed, since it would simply
|
By default, single-child threads are @emph{not} collapsed, since it would result
|
||||||
result in replacing a single line with the collapsed one. However, if, for
|
in replacing a single line with the collapsed one. However, if, for consistency,
|
||||||
consistency you also want to fold those, you can use
|
you also want to fold those, you can use @t{mu4e-thread-fold-single-children}.
|
||||||
@t{mu4e-thread-fold-single-children}.
|
|
||||||
|
|
||||||
@node HV Custom headers
|
@node HV Custom headers
|
||||||
@section Custom headers
|
@section Custom headers
|
||||||
|
|||||||
Reference in New Issue
Block a user