diff --git a/mu4e/mu4e-modeline.el b/mu4e/mu4e-modeline.el index 2d8b1901..b0eae39d 100644 --- a/mu4e/mu4e-modeline.el +++ b/mu4e/mu4e-modeline.el @@ -48,6 +48,14 @@ display the bookmark name rather than the query." :type 'boolean :group 'mu4e-modeline) +(defcustom mu4e-modeline-show-global t + "Whether to populate global modeline segments. + +If non-nil, show both buffer-specific and global modeline items, +otherwise only present buffer-specific information." + :type 'boolean + :group 'mu4e-modeline) + (defvar-local mu4e--modeline-buffer-items nil "List of buffer-local items for the mu4e modeline. Each element is function that evaluates to a string.") @@ -90,15 +98,17 @@ originate.") (mapconcat (lambda (func) (or (funcall func) "")) lst " "))) (global-string ;; global string is _cached_ as it may be expensive. - (or mu4e--modeline-global-string-cached - (setq mu4e--modeline-global-string-cached - (funcall collect mu4e--modeline-global-items))))) + (and + mu4e-modeline-show-global + (or mu4e--modeline-global-string-cached + (setq mu4e--modeline-global-string-cached + (funcall collect mu4e--modeline-global-items)))))) (concat ;; (local) buffer items are _not_ cached, so they'll get update ;; automatically when leaving the buffer. (mu4e--modeline-quote-and-truncate (funcall collect mu4e--modeline-buffer-items)) - " " + (and global-string " ") global-string))) (define-minor-mode mu4e-modeline-mode diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index 85576119..aaefe4dd 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -3127,8 +3127,11 @@ To completely turn off the modeline support, set @code{mu4e-modeline-support} to @item global: information about the results for the ``favorite query'' @end itemize -All of the bookmark items provide more details in their @code{help-echo}, i.e., -their tooltip. +The global indicators can be disabled by setting @code{mu4e-modeline-show-global} +to @t{nil}. + +All of the bookmark items provide more details in their @code{help-echo}, +i.e., their tooltip. @subsection Query parameters bookmark item The query parameters in the modeline start with the various query flags (such as