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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41761 in the body.
You can then email your comments to 41761 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Mon, 08 Jun 2020 16:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pip Cet <pipcet <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 08 Jun 2020 16:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; M-x count-words counts words only up to a field boundary
Date: Mon, 08 Jun 2020 16:52:25 +0000
(dotimes (i 10) (insert (propertize "test " 'field (cons nil nil))))

C-p C-a C-n C-SPC C-e M-x count-words

Expected result:

message "Region has 1 line, 10 words, and 50 characters"

Actual result:

message "Region has 1 line, 1 word, and 50 characters"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Wed, 10 Jun 2020 20:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Koning <dk <at> danielkoning.com>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 41761 <at> debbugs.gnu.org
Subject: [PATCH] bug#41761: 28.0.50; M-x count-words counts words only up to
 a field boundary
Date: Wed, 10 Jun 2020 15:15:32 -0500
[Message part 1 (text/plain, inline)]
Pip Cet <pipcet <at> gmail.com> writes:

> Expected result:
>
> message "Region has 1 line, 10 words, and 50 characters"
>
> Actual result:
>
> message "Region has 1 line, 1 word, and 50 characters"

`count-words' should be disabling field-boundary behavior in
`forward-word-strictly' by setting `inhibit-field-text-motion'. Patch
included.

I grepped for other calls to `count-words' that might be making the same
omission, but everything I saw looked like a use case that should
respect field boundaries.

Daniel

[0001-Don-t-stop-at-field-boundaries-when-counting-words-B.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 13 Aug 2020 00:51:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Fri, 14 Aug 2020 09:59:01 GMT) Full text and rfc822 format available.

Message #13 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Fri, 14 Aug 2020 02:58:19 -0700
close 41761 28.1
thanks

Daniel Koning <dk <at> danielkoning.com> writes:

> Pip Cet <pipcet <at> gmail.com> writes:
>
>> Expected result:
>>
>> message "Region has 1 line, 10 words, and 50 characters"
>>
>> Actual result:
>>
>> message "Region has 1 line, 1 word, and 50 characters"
>
> `count-words' should be disabling field-boundary behavior in
> `forward-word-strictly' by setting `inhibit-field-text-motion'. Patch
> included.

Thanks for the patch.  It looks good to me so I pushed it as commit
c560ba3036d8.  I also pushed a regression test for this bug separately.

Closing this bug now.

Best regards,
Stefan Kangas




bug marked as fixed in version 28.1, send any further explanations to 41761 <at> debbugs.gnu.org and Pip Cet <pipcet <at> gmail.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 14 Aug 2020 09:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Fri, 14 Aug 2020 11:09:02 GMT) Full text and rfc822 format available.

Message #18 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 41761 <at> debbugs.gnu.org, pipcet <at> gmail.com, dk <at> danielkoning.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50;
 M-x count-words counts words only up to a field boundary
Date: Fri, 14 Aug 2020 14:08:18 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 14 Aug 2020 02:58:19 -0700
> Cc: 41761 <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
> 
> >> Expected result:
> >>
> >> message "Region has 1 line, 10 words, and 50 characters"
> >>
> >> Actual result:
> >>
> >> message "Region has 1 line, 1 word, and 50 characters"
> >
> > `count-words' should be disabling field-boundary behavior in
> > `forward-word-strictly' by setting `inhibit-field-text-motion'. Patch
> > included.
> 
> Thanks for the patch.  It looks good to me so I pushed it as commit
> c560ba3036d8.

Thanks.  This change in behavior should be in NEWS.  And I'm not sure
we shouldn't provide an optional knob to get back the old behavior:
some package or user might rely on it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Fri, 14 Aug 2020 18:52:02 GMT) Full text and rfc822 format available.

Message #21 received at 41761 <at> debbugs.gnu.org (full text, mbox):

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: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Fri, 14 Aug 2020 13:48:44 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

> This change in behavior should be in NEWS.  And I'm not sure
> we shouldn't provide an optional knob to get back the old behavior:
> some package or user might rely on it.

I don't think I agree. The "new" behavior is what the documentation
described to begin with. And it's a complexity burden to solder new
switches onto these simple functions -- more burdensome (I say) than
trusting users to impose the constraint by hand if that's what they
want. Something like:

    (count-words start (min end (field-end start t)))

Daniel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Fri, 14 Aug 2020 19:16:01 GMT) Full text and rfc822 format available.

Message #24 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Fri, 14 Aug 2020 22:15:14 +0300
> From: Daniel Koning <dk <at> danielkoning.com>
> Cc: Stefan Kangas <stefan <at> marxist.se>,  41761 <at> debbugs.gnu.org,
>   pipcet <at> gmail.com
> Date: Fri, 14 Aug 2020 13:48:44 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > This change in behavior should be in NEWS.  And I'm not sure
> > we shouldn't provide an optional knob to get back the old behavior:
> > some package or user might rely on it.
> 
> I don't think I agree.

It's okay to disagree, but I still think it should be in NEWS.  It's a
change in a long-standing behavior, so users should be told about it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Fri, 14 Aug 2020 19:46:01 GMT) Full text and rfc822 format available.

Message #27 received at 41761 <at> debbugs.gnu.org (full text, mbox):

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

>> > This change in behavior should be in NEWS.  And I'm not sure
>> > we shouldn't provide an optional knob to get back the old behavior:
>> > some package or user might rely on it.
>>
>> I don't think I agree.
>
> It's okay to disagree, but I still think it should be in NEWS.

Excuse my imprecision in quoting you; I don't object to the change going
into NEWS. I just meant to contend that the old behavior shouldn't be
enshrined in a customization item or anything like that. Some deeply
rooted bugs become load-bearing over time, but this doesn't look like
one of those, only (you might say literally) an overlooked edge case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Fri, 14 Aug 2020 23:07:01 GMT) Full text and rfc822 format available.

Message #30 received at 41761 <at> debbugs.gnu.org (full text, mbox):

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

> It's okay to disagree, but I still think it should be in NEWS.  It's a
> change in a long-standing behavior, so users should be told about it.

I'm not sure how to best formulate the NEWS.

Does this look okay?

diff --git a/etc/NEWS b/etc/NEWS
index 53e60cdb5c..b375fef5b7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -145,6 +145,11 @@ setting the variable 'auto-save-visited-mode'
buffer-locally to nil.
 description of the properties.  Likewise 'button-describe' does the
 same for a button.

+---
+** '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.
+
 
 * Changes in Specialized Modes and Packages in Emacs 28.1




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sat, 15 Aug 2020 06:31:01 GMT) Full text and rfc822 format available.

Message #33 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: 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 09:30:35 +0300
> From: Daniel Koning <dk <at> danielkoning.com>
> Cc: stefan <at> marxist.se,  41761 <at> debbugs.gnu.org,  pipcet <at> gmail.com
> Date: Fri, 14 Aug 2020 14:44:52 -0500
> 
> this doesn't look like one of those, only (you might say literally)
> an overlooked edge case.

We have no reliable way of determining whether that is the case.
backward-compatibility is important in a veteran package such as
Emacs, so we generally try at least to give users who want previous
behavior a fire escape.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sat, 15 Aug 2020 16:29:01 GMT) Full text and rfc822 format available.

Message #36 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 41761 <at> debbugs.gnu.org, pipcet <at> gmail.com, dk <at> danielkoning.com
Subject: Re: 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 19:28:14 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 14 Aug 2020 16:06:30 -0700
> Cc: 41761 <at> debbugs.gnu.org, pipcet <at> gmail.com
> 
> +** '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.
Something like

  'count-words' now crosses field boundaries.
  Originally, 'count-words' ignored the text inside field boundaries,
  now it includes such text in the count.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sat, 15 Aug 2020 17:45:02 GMT) Full text and rfc822 format available.

Message #39 received at 41761 <at> debbugs.gnu.org (full text, mbox):

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: Re: 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sat, 15 Aug 2020 17:50:02 GMT) Full text and rfc822 format available.

Message #42 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: 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 20:48:43 +0300
> From: Daniel Koning <dk <at> danielkoning.com>
> Cc: Stefan Kangas <stefan <at> marxist.se>,  41761 <at> debbugs.gnu.org,
>   pipcet <at> gmail.com
> Date: Sat, 15 Aug 2020 12:44:10 -0500
> 
> 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.

Sorry, I don't understand the point you are trying to make.  Is
something wrong or inaccurate with the text I proposed for NEWS?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sat, 15 Aug 2020 19:45:02 GMT) Full text and rfc822 format available.

Message #45 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Koning <dk <at> danielkoning.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: 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 14:44:18 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

> Is something wrong or inaccurate with the text I proposed for NEWS?

Based on other NEWS entries, and the discussion earlier in this thread
of Stefan's original phrasing, I assumed that it was customary to
mention in NEWS that a change fixes a defect (which I believe this one
is, for the reasons I outlined in my last message). If that's not
expected, then it doesn't much matter.

I do think the prior behavior differs somewhat from the way you phrased
it. I would write it as:

    Originally, when 'inhibit-field-text-motion' was nil, 'count-words'
    stopped counting words at the end of the field containing START.

(It didn't ignore text inside fields, but rather text that was not
inside one specific field.)

Daniel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sun, 16 Aug 2020 14:13:02 GMT) Full text and rfc822 format available.

Message #48 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Sun, 16 Aug 2020 17:12:22 +0300
> From: Daniel Koning <dk <at> danielkoning.com>
> Cc: stefan <at> marxist.se,  41761 <at> debbugs.gnu.org,  pipcet <at> gmail.com
> Date: Sat, 15 Aug 2020 14:44:18 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Is something wrong or inaccurate with the text I proposed for NEWS?
> 
> Based on other NEWS entries, and the discussion earlier in this thread
> of Stefan's original phrasing, I assumed that it was customary to
> mention in NEWS that a change fixes a defect (which I believe this one
> is, for the reasons I outlined in my last message). If that's not
> expected, then it doesn't much matter.

No, we don't mention bug fixes in NEWS.

> I do think the prior behavior differs somewhat from the way you phrased
> it. I would write it as:
> 
>     Originally, when 'inhibit-field-text-motion' was nil, 'count-words'
>     stopped counting words at the end of the field containing START.
> 
> (It didn't ignore text inside fields, but rather text that was not
> inside one specific field.)

I'm not sure I understand the "end of field containing START" part.
Supposed the region includes several fields, what would the previous
code do?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sun, 16 Aug 2020 19:05:01 GMT) Full text and rfc822 format available.

Message #51 received at 41761 <at> debbugs.gnu.org (full text, mbox):

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

>> I do think the prior behavior differs somewhat from the way you phrased
>> it. I would write it as:
>>
>>     Originally, when 'inhibit-field-text-motion' was nil, 'count-words'
>>     stopped counting words at the end of the field containing START.
>>
>> (It didn't ignore text inside fields, but rather text that was not
>> inside one specific field.)
>
> I'm not sure I understand the "end of field containing START" part.
> Supposed the region includes several fields, what would the previous
> code do?

It would only count the words between START and the next field boundary,
no matter how many fields came after that. (For START, substitute "the
beginning of the region" or "the beginning of the buffer" if it was
called interactively.)

Try reinstalling the old function definition and evaluating:

ELISP> (with-temp-buffer
         (dotimes (i 9) (insert (propertize "4 words 22 characters " 'field i)))
         (insert "\n4 words 22 characters")
         (call-interactively #'count-words)) ; operates on whole buffer

=> "Buffer has 2 lines, 4 words, and 220 characters."

That result arises because of how `count-words' generates its return
value: it moves point to the beginning of the buffer (after narrowing
the buffer to START and END if they were supplied), then repeatedly
calls `forward-word-strictly' until that function returns nil,
incrementing the running total each time. Before, if it ran into a field
boundary, it would stop short, because `forward-word-strictly' doesn't
jump field boundaries by default.

I think the value of that form demonstrates why the old behavior was
wrong. There does not exist any part of the temp buffer that "has 2
lines, 4 words, and 220 characters." It gives inconsistent results
because the line count and character count use techniques which aren't
affected by fields.

Daniel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sun, 16 Aug 2020 19:28:02 GMT) Full text and rfc822 format available.

Message #54 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Sun, 16 Aug 2020 22:27:01 +0300
> From: Daniel Koning <dk <at> danielkoning.com>
> Cc: stefan <at> marxist.se,  41761 <at> debbugs.gnu.org,  pipcet <at> gmail.com
> Date: Sun, 16 Aug 2020 14:04:14 -0500
> 
> > I'm not sure I understand the "end of field containing START" part.
> > Supposed the region includes several fields, what would the previous
> > code do?
> 
> It would only count the words between START and the next field boundary,
> no matter how many fields came after that. (For START, substitute "the
> beginning of the region" or "the beginning of the buffer" if it was
> called interactively.)

Thanks, then how about this NEWS entry:

  'count-words' now crosses field boundaries.
  Originally, 'count-words' would stop counting at the first field
  boundary it encountered; now it keeps counting all the way to the
  region's (or buffer's) end.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Sun, 16 Aug 2020 19:39:01 GMT) Full text and rfc822 format available.

Message #57 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Koning <dk <at> danielkoning.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41761 <at> debbugs.gnu.org, stefan <at> marxist.se, pipcet <at> gmail.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Sun, 16 Aug 2020 14:37:54 -0500
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, then how about this NEWS entry:
>
>   'count-words' now crosses field boundaries.
>   Originally, 'count-words' would stop counting at the first field
>   boundary it encountered; now it keeps counting all the way to the
>   region's (or buffer's) end.

Looks accurate to me. Thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Mon, 17 Aug 2020 13:52:01 GMT) Full text and rfc822 format available.

Message #60 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>, Daniel Koning <dk <at> danielkoning.com>
Cc: 41761 <at> debbugs.gnu.org, pipcet <at> gmail.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Mon, 17 Aug 2020 13:51:02 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, then how about this NEWS entry:
>
>   'count-words' now crosses field boundaries.
>   Originally, 'count-words' would stop counting at the first field
>   boundary it encountered; now it keeps counting all the way to the
>   region's (or buffer's) end.

LGTM as well.  Please push to master.

(Or, if it's more convenient for you, I could push it in your name.)

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41761; Package emacs. (Mon, 17 Aug 2020 16:13:02 GMT) Full text and rfc822 format available.

Message #63 received at 41761 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 41761 <at> debbugs.gnu.org, pipcet <at> gmail.com, dk <at> danielkoning.com
Subject: Re: bug#41761: [PATCH] bug#41761: 28.0.50; M-x count-words counts
 words only up to a field boundary
Date: Mon, 17 Aug 2020 19:12:37 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Mon, 17 Aug 2020 13:51:02 +0000
> Cc: 41761 <at> debbugs.gnu.org, pipcet <at> gmail.com
> 
> >   'count-words' now crosses field boundaries.
> >   Originally, 'count-words' would stop counting at the first field
> >   boundary it encountered; now it keeps counting all the way to the
> >   region's (or buffer's) end.
> 
> LGTM as well.  Please push to master.

Done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 196 days ago.

Previous Next


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