[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] org-forward-paragraph doesn't work programatically (called from Lisp
From: |
Gerald Wildgruber |
Subject: |
[O] org-forward-paragraph doesn't work programatically (called from Lisp) |
Date: |
Sun, 7 Oct 2018 18:56:20 +0200 |
User-agent: |
mu4e 1.1.0; emacs 27.0.50 |
Hi
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?
Thanks
--
Sent with mu4e
- [O] org-forward-paragraph doesn't work programatically (called from Lisp),
Gerald Wildgruber <=