summary refs log tree commit diff stats
path: root/lisp/acdw-modeline.el
diff options
context:
space:
mode:
authorCase Duckworth2021-08-10 14:47:33 -0500
committerCase Duckworth2021-08-10 14:47:33 -0500
commitefd14ea6b14233c698508c3e982bd6492436b431 (patch)
treec161bf1e4b3d5f9570156e418ad5ccd5370e0669 /lisp/acdw-modeline.el
parentAdd acdw-modeline/position (diff)
downloademacs-efd14ea6b14233c698508c3e982bd6492436b431.tar.gz
emacs-efd14ea6b14233c698508c3e982bd6492436b431.zip
Add docstrings
Diffstat (limited to 'lisp/acdw-modeline.el')
-rw-r--r--lisp/acdw-modeline.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 4e6b002..f1e7d27 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el
@@ -23,6 +23,7 @@
23(require 'minions) 23(require 'minions)
24 24
25(defun acdw-modeline/buffer-name () ; gonsie 25(defun acdw-modeline/buffer-name () ; gonsie
26 "Display the buffer name in a face reflecting its modified status."
26 (propertize " %b " 27 (propertize " %b "
27 'face 28 'face
28 (if (buffer-modified-p) 29 (if (buffer-modified-p)
@@ -38,6 +39,7 @@
38 (format-mode-line erc-modified-channels-object))) 39 (format-mode-line erc-modified-channels-object)))
39 40
40(defun acdw-modeline/god-mode-indicator () 41(defun acdw-modeline/god-mode-indicator ()
42 "Display an indicator if `god-local-mode' is active."
41 (when (bound-and-true-p god-local-mode) 43 (when (bound-and-true-p god-local-mode)
42 " God")) 44 " God"))
43 45
@@ -124,6 +126,7 @@ is, if point < mark."
124 'font-lock-face 'font-lock-variable-name-face)))) 126 'font-lock-face 'font-lock-variable-name-face))))
125 127
126(defun acdw-modeline/text-scale () 128(defun acdw-modeline/text-scale ()
129 "Display the text scaling from the modeline, if scaled."
127 ;; adapted from https://github.com/seagle0128/doom-modeline 130 ;; adapted from https://github.com/seagle0128/doom-modeline
128 (when (and (boundp 'text-scale-mode-amount) 131 (when (and (boundp 'text-scale-mode-amount)
129 (/= text-scale-mode-amount 0)) 132 (/= text-scale-mode-amount 0))
@@ -134,11 +137,14 @@ is, if point < mark."
134 text-scale-mode-amount))) 137 text-scale-mode-amount)))
135 138
136(defun acdw-modeline/vc-branch () 139(defun acdw-modeline/vc-branch ()
140 "Display the version control branch of the current buffer in the modeline."
137 ;; from https://www.gonsie.com/blorg/modeline.html, from Doom 141 ;; from https://www.gonsie.com/blorg/modeline.html, from Doom
138 (if-let ((backend (vc-backend buffer-file-name))) 142 (if-let ((backend (vc-backend buffer-file-name)))
139 (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))) 143 (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2))))
140 144
141(defun acdw-modeline/winum () 145(defun acdw-modeline/winum ()
146 "Show the `winum' number of the current window in the modeline.
147Only shows if there is more than one window."
142 (when (and (bound-and-true-p winum-mode) 148 (when (and (bound-and-true-p winum-mode)
143 (> winum--window-count 1)) 149 (> winum--window-count 1))
144 (format winum-format (winum-get-number-string)))) 150 (format winum-format (winum-get-number-string))))