Fix disappearing modeline due to loss of state

This commit is contained in:
Henrik Lissner 2017-04-25 22:55:57 -04:00
parent 71df9a4591
commit b2d19eac32
3 changed files with 7 additions and 6 deletions

View file

@ -1,12 +1,12 @@
#+TITLE: DOOM Emacs Changelog #+TITLE: DOOM Emacs Changelog
** Unreleased [37/52] ** Unreleased [38/52]
+ [-] app/finance + [-] app/finance
+ [-] app/crm + [-] app/crm
+ [-] Improve send-to-REPL workflow + [-] Improve send-to-REPL workflow
+ [ ] Update screenshots + [ ] Update screenshots
+ [ ] Fix lack of syntax highlighting in ~:x~ scratch buffer + [ ] Fix lack of syntax highlighting in ~:x~ scratch buffer
+ [ ] Fix modeline disappearing due to loss of state (~doom--modeline-format~ being killed on major mode change) + [X] Fix modeline disappearing due to loss of state (~doom--modeline-format~ being killed on major mode change)
+ [0/4] Investigate potential plugins + [0/4] Investigate potential plugins
+ [ ] feature/version-control: [[https://github.com/pidu/git-timemachine][git-timemachine]] (replacement for vc-annotate) + [ ] feature/version-control: [[https://github.com/pidu/git-timemachine][git-timemachine]] (replacement for vc-annotate)
+ [ ] lang/org: [[https://github.com/Malabarba/latex-extra][orgit]] (org links to magit buffers) + [ ] lang/org: [[https://github.com/Malabarba/latex-extra][orgit]] (org links to magit buffers)

View file

@ -172,9 +172,9 @@ for :align t on every rule."
(doom-hide-modeline-mode +1)) (doom-hide-modeline-mode +1))
((and (symbolp modeline) ((and (symbolp modeline)
(not (eq modeline 't))) (not (eq modeline 't)))
(let ((doom--modeline-format (doom-modeline modeline))) (setq-local doom--modeline-format (doom-modeline modeline))
(when doom--modeline-format (when doom--modeline-format
(doom-hide-modeline-mode +1)))))) (doom-hide-modeline-mode +1)))))
;; show modeline ;; show modeline
(when doom-hide-modeline-mode (when doom-hide-modeline-mode
(doom-hide-modeline-mode -1)))) (doom-hide-modeline-mode -1))))

View file

@ -49,7 +49,7 @@
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02)) (add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
;; A minor mode for toggling the mode-line ;; A minor mode for toggling the mode-line
(defvar doom--modeline-format nil (defvar-local doom--modeline-format nil
"The modeline format to use when `doom-hide-modeline-mode' is active. Don't "The modeline format to use when `doom-hide-modeline-mode' is active. Don't
set this directly. Bind it in `let' instead.") set this directly. Bind it in `let' instead.")
(defvar-local doom--old-modeline-format nil (defvar-local doom--old-modeline-format nil
@ -66,6 +66,7 @@ disabled.")
doom--old-modeline-format nil)) doom--old-modeline-format nil))
(force-mode-line-update)) (force-mode-line-update))
;; Ensure major-mode or theme changes don't overwrite these variables ;; Ensure major-mode or theme changes don't overwrite these variables
(put 'doom--modeline-format 'permanent-local t)
(put 'doom--old-modeline-format 'permanent-local t) (put 'doom--old-modeline-format 'permanent-local t)
(put 'doom-hide-modeline-mode 'permanent-local t) (put 'doom-hide-modeline-mode 'permanent-local t)