From 84fe18046db45d56620f4ea7c7f94f0432aafc36 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 26 Dec 2021 13:03:24 -0600 Subject: Add reading-mode --- lisp/+modeline.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lisp/+modeline.el') diff --git a/lisp/+modeline.el b/lisp/+modeline.el index 7615ea7..47299ec 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el @@ -111,6 +111,26 @@ The order of elements matters: whichever one matches first is applied." 'face 'font-lock-doc-face 'mouse-face 'mode-line-highlight)))) +(defun +modeline-reading-mode () + "Display an indication that the buffer is in `reading-mode'." + (when reading-mode + (concat " " + (propertize "R" + 'help-echo (format "%s\n%s" + "Buffer is in reading-mode." + "mouse-2: disable reading-mode.") + 'local-map (purecopy + (simple-modeline-make-mouse-map + 'mouse-2 (lambda (ev) + (interactive "e") + (with-selected-window + (posn-window + (event-start ev)) + (reading-mode -1) + (force-mode-line-update))))) + 'face 'font-lock-doc-face + 'mouse-face 'mode-line-highlight)))) + (define-minor-mode file-percentage-mode "Toggle the percentage display in the mode line (File Percentage Mode)." :init-value t :global t :group 'mode-line) -- cgit 1.4.1-21-gabe81