Merge pull request #130 from yqrashawn/fix-mu4e-alert

fix mu4e-alert-mode-line numberp error
This commit is contained in:
Vincent Zhang 2019-03-04 09:04:19 +07:00 committed by GitHub
commit 59047842b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1586,7 +1586,9 @@ mouse-1: Toggle Debug on Quit"
(doom-modeline--active)
(bound-and-true-p mu4e-alert-mode-line))
;; don't display if the unread mails count is zero
(if (> mu4e-alert-mode-line 0)
(mu4e-alert--get-mu-unread-mails
(lambda (mails)
(if (> (length mails) 0)
(concat
" "
(propertize
@ -1599,13 +1601,13 @@ mouse-1: Toggle Debug on Quit"
(propertize "#"
'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
doom-modeline-vspc
(propertize (number-to-string mu4e-alert-mode-line)
(propertize (length mails)
'face '(:inherit (doom-modeline-warning doom-modeline-unread-number))))
'mouse-face '(:box 0)
'help-echo (if (= mu4e-alert-mode-line 1)
"You have an unread email"
(format "You have %s unread emails" mu4e-alert-mode-line)))
" "))))
" "))))))
(defun doom-modeline-override-mu4e-alert-modeline (&rest _)
"Delete `mu4e-alert-mode-line' from global modeline string."