[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-forward-paragraph doesn't work programatically (called from
From: |
Nicolas Goaziou |
Subject: |
Re: [O] org-forward-paragraph doesn't work programatically (called from Lisp) |
Date: |
Sun, 07 Oct 2018 21:32:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello,
Gerald Wildgruber <address@hidden> writes:
> I'm trying to unfill/unwrap Org mode files because I switched from
> auto-fill-mode to visual-line/visual-fill-column mode.
>
> I'd like to harmonize = unfill my already existing (filled) Org mode files. I
> took the function in
>
> https://www.emacswiki.org/emacs/UnfillParagraph)
>
> and tried the following (from within an emacs lisp buffer):
>
> (let ((fill-column most-positive-fixnum))
> (dolist (f (directory-files-recursively
> "~/directory/with/org/files/" (rx (or ".org" ".outl") eos)))
> (with-current-buffer (find-file-noselect f)
> (while (not (eobp))
> (fill-paragraph)
> (org-forward-paragraph))
> (save-buffer))))
>
> I thought this would iterate over all paragraphs (or org-wise equivalent
> structures) until end of file is reached and unfill each one of them.
>
> But it doesn't work. The iteration doesn't happen, it somehow doesn't move
> forward. It works though, if called interactively in an Org mode file.
>
> Why is that, how can I use org-forward-paragraph programmatically?
I cannot reproduce your problem. What Org version are you using?
Regards,
--
Nicolas Goaziou