Improve mode-line format restoration behavior

This commit is contained in:
Jessie Hildebrandt 2021-09-03 05:12:06 -04:00
parent 64cbd61c3d
commit 58ea97f6ea

View File

@ -303,7 +303,7 @@
;; ;;
;; Store the default mode-line format ;; Store the default mode-line format
(defvar mood-line--default-mode-line mode-line-format) (defvar-local mood-line--default-mode-line mode-line-format)
;;;###autoload ;;;###autoload
(define-minor-mode mood-line-mode (define-minor-mode mood-line-mode
@ -323,6 +323,9 @@
(add-hook 'after-save-hook #'mood-line--update-vc-segment) (add-hook 'after-save-hook #'mood-line--update-vc-segment)
(advice-add #'vc-refresh-state :after #'mood-line--update-vc-segment) (advice-add #'vc-refresh-state :after #'mood-line--update-vc-segment)
;; Save previous mode-line-format to be restored later
(setq mood-line--default-mode-line mode-line-format)
;; Set the new mode-line-format ;; Set the new mode-line-format
(setq-default mode-line-format (setq-default mode-line-format
'((:eval '((:eval