Remove mu4e-alert's string from global modeline string.

This commit is contained in:
Vincent Zhang 2019-03-01 00:23:49 +07:00
parent 9f2a0183fc
commit cd92bf0ffd

View file

@ -1580,11 +1580,12 @@ mouse-1: Toggle Debug on Quit"
(doom-modeline-def-segment mu4e (doom-modeline-def-segment mu4e
(when (and doom-modeline-mu4e (when (and doom-modeline-mu4e
(doom-modeline--active) (doom-modeline--active)
(bound-and-true-p mu4e-alert-mode-line) (bound-and-true-p mu4e-alert-mode-line))
;; we'll do our own formatting so just need to test for zero
(> mu4e-alert-mode-line 0))
;; remove mu4e-alert's global modeline string setting ;; remove mu4e-alert's global modeline string setting
(setq global-mode-string (delete '(:eval mu4e-alert-mode-line) global-mode-string)) (setq global-mode-string (delete '(:eval mu4e-alert-mode-line) global-mode-string))
;; don't display if the unread mails count is zero
(if (> mu4e-alert-mode-line 0)
(concat (concat
" " " "
(propertize (propertize
@ -1603,7 +1604,7 @@ mouse-1: Toggle Debug on Quit"
'help-echo (if (= mu4e-alert-mode-line 1) 'help-echo (if (= mu4e-alert-mode-line 1)
"You have an unread email" "You have an unread email"
(format "You have %s unread emails" mu4e-alert-mode-line))) (format "You have %s unread emails" mu4e-alert-mode-line)))
" "))) " "))))
;; ;;