diff --git a/NEWS b/NEWS index cc6877f4..f7baae1c 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,8 @@ `mu4e-user-mail-address-list' - support tags (i.e.., X-Keywords and friends) in the headers-view, and the message view. Thanks to Abdó Roig-Maranges. New field ":tags". + - automatically update the headers buffer when new messages are found during + indexing; set `mu4e-headers-auto-update' to nil to disable this. * Old news :PROPERTIES: diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 936b16d9..55654f7c 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -84,6 +84,12 @@ vertical split-view." :type 'integer :group 'mu4e-headers) +(defcustom mu4e-headers-auto-update t + "Whether to automatically update the current headers buffer if an +indexing operation showed changes." + :type 'boolean + :group 'mu4e-headers) + ;; marks for headers of the form; each is a cons-cell (basic . fancy) ;; each of which is basic ascii char and something fancy, respectively @@ -643,6 +649,16 @@ after the end of the search results." (make-local-variable 'global-mode-string) (set (make-local-variable 'hl-line-face) 'mu4e-header-highlight-face) + ;; maybe update the current headers upon indexing changes + (add-hook 'mu4e-index-updated-hook + (defun mu4e~headers-auto-update () + "Update the current headers buffer after indexing has brought +some changes, `mu4e-headers-auto-update' is non-nil and there is no +user-interaction ongoing." + (when (and mu4e-headers-auto-update (not (active-minibuffer-window))) + (with-current-buffer mu4e~headers-buffer + (mu4e-headers-rerun-search)))) nil t) + (setq truncate-lines t buffer-undo-list t ;; don't record undo information diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index 7eae4d76..d3e201b7 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -733,6 +733,10 @@ u=@emph{unread}. The tooltip for this field also contains this information. @item The subject field also indicates the discussion threads @footnote{using Jamie Zawinski's mail threading algorithm, @url{http://www.jwz.org/doc/threading.html}}. +@item The headers view is @emph{automatically updated} if any changes are +found during the indexing process, and if there is not current +user-interaction. If you do not want such automatic updates, set +@code{mu4e-headers-auto-update} to @code{nil}. @end itemize @node Keybindings @@ -2791,6 +2795,9 @@ some soundfile, change as needed): (defun new-mail-sound () (shell-command "aplay ~/Sounds/boing.wav&"))) @end lisp +@item @emph{It seems my headers-buffer is automatically updated when new + messages are found during the indexing process -- can I disable this + somehow?} Yes - set @code{mu4e-headers-auto-update} to @code{nil}. @item @emph{I don't use @t{offlineimap}, @t{fetchmail} etc., I get my mail through my own mailserver. What should I use for @code{mu4e-get-mail-command}}? Use @t{"true"} (or don't do anything, it's the