emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Gerald Wildgruber <wildgruber@tu-berlin.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-forward-paragraph doesn't work programatically (called from Lisp)
Date: Sun, 07 Oct 2018 21:32:49 +0200	[thread overview]
Message-ID: <87tvlxo8m6.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <878t394rwr.fsf@tu-berlin.de> (Gerald Wildgruber's message of "Sun, 7 Oct 2018 18:56:20 +0200")

Hello,

Gerald Wildgruber <wildgruber@tu-berlin.de> 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

  reply	other threads:[~2018-10-07 19:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07 16:56 org-forward-paragraph doesn't work programatically (called from Lisp) Gerald Wildgruber
2018-10-07 19:32 ` Nicolas Goaziou [this message]
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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87tvlxo8m6.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=wildgruber@tu-berlin.de \
    /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 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).