mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Refactor mu4e segment.
This commit is contained in:
parent
e8f8a61a74
commit
6c35035bc8
1 changed files with 11 additions and 13 deletions
|
@ -118,6 +118,7 @@
|
||||||
(declare-function lsp-workspaces 'lsp-mode)
|
(declare-function lsp-workspaces 'lsp-mode)
|
||||||
(declare-function magit-toplevel 'magit-git)
|
(declare-function magit-toplevel 'magit-git)
|
||||||
(declare-function minions-minor-modes-menu 'minions)
|
(declare-function minions-minor-modes-menu 'minions)
|
||||||
|
(declare-function mu4e-alert-default-mode-line-formatter 'mu4e-alert)
|
||||||
(declare-function mu4e-alert-enable-mode-line-display 'mu4e-alert)
|
(declare-function mu4e-alert-enable-mode-line-display 'mu4e-alert)
|
||||||
(declare-function nyan-create 'nyan-mode)
|
(declare-function nyan-create 'nyan-mode)
|
||||||
(declare-function parrot-create 'parrot)
|
(declare-function parrot-create 'parrot)
|
||||||
|
@ -1611,21 +1612,18 @@ mouse-1: Toggle Debug on Quit"
|
||||||
(format "You have %s unread emails" mu4e-alert-mode-line)))
|
(format "You have %s unread emails" mu4e-alert-mode-line)))
|
||||||
" "))))
|
" "))))
|
||||||
|
|
||||||
(defvar doom-modeline--mu4e-alert-modeline-formatter #'ignore)
|
|
||||||
(with-eval-after-load 'mu4e-alert
|
|
||||||
(setq doom-modeline--mu4e-alert-modeline-formatter mu4e-alert-modeline-formatter))
|
|
||||||
|
|
||||||
(defun doom-modeline-override-mu4e-alert-modeline (&rest _)
|
(defun doom-modeline-override-mu4e-alert-modeline (&rest _)
|
||||||
"Delete `mu4e-alert-mode-line' from global modeline string."
|
"Delete `mu4e-alert-mode-line' from global modeline string."
|
||||||
(if (and doom-modeline-mu4e
|
(when (featurep 'mu4e-alert)
|
||||||
(bound-and-true-p doom-modeline-mode))
|
(if (and doom-modeline-mu4e
|
||||||
;; Set mu4e alert modeline
|
(bound-and-true-p doom-modeline-mode))
|
||||||
(progn
|
;; Set mu4e-alert modeline
|
||||||
(setq mu4e-alert-modeline-formatter #'identity)
|
(progn
|
||||||
(setq global-mode-string
|
(setq mu4e-alert-modeline-formatter #'identity)
|
||||||
(delete '(:eval mu4e-alert-mode-line) global-mode-string)))
|
(setq global-mode-string
|
||||||
;; Recover default settings
|
(delete '(:eval mu4e-alert-mode-line) global-mode-string)))
|
||||||
(setq mu4e-alert-modeline-formatter doom-modeline--mu4e-alert-modeline-formatter)))
|
;; Recover default settings
|
||||||
|
(setq mu4e-alert-modeline-formatter #'mu4e-alert-default-mode-line-formatter))))
|
||||||
(advice-add #'mu4e-alert-enable-mode-line-display :after #'doom-modeline-override-mu4e-alert-modeline)
|
(advice-add #'mu4e-alert-enable-mode-line-display :after #'doom-modeline-override-mu4e-alert-modeline)
|
||||||
(add-hook 'doom-modeline-mode-hook #'doom-modeline-override-fancy-battery-modeline)
|
(add-hook 'doom-modeline-mode-hook #'doom-modeline-override-fancy-battery-modeline)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue