Don't stop at field boundaries when counting words (Bug#41761)

* lisp/simple.el (count-words): Ensure that `forward-word-strictly'
moves point from one field to the next during the word-counting loop.

Copyright-paperwork-exempt: yes
This commit is contained in:
Daniel Koning 2020-06-10 14:42:39 -05:00 committed by Stefan Kangas
parent f3ff51288f
commit c560ba3036

View file

@ -1323,7 +1323,9 @@ If called from Lisp, return the number of words between START and
END, without printing any message."
(interactive (list nil nil))
(cond ((not (called-interactively-p 'any))
(let ((words 0))
(let ((words 0)
;; Count across field boundaries. (Bug#41761)
(inhibit-field-text-motion t))
(save-excursion
(save-restriction
(narrow-to-region start end)