diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-07-30 11:08:00 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-07-30 11:08:00 -0400 |
commit | 29e434fb34f40a8cfc7d668e15edbf08b4fec111 (patch) | |
tree | 8d89f78602ce69bde99e88ecde2995f599366557 | |
parent | 1f333cc970d7047ce180e809ad7b71120b78eb49 (diff) | |
download | emacs.d-29e434fb34f40a8cfc7d668e15edbf08b4fec111.tar.gz |
km/count-words-region: Add modes variable
-rw-r--r-- | lisp/km-editing.el | 5 |
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)) |