[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c560ba3 1/2: Don't stop at field boundaries when counting words (
From: |
Stefan Kangas |
Subject: |
master c560ba3 1/2: Don't stop at field boundaries when counting words (Bug#41761) |
Date: |
Fri, 14 Aug 2020 05:49:25 -0400 (EDT) |
branch: master
commit c560ba3036d8382c29664a355179b63501786114
Author: Daniel Koning <dk@danielkoning.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
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
---
lisp/simple.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 6f72c3b..1cb93c5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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)