help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: [External] : How to get all paragraphs in list?


From: Yuri Khan
Subject: Re: [External] : How to get all paragraphs in list?
Date: Wed, 7 Sep 2022 20:05:32 +0700

On Wed, 7 Sept 2022 at 13:06, Jean Louis <bugs@gnu.support> wrote:

>       (while (< (point) end)
>         (funcall function)
>         (forward-paragraph)))))

This loop is fragile: if FUNCTION moves point backward in the buffer,
it may loop infinitely, or if it moves forward, it may skip some
paragraphs. I’d maybe wrap the funcall in a save-excursion.

More to the point[sic], you calculate and cache the END position as an
integer. So if your FUNCTION reduces the length of the buffer text,
you may never reach END. Should probably place a marker there, or
check for (region-end) or (point-max) every time.



reply via email to

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