diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-07-02 00:54:52 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-07-02 00:54:52 -0400 |
commit | be57e624fa279ee847e33372c4b333881d3a9e8f (patch) | |
tree | 2d6030413e73be54d967950778072eeb2f7981c6 /lisp | |
parent | cc7a846adf97880313764b54c85c3676e53b69f8 (diff) | |
download | emacs.d-be57e624fa279ee847e33372c4b333881d3a9e8f.tar.gz |
count-words-region: Count hyphenated words as one word
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/km-editing.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/km-editing.el b/lisp/km-editing.el index e172fec..e7a5cba 100644 --- a/lisp/km-editing.el +++ b/lisp/km-editing.el @@ -110,7 +110,14 @@ XSELECT is non-nil, copy the region with `x-select-text'." (when comment-char (flush-lines (concat "^" (regexp-quote comment-char) ".*$"))))) -(defvar km/count-words-region-filter-functions '(km/delete-comment-lines) +(defun km/delete-hyphens (orig-buf) + (save-excursion + (while (search-forward "-" nil t) + (delete-char -1)))) + +(defvar km/count-words-region-filter-functions + '(km/delete-comment-lines + km/delete-hyphens) "Hooks run by `km/count-words-region-filtered'. These will be called in a temporary buffer and should delete any text that should not be considered by `count-words-region'. They |