[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : How to get all paragraphs in list?
From: |
Drew Adams |
Subject: |
RE: [External] : How to get all paragraphs in list? |
Date: |
Wed, 7 Sep 2022 15:04:07 +0000 |
> From: Yuri Khan
>
> > (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.
What Yuri said.
And I pointed you to using the debugger, if you
want to see and understand just what's going on
in your code. You can also insert calls to
`message' in it at various places, to print values.
And you can insert calls to `debug' in it, as
breakpoints - e.g. (debug nil EVAL-ME1 EVAL-ME2...).
- Re: How to get all paragraphs in list?, (continued)
RE: [External] : How to get all paragraphs in list?, Drew Adams, 2022/09/05
- Re: [External] : How to get all paragraphs in list?, Jean Louis, 2022/09/05
- RE: [External] : How to get all paragraphs in list?, Drew Adams, 2022/09/05
- RE: [External] : How to get all paragraphs in list?, Jean Louis, 2022/09/06
- Re: [External] : How to get all paragraphs in list?, Jean Louis, 2022/09/07
- Re: [External] : How to get all paragraphs in list?, Yuri Khan, 2022/09/07
- RE: [External] : How to get all paragraphs in list?,
Drew Adams <=
- Re: [External] : How to get all paragraphs in list?, Emanuel Berg, 2022/09/16
- Re: [External] : How to get all paragraphs in list?, Yuri Khan, 2022/09/16
- Re: [External] : How to get all paragraphs in list?, Jean Louis, 2022/09/16
- Re: [External] : How to get all paragraphs in list?, Jean Louis, 2022/09/16
Re: [External] : How to get all paragraphs in list?, Emanuel Berg, 2022/09/16
Re: How to get all paragraphs in list?, Emanuel Berg, 2022/09/05