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,30 +1580,31 @@ 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))
(concat
" " ;; don't display if the unread mails count is zero
(propertize (if (> mu4e-alert-mode-line 0)
(concat (concat
(if doom-modeline-icon " "
(doom-modeline-icon-material "mail" (propertize
:height 1.1 (concat
:v-adjust -0.225 (if doom-modeline-icon
:face 'doom-modeline-warning) (doom-modeline-icon-material "mail"
(propertize "#" :height 1.1
'face '(:inherit (doom-modeline-warning doom-modeline-unread-number)))) :v-adjust -0.225
doom-modeline-vspc :face 'doom-modeline-warning)
(propertize (number-to-string mu4e-alert-mode-line) (propertize "#"
'face '(:inherit (doom-modeline-warning doom-modeline-unread-number)))) 'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
'mouse-face 'mode-line doom-modeline-vspc
'help-echo (if (= mu4e-alert-mode-line 1) (propertize (number-to-string mu4e-alert-mode-line)
"You have an unread email" 'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
(format "You have %s unread emails" mu4e-alert-mode-line))) 'mouse-face 'mode-line
" "))) 'help-echo (if (= mu4e-alert-mode-line 1)
"You have an unread email"
(format "You have %s unread emails" mu4e-alert-mode-line)))
" "))))
;; ;;