From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerald Wildgruber Subject: org-forward-paragraph doesn't work programatically (called from Lisp) Date: Sun, 7 Oct 2018 18:56:20 +0200 Message-ID: <878t394rwr.fsf@tu-berlin.de> Reply-To: wildgruber@tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9CMo-0002hW-Cs for emacs-orgmode@gnu.org; Sun, 07 Oct 2018 12:57:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9CM7-00029B-NV for emacs-orgmode@gnu.org; Sun, 07 Oct 2018 12:56:41 -0400 Received: from exchange.tu-berlin.de ([130.149.7.70]:60090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9CM7-0001mc-DF for emacs-orgmode@gnu.org; Sun, 07 Oct 2018 12:56:35 -0400 Received: from SPMA-01.tubit.win.tu-berlin.de (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 95E397DE6BA_BBA3AB6B for ; Sun, 7 Oct 2018 16:56:22 +0000 (GMT) Received: from exchange.tu-berlin.de (exchange.tu-berlin.de [130.149.7.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "exchange.tu-berlin.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by SPMA-01.tubit.win.tu-berlin.de (Sophos Email Appliance) with ESMTPS id 4E3417DE6AD_BBA3AB6F for ; Sun, 7 Oct 2018 16:56:22 +0000 (GMT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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