Fix: restore mu4e-alert-modeline-formatter to last one.

This commit is contained in:
Vincent Zhang 2019-01-31 00:23:52 +08:00
parent 4f856886d6
commit 66b182a9fd

View file

@ -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 doom-modeline--default-mode-line mode-line-format)
(defvar mu4e-alert-modeline-formatter) (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 ;;;###autoload
(define-minor-mode doom-modeline-mode (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*")) (dolist (bname '("*scratch*" "*Messages*"))
(with-current-buffer bname (with-current-buffer bname
(doom-modeline-set-main-modeline)))) (doom-modeline-set-main-modeline))))
;; Set mu4e alert modeline
(if doom-modeline-mu4e (setq mu4e-alert-modeline-formatter #'identity))
;; Add hooks ;; Add hooks
(add-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline) (add-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline)
(add-hook 'image-mode-hook #'doom-modeline-set-media-modeline) (add-hook 'image-mode-hook #'doom-modeline-set-media-modeline)
(add-hook 'circe-mode-hook #'doom-modeline-set-special-modeline) (add-hook 'circe-mode-hook #'doom-modeline-set-special-modeline)
(add-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline) (add-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline))
(setq mu4e-alert-modeline-formatter #'identity))
(progn (progn
;; Restore mode-line ;; Restore mode-line
(setq-default mode-line-format doom-modeline--default-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 hooks
(remove-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline) (remove-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline)
(remove-hook 'image-mode-hook #'doom-modeline-set-media-modeline) (remove-hook 'image-mode-hook #'doom-modeline-set-media-modeline)
(remove-hook 'circe-mode-hook #'doom-modeline-set-special-modeline) (remove-hook 'circe-mode-hook #'doom-modeline-set-special-modeline)
(remove-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline) (remove-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline))))
(setq mu4e-alert-modeline-formatter
#'mu4e-alert-default-mode-line-formatter))))
(provide 'doom-modeline) (provide 'doom-modeline)