summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-modeline.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 3836c81..25502ec 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el
@@ -35,8 +35,7 @@ Otherwise, cdr should be a function that takes two points (see `count-words')."
35 "Display the buffer name in a face reflecting its modified status." 35 "Display the buffer name in a face reflecting its modified status."
36 (propertize (concat " " 36 (propertize (concat " "
37 (truncate-string (/ (window-total-width) 2) 37 (truncate-string (/ (window-total-width) 2)
38 (buffer-name) "~") 38 (buffer-name) "~"))
39 " ")
40 'face 39 'face
41 (if (buffer-modified-p) 40 (if (buffer-modified-p)
42 'font-lock-warning-face 41 'font-lock-warning-face
@@ -135,15 +134,15 @@ is, if point < mark."
135 `((line-number-mode 134 `((line-number-mode
136 ((column-number-mode 135 ((column-number-mode
137 (column-number-indicator-zero-based 136 (column-number-indicator-zero-based
138 (8 " %l:%c") 137 (9 " %l/%c")
139 (8 " %l:%C")) 138 (9 " %l/%C"))
140 (5 " L%l"))) 139 (6 " L%l")))
141 ((column-number-mode 140 ((column-number-mode
142 (column-number-indicator-zero-based 141 (column-number-indicator-zero-based
143 (5 " C%c") 142 (5 " C%c")
144 (5 " C%C"))))) 143 (5 " C%C")))))
145 ,(if (region-active-p) 144 ,(if (region-active-p)
146 (propertize (format "%s%s" 145 (propertize (format "%s%-5d"
147 (if (and (mark) 146 (if (and (mark)
148 (< (point) (mark))) 147 (< (point) (mark)))
149 "-" 148 "-"
@@ -172,14 +171,14 @@ is, if point < mark."
172 171
173(defun acdw-modeline/track () 172(defun acdw-modeline/track ()
174 "Display `tracking-mode' information." 173 "Display `tracking-mode' information."
175 (when tracking-mode 174 '(tracking-mode
176 tracking-mode-line-buffers)) 175 tracking-mode-line-buffers))
177 176
178(defun acdw-modeline/vc-branch () 177(defun acdw-modeline/vc-branch ()
179 "Display the version control branch of the current buffer in the modeline." 178 "Display the version control branch of the current buffer in the modeline."
180 ;; from https://www.gonsie.com/blorg/modeline.html, from Doom 179 ;; from https://www.gonsie.com/blorg/modeline.html, from Doom
181 (if-let ((backend (vc-backend buffer-file-name))) 180 (if-let ((backend (vc-backend buffer-file-name)))
182 (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))) 181 (concat " " (substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))))
183 182
184(defun acdw-modeline/wc () 183(defun acdw-modeline/wc ()
185 "Display current `wc-buffer-stats'." 184 "Display current `wc-buffer-stats'."
@@ -206,3 +205,4 @@ Uses `acdw-modeline/word-count-modes' to determine which function to use."
206 (format " %s%dW" (if r "+" "") (funcall fn min max))))) 205 (format " %s%dW" (if r "+" "") (funcall fn min max)))))
207 206
208(provide 'acdw-modeline) 207(provide 'acdw-modeline)
208;;; acdw-modeline.el ends here