From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Convert list to paragraph Date: Sat, 27 Aug 2011 02:59:51 +0200 Message-ID: <87ippjmzy0.fsf@gmail.com> References: <5350.1314394027@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx7GB-0003Wd-3k for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 21:00:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qx7G9-00082q-RK for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 21:00:31 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:63029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qx7G9-00082f-IY for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 21:00:29 -0400 Received: by wwf10 with SMTP id 10so3246697wwf.30 for ; Fri, 26 Aug 2011 18:00:28 -0700 (PDT) In-Reply-To: <5350.1314394027@alphaville.americas.hpqcorp.net> (Nick Dokos's message of "Fri, 26 Aug 2011 17:27:07 -0400") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, Derek Thomas Hello, Nick Dokos writes: > (defun org-list-to-paragraph () > "Convert the list at point into a paragraph." > (interactive) > (insert (org-list-to-generic (org-list-parse-list t) '(:ustart "" :splice t :isep " " :nobr t )))) > > > (defun org-lists-to-paragraphs () > (goto-char (point-min)) > (condition-case nil > (while (org-list-search-forward "+ ") > (org-list-to-paragraph)) > (error nil))) > > (add-hook 'org-export-preprocess-hook (function org-lists-to-paragraphs)) [...] > ngz will probably suggest changes and improvements on this basic model. Well, just that "^[ \t]*\\+\\($\\| +\\)" is a more accurate search string. Otherwise, it could stop too early. Now, this might also be a solution for Thomas S. Dye's "paralistification" problem[1]: in an export hook, transform lists without a preceding blank line into paralist forms, thanks to `org-list-to-generic'. Regards, [1] http://permalink.gmane.org/gmane.emacs.orgmode/46151 -- Nicolas Goaziou