emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting sentences in `count-words'


From: Filipp Gunbin
Subject: Re: Counting sentences in `count-words'
Date: Tue, 24 May 2022 18:57:58 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)

On 23/05/2022 15:18 +0200, Manuel Giraud wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> It may be better to move count-sentences to paragraphs.el.
>
> Ok. Here is a new version of the patch.
>

With just a single newline in file, (count-sentences (point-min)
(point-max)) loops indefinitely.

I guess there're two options for safe movement:

- Either rely on what movement function returns - in this case
  forward-sentence doesn't specify return value, so no luck

- Or track the point yourself, and check whether you've moved.  I think
  you should do this here.

Filipp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]