summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-08-28 00:23:56 -0500
committerCase Duckworth2021-08-28 00:23:56 -0500
commit47df2733de3f5e5ba8384cc4e11a31235a9cfc5b (patch)
tree369c4e08945a46340a8ee39e5f38e4852335e7f8 /lisp
parentComment out all the things (with helpful-mode) (diff)
downloademacs-47df2733de3f5e5ba8384cc4e11a31235a9cfc5b.tar.gz
emacs-47df2733de3f5e5ba8384cc4e11a31235a9cfc5b.zip
Buttonize major mode in modeline
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-modeline.el30
1 files changed, 29 insertions, 1 deletions
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 5784148..00eb056 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el
@@ -40,7 +40,35 @@
40(defun acdw-modeline/god-mode-indicator () 40(defun acdw-modeline/god-mode-indicator ()
41 "Display an indicator if `god-local-mode' is active." 41 "Display an indicator if `god-local-mode' is active."
42 (when (bound-and-true-p god-local-mode) 42 (when (bound-and-true-p god-local-mode)
43 " God")) 43 " Ω"))
44
45(defun acdw-modeline/major-mode ()
46 "Displays the current major mode in the mode-line."
47 (propertize
48 (concat " "
49 (or (and (boundp 'delighted-modes)
50 (cadr (assq major-mode delighted-modes)))
51 (format-mode-line mode-name)))
52 'face 'bold
53 'keymap mode-line-major-mode-keymap
54 'mouse-face 'mode-line-highlight))
55
56(defun acdw-modeline/minions () ; by me
57 "Display a button for `minions-minor-modes-menu'."
58 (concat
59 " "
60 (propertize
61 "&"
62 'help-echo (format
63 "Minor modes menu\nmouse-1: show menu.")
64 'local-map (purecopy (simple-modeline-make-mouse-map
65 'mouse-1
66 (lambda (event)
67 (interactive "e")
68 (with-selected-window (posn-window
69 (event-start event))
70 (minions-minor-modes-menu)))))
71 'mouse-face 'mode-line-highlight)))
44 72
45(defun acdw-modeline/modified () ; modified from `simple-modeline' 73(defun acdw-modeline/modified () ; modified from `simple-modeline'
46 "Displays a color-coded buffer modification/read-only 74 "Displays a color-coded buffer modification/read-only