diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-10-01 14:30:55 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-10-01 16:24:42 +0100 |
commit | 8cbf1518d2db8bbc83688bddd563bdbfc1d51607 (patch) | |
tree | 3f36bc2ce1571669bd44a9f13fb3500275cadb44 /Emacs/.config | |
parent | b06202b882b0226e9348805838b01997da17eec2 (diff) | |
download | dotfiles-8cbf1518d2db8bbc83688bddd563bdbfc1d51607.tar.gz dotfiles-8cbf1518d2db8bbc83688bddd563bdbfc1d51607.tar.bz2 dotfiles-8cbf1518d2db8bbc83688bddd563bdbfc1d51607.zip |
(Emacs/elisp)~hide-mode-line is a globalised minor-mode
Diffstat (limited to 'Emacs/.config')
-rw-r--r-- | Emacs/.config/emacs/config.org | 2 | ||||
-rw-r--r-- | Emacs/.config/emacs/elisp/hide-mode-line.el | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 352f0e5..dd6fa25 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1524,7 +1524,7 @@ Custom minor mode to toggle the mode line. Check it out at :defer t :general (mode-leader - "m" #'hide-mode-line-mode)) + "m" #'global-hide-mode-line-mode)) #+end_src ** Save place Saves current place in a buffer permanently, so on revisiting the file diff --git a/Emacs/.config/emacs/elisp/hide-mode-line.el b/Emacs/.config/emacs/elisp/hide-mode-line.el index 488bf3f..d7be502 100644 --- a/Emacs/.config/emacs/elisp/hide-mode-line.el +++ b/Emacs/.config/emacs/elisp/hide-mode-line.el @@ -25,14 +25,20 @@ (defvar hide-mode-line--prev-mode-line nil) -(define-minor-mode - hide-mode-line-mode - "Hides the mode line." +(define-minor-mode hide-mode-line-mode + "Minor mode for hiding model lines" :lighter nil - (if mode-line-format - (setq-local hide-mode-line--prev-mode-line mode-line-format - mode-line-format nil) - (setq-local mode-line-format hide-mode-line--prev-mode-line))) + (cond + ((and mode-line-format hide-mode-line-mode) + (setq-local hide-mode-line-mode t + hide-mode-line--prev-mode-line mode-line-format + mode-line-format nil)) + (t (setq-local hide-mode-line nil + mode-line-format hide-mode-line--prev-mode-line + hide-mode-line--prev-mode-line nil)))) + +(define-globalized-minor-mode global-hide-mode-line-mode hide-mode-line-mode + (lambda nil (hide-mode-line-mode t))) (provide 'hide-mode-line) ;;; hide-mode-line.el ends here |