]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't stop at field boundaries when counting words (Bug#41761)
authorDaniel Koning <dk@danielkoning.com>
Wed, 10 Jun 2020 19:42:39 +0000 (14:42 -0500)
committerStefan Kangas <stefankangas@gmail.com>
Fri, 14 Aug 2020 09:19:11 +0000 (11:19 +0200)
* 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

lisp/simple.el

index 6f72c3b81b99a6d1268c2a8ec17876aed64299b4..1cb93c5722b8f2343a12f6bd95b1b2ddaa3035af 100644 (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)