Rename doom-modeline--default-mode-line to doom-modeline--old-format.

This commit is contained in:
Vincent Zhang 2019-07-23 02:27:00 +08:00
parent 9e116eadc0
commit e2e8c1c422

View file

@ -4,7 +4,7 @@
;; Author: Vincent Zhang <seagle0128@gmail.com> ;; Author: Vincent Zhang <seagle0128@gmail.com>
;; Homepage: https://github.com/seagle0128/doom-modeline ;; Homepage: https://github.com/seagle0128/doom-modeline
;; Version: 2.4.0 ;; Version: 2.4.1
;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (dash "2.11.0")) ;; Package-Requires: ((emacs "25.1") (all-the-icons "1.0.0") (shrink-path "0.2.0") (dash "2.11.0"))
;; Keywords: faces mode-line ;; Keywords: faces mode-line
@ -192,8 +192,11 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
;; Mode ;; Mode
;; ;;
(defvar doom-modeline--default-mode-line mode-line-format) (defvar doom-modeline--old-format mode-line-format
(declare-function helm-display-mode-line 'helm) "Storage for the old `mode-line-format', so it can be restored when
`doom-modeline-mode' is disabled.")
(declare-function helm-display-mode-line 'helm) ; suppress warnings
;;;###autoload ;;;###autoload
(define-minor-mode doom-modeline-mode (define-minor-mode doom-modeline-mode
@ -225,7 +228,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
(advice-add #'helm-display-mode-line :override #'doom-modeline-set-helm-modeline)) (advice-add #'helm-display-mode-line :override #'doom-modeline-set-helm-modeline))
(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--old-format)
;; Remove hooks ;; Remove hooks
(remove-hook 'Info-mode-hook #'doom-modeline-set-info-modeline) (remove-hook 'Info-mode-hook #'doom-modeline-set-info-modeline)
(remove-hook 'dired-mode-hook #'doom-modeline-set-project-modeline) (remove-hook 'dired-mode-hook #'doom-modeline-set-project-modeline)