From 29e434fb34f40a8cfc7d668e15edbf08b4fec111 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 30 Jul 2016 11:08:00 -0400 Subject: km/count-words-region: Add modes variable --- lisp/km-editing.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp') 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)) -- cgit v1.2.3