summary refs log tree commit diff stats
path: root/lisp/acdw-modeline.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw-modeline.el')
-rw-r--r--lisp/acdw-modeline.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index c073992..104ea28 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el
@@ -128,10 +128,11 @@ Otherwise, cdr should be a function that takes two points (see `count-words')."
128Uses `acdw-modeline/word-count-modes' to determine which function to use." 128Uses `acdw-modeline/word-count-modes' to determine which function to use."
129 (when-let ((modefun 129 (when-let ((modefun
130 (assoc major-mode acdw-modeline/word-count-modes #'equal))) 130 (assoc major-mode acdw-modeline/word-count-modes #'equal)))
131 (let ((fn (or (cdr modefun) 131 (let* ((fn (or (cdr modefun)
132 #'count-words)) 132 #'count-words))
133 (min (if (region-active-p) (region-beginning) (point-min))) 133 (r (region-active-p))
134 (max (if (region-active-p) (region-end) (point-max)))) 134 (min (if r (region-beginning) (point-min)))
135 (format " %dW" (funcall fn min max))))) 135 (max (if r (region-end) (point-max))))
136 (format " %s%dW" (if r "+" "") (funcall fn min max)))))
136 137
137(provide 'acdw-modeline) 138(provide 'acdw-modeline)