From 543186282747d1019c7f32a6a7c1c8cb627b5152 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 28 Aug 2021 00:25:26 -0500 Subject: Sort acdw-modeline.el --- lisp/acdw-modeline.el | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'lisp') 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 @@ (require 'simple-modeline) (require 'minions) +(defcustom acdw-modeline/word-count-modes + (mapcar (lambda (m) (cons m nil)) simple-modeline-word-count-modes) + "Alist of modes to functions that `acdw-modeline/word-count' should dispatch. +If the cdr of the cons cell is nil, use the default function (`count-words'). +Otherwise, cdr should be a function that takes two points (see `count-words')." + :type '(alist :key-type (symbol :tag "Major-Mode") + :value-type function) + :group 'simple-modeline) + (defun acdw-modeline/buffer-name () ; gonsie "Display the buffer name in a face reflecting its modified status." (propertize " %b " @@ -92,23 +101,6 @@ indicator in the mode-line." (read-only-mode 'toggle))))) 'mouse-face 'mode-line-highlight)))) -(defun acdw-modeline/minions () ; by me - "Display a button for `minions-minor-modes-menu'." - (concat - " " - (propertize - "&" - 'help-echo (format - "Minor modes menu\nmouse-1: show menu.") - 'local-map (purecopy (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (event) - (interactive "e") - (with-selected-window (posn-window - (event-start event)) - (minions-minor-modes-menu))))) - 'mouse-face 'mode-line-highlight))) - (defun acdw-modeline/narrowed () "Display an indication if the buffer is narrowed." (when (buffer-narrowed-p) @@ -176,15 +168,6 @@ Only shows if there is more than one window." (> winum--window-count 1)) (format winum-format (winum-get-number-string)))) -(defcustom acdw-modeline/word-count-modes - (mapcar (lambda (m) (cons m nil)) simple-modeline-word-count-modes) - "Alist of modes to functions that `acdw-modeline/word-count' should dispatch. -If the cdr of the cons cell is nil, use the default function (`count-words'). -Otherwise, cdr should be a function that takes two points (see `count-words')." - :type '(alist :key-type (symbol :tag "Major-Mode") - :value-type function) - :group 'simple-modeline) - (defun acdw-modeline/word-count () "Display a buffer word count, depending on the major mode. Uses `acdw-modeline/word-count-modes' to determine which function to use." -- cgit 1.4.1-21-gabe81