all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gerald Wildgruber <wildgruber@tu-berlin.de>
To: emacs-orgmode@gnu.org
Subject: org-forward-paragraph doesn't work programatically (called from Lisp)
Date: Sun, 7 Oct 2018 18:56:20 +0200	[thread overview]
Message-ID: <878t394rwr.fsf@tu-berlin.de> (raw)


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

             reply	other threads:[~2018-10-07 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07 16:56 Gerald Wildgruber [this message]
2018-10-07 19:32 ` org-forward-paragraph doesn't work programatically (called from Lisp) Nicolas Goaziou
2018-10-07 20:27   ` Gerald Wildgruber
2018-10-07 23:14     ` Kyle Meyer
2018-10-08  5:32       ` Gerald Wildgruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t394rwr.fsf@tu-berlin.de \
    --to=wildgruber@tu-berlin.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.