From e2e8c1c422aa3dd365b074ab6ec71b46d080bb11 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 23 Jul 2019 02:27:00 +0800 Subject: [PATCH] Rename doom-modeline--default-mode-line to doom-modeline--old-format. --- doom-modeline.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 3270b4e..e459c9f 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -4,7 +4,7 @@ ;; Author: Vincent Zhang ;; 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")) ;; Keywords: faces mode-line @@ -192,8 +192,11 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." ;; Mode ;; -(defvar doom-modeline--default-mode-line mode-line-format) -(declare-function helm-display-mode-line 'helm) +(defvar doom-modeline--old-format mode-line-format + "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 (define-minor-mode doom-modeline-mode @@ -203,7 +206,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." :lighter nil (if doom-modeline-mode (progn - (doom-modeline-refresh-bars) ; create bars + (doom-modeline-refresh-bars) ; create bars (doom-modeline-set-main-modeline t) ; set default mode-line (unless after-init-time ;; These buffers are already created and don't get modelines. For the love @@ -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)) (progn ;; 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-hook 'Info-mode-hook #'doom-modeline-set-info-modeline) (remove-hook 'dired-mode-hook #'doom-modeline-set-project-modeline)