From 66b182a9fd6919fd947a9195231a63e10bb80c85 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 31 Jan 2019 00:23:52 +0800 Subject: [PATCH] Fix: restore mu4e-alert-modeline-formatter to last one. --- doom-modeline.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 89f2cb6..0fbd4d2 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -154,8 +154,9 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." ;; (defvar doom-modeline--default-mode-line mode-line-format) + (defvar mu4e-alert-modeline-formatter) -(declare-function mu4e-alert-default-mode-line-formatter 'mu4e-alert) +(defvar doom-modeline--mu4e-alert-modeline-formatter mu4e-alert-modeline-formatter) ;;;###autoload (define-minor-mode doom-modeline-mode @@ -173,22 +174,22 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." (dolist (bname '("*scratch*" "*Messages*")) (with-current-buffer bname (doom-modeline-set-main-modeline)))) + ;; Set mu4e alert modeline + (if doom-modeline-mu4e (setq mu4e-alert-modeline-formatter #'identity)) ;; Add hooks (add-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline) (add-hook 'image-mode-hook #'doom-modeline-set-media-modeline) (add-hook 'circe-mode-hook #'doom-modeline-set-special-modeline) - (add-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline) - (setq mu4e-alert-modeline-formatter #'identity)) + (add-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline)) (progn ;; Restore mode-line (setq-default mode-line-format doom-modeline--default-mode-line) + (setq mu4e-alert-modeline-formatter doom-modeline--mu4e-alert-modeline-formatter) ;; Remove hooks (remove-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline) (remove-hook 'image-mode-hook #'doom-modeline-set-media-modeline) (remove-hook 'circe-mode-hook #'doom-modeline-set-special-modeline) - (remove-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline) - (setq mu4e-alert-modeline-formatter - #'mu4e-alert-default-mode-line-formatter)))) + (remove-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline)))) (provide 'doom-modeline)