summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-07-30 11:08:00 -0400
committerKyle Meyer <kyle@kyleam.com>2016-07-30 11:08:00 -0400
commit29e434fb34f40a8cfc7d668e15edbf08b4fec111 (patch)
tree8d89f78602ce69bde99e88ecde2995f599366557 /lisp
parent1f333cc970d7047ce180e809ad7b71120b78eb49 (diff)
downloademacs.d-29e434fb34f40a8cfc7d668e15edbf08b4fec111.tar.gz
km/count-words-region: Add modes variable
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-editing.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/km-editing.el b/lisp/km-editing.el
index e7a5cba..34f7130 100644
--- a/lisp/km-editing.el
+++ b/lisp/km-editing.el
@@ -125,6 +125,9 @@ will be passed the original buffer. At the start of the function
call, the point will be at the beginning of the buffer, and these
functions should return it there.")
+(defvar km/count-words-region-modes '(text-mode latex-mode)
+ "Use `km/count-words-region-filter-functions' in modes derived from these.")
+
;;;###autoload
(defun km/count-words-region (start end &optional arg)
"Call `count-words-region', possibly filtering input.
@@ -134,7 +137,7 @@ is called. If the buffer's mode does not derive from
(interactive (if current-prefix-arg
(list nil nil current-prefix-arg)
(list (region-beginning) (region-end) nil)))
- (if (not (derived-mode-p 'text-mode))
+ (if (not (apply #'derived-mode-p km/count-words-region-modes))
(call-interactively #'count-words-region)
(let ((mode major-mode)
(buf (current-buffer))