emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-forward-paragraph doesn't work programatically (called from Lisp)
@ 2018-10-07 16:56 Gerald Wildgruber
  2018-10-07 19:32 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Gerald Wildgruber @ 2018-10-07 16:56 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-08  5:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07 16:56 org-forward-paragraph doesn't work programatically (called from Lisp) Gerald Wildgruber
2018-10-07 19:32 ` Nicolas Goaziou
2018-10-07 20:27   ` Gerald Wildgruber
2018-10-07 23:14     ` Kyle Meyer
2018-10-08  5:32       ` Gerald Wildgruber

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).