summary refs log tree commit diff stats
path: root/lisp/acdw-modeline.el
diff options
context:
space:
mode:
authorCase Duckworth2021-08-28 00:25:26 -0500
committerCase Duckworth2021-08-28 00:25:26 -0500
commit543186282747d1019c7f32a6a7c1c8cb627b5152 (patch)
treebe3067b5388b0b189a07dbd8376b96bb7e48c879 /lisp/acdw-modeline.el
parentButtonize major mode in modeline (diff)
downloademacs-543186282747d1019c7f32a6a7c1c8cb627b5152.tar.gz
emacs-543186282747d1019c7f32a6a7c1c8cb627b5152.zip
Sort acdw-modeline.el
Diffstat (limited to 'lisp/acdw-modeline.el')
-rw-r--r--lisp/acdw-modeline.el35
1 files changed, 9 insertions, 26 deletions
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 00eb056..df2811f 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el
@@ -22,6 +22,15 @@
22(require 'simple-modeline) 22(require 'simple-modeline)
23(require 'minions) 23(require 'minions)
24 24
25(defcustom acdw-modeline/word-count-modes
26 (mapcar (lambda (m) (cons m nil)) simple-modeline-word-count-modes)
27 "Alist of modes to functions that `acdw-modeline/word-count' should dispatch.
28If the cdr of the cons cell is nil, use the default function (`count-words').
29Otherwise, cdr should be a function that takes two points (see `count-words')."
30 :type '(alist :key-type (symbol :tag "Major-Mode")
31 :value-type function)
32 :group 'simple-modeline)
33
25(defun acdw-modeline/buffer-name () ; gonsie 34(defun acdw-modeline/buffer-name () ; gonsie
26 "Display the buffer name in a face reflecting its modified status." 35 "Display the buffer name in a face reflecting its modified status."
27 (propertize " %b " 36 (propertize " %b "
@@ -92,23 +101,6 @@ indicator in the mode-line."
92 (read-only-mode 'toggle))))) 101 (read-only-mode 'toggle)))))
93 'mouse-face 'mode-line-highlight)))) 102 'mouse-face 'mode-line-highlight))))
94 103
95(defun acdw-modeline/minions () ; by me
96 "Display a button for `minions-minor-modes-menu'."
97 (concat
98 " "
99 (propertize
100 "&"
101 'help-echo (format
102 "Minor modes menu\nmouse-1: show menu.")
103 'local-map (purecopy (simple-modeline-make-mouse-map
104 'mouse-1
105 (lambda (event)
106 (interactive "e")
107 (with-selected-window (posn-window
108 (event-start event))
109 (minions-minor-modes-menu)))))
110 'mouse-face 'mode-line-highlight)))
111
112(defun acdw-modeline/narrowed () 104(defun acdw-modeline/narrowed ()
113 "Display an indication if the buffer is narrowed." 105 "Display an indication if the buffer is narrowed."
114 (when (buffer-narrowed-p) 106 (when (buffer-narrowed-p)
@@ -176,15 +168,6 @@ Only shows if there is more than one window."
176 (> winum--window-count 1)) 168 (> winum--window-count 1))
177 (format winum-format (winum-get-number-string)))) 169 (format winum-format (winum-get-number-string))))
178 170
179(defcustom acdw-modeline/word-count-modes
180 (mapcar (lambda (m) (cons m nil)) simple-modeline-word-count-modes)
181 "Alist of modes to functions that `acdw-modeline/word-count' should dispatch.
182If the cdr of the cons cell is nil, use the default function (`count-words').
183Otherwise, cdr should be a function that takes two points (see `count-words')."
184 :type '(alist :key-type (symbol :tag "Major-Mode")
185 :value-type function)
186 :group 'simple-modeline)
187
188(defun acdw-modeline/word-count () 171(defun acdw-modeline/word-count ()
189 "Display a buffer word count, depending on the major mode. 172 "Display a buffer word count, depending on the major mode.
190Uses `acdw-modeline/word-count-modes' to determine which function to use." 173Uses `acdw-modeline/word-count-modes' to determine which function to use."