summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
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))