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

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

Re: How to get all paragraphs in list?


From: Jean Louis
Subject: Re: How to get all paragraphs in list?
Date: Fri, 16 Sep 2022 17:21:38 +0300
User-agent: Mutt/+ () (2022-06-11)

* Emanuel Berg <incal@dataswamp.org> [2022-09-16 16:19]:
> Adopt the third idea as well and remove that last nil ...
> actually it is the only one.

(defun rcd-paragraphs-iterate (function)
  "Iterate FUNCTION over paragraphs.

FUNCTION must accept string as single argument."
  (let ((start (if (use-region-p) (region-beginning) (point-min)))
        (end (if (use-region-p) (region-end) (point-max))))
    (save-excursion
      (goto-char start)
      (while (< (point) end)
        (funcall function)
        (forward-paragraph)))))

Help me with this one. Problem is with (while (< (point) end) as it
will not accurately move every time.x


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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