GNU bug report logs - #41761
28.0.50; M-x count-words counts words only up to a field boundary

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Mon, 8 Jun 2020 16:53:01 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Koning <dk <at> danielkoning.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41761 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>, pipcet <at> gmail.com
Subject: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts words only up to a field boundary
Date: Sat, 15 Aug 2020 12:44:10 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

>> +** 'count-words' now skips field boundaries.
>> +Before, 'count-words' incorrectly stopped counting the number of words
>> +in buffer at a field boundary.  This bug has been fixed.
>
> I don't think it was a bug, so the wording should be different.

If the old behavior didn't qualify as a bug, then wouldn't you say the
docstring was buggy? It said that the function returned or printed
something that it really didn't ("the number of words between START and
END"). And there's nothing in the docs to suggest that we should read
that as "between START and END, or between START and the next field
boundary if that boundary comes before END."

(Nor does this rule apply to the other tallies that the function makes.
Put an extra line of text beneath the line containing the several
fields, and the interactive `count-words' message will reflect that line
in its line count and character count, but not in its word count. So
between "(defun count-words" and its matching ")", something is amiss,
whether it's code or documentation.)

If you don't like the word "bug" for this, the NEWS item might at least
mention that the prior behavior was undocumented and inconsistent, just
to clarify why the manual entry isn't changing along with the code.

Daniel




This bug report was last modified 4 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.