From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: [PATCH] babel: delaying call to block preprocessing Date: Fri, 12 Nov 2010 03:15:37 +0100 Message-ID: <87vd432som.wl%n.goaziou@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Fri_Nov_12_03:15:37_2010-1" Return-path: Received: from [140.186.70.92] (port=46170 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGjAx-0000ht-3f for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 21:15:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGjAw-0002es-4i for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 21:15:39 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:47059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGjAv-0002ek-VF for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 21:15:38 -0500 Received: by wwi17 with SMTP id 17so1389169wwi.30 for ; Thu, 11 Nov 2010 18:15:37 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode List --Multipart_Fri_Nov_12_03:15:37_2010-1 Content-Type: text/plain; charset=US-ASCII Hello, I'm having a little problem when I want to insert a code block inside a list. Here is an example: ===== 1. Drawing is following: #+BEGIN_SRC asymptote :file drawing.pdf unitsize(5cm); draw(unitcircle); #+END_SRC Now find its center with compass only. 2. Another item. ===== Upon exporting this, as the code is removed, the blank lines surrounding it join together, creating a 2-blank-lines combo very bad for the list processing taking place a few lines later. Indeed, when `org-export-preprocess-string' proceeds marking list endings in the export string, it sees there two separates lists instead of one. So, the following patch moves `org-export-blocks-preprocess' out of its hook (now babel is in Org core this isn't needed anymore), and make it called somewhat later, after list processing (and after removing excluded and archived trees). Regards, -- Nicolas --Multipart_Fri_Nov_12_03:15:37_2010-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-babel-delay-call-to-org-export-blocks-preprocess-in-.patch" Content-Transfer-Encoding: 7bit >From f280a3ef4c8bc54eb0a299a66d42a4ac47622730 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 12 Nov 2010 03:08:09 +0100 Subject: [PATCH] babel: delay call to `org-export-blocks-preprocess' in export * lisp/org-exp.el (org-export-preprocess-string): delaying code block processing a bit to allow correct list parsing in the export string --- lisp/org-exp-blocks.el | 3 --- lisp/org-exp.el | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el index 3751e68..a469afc 100644 --- a/lisp/org-exp-blocks.el +++ b/lisp/org-exp-blocks.el @@ -201,9 +201,6 @@ which defaults to the value of `org-export-blocks-witheld'." (interblock start (point-max)) (run-hooks 'org-export-blocks-postblock-hook))))) -(add-hook 'org-export-preprocess-after-include-files-hook - 'org-export-blocks-preprocess) - ;;================================================================================ ;; type specific functions diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 9004dd5..820c179 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1080,6 +1080,9 @@ on this string to produce the exported version." ;; Mark end of lists (org-export-mark-list-ending backend) + ;; Export code blocks + (org-export-blocks-preprocess) + ;; Handle source code snippets (org-export-replace-src-segments-and-examples backend) -- 1.7.3.2 --Multipart_Fri_Nov_12_03:15:37_2010-1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Multipart_Fri_Nov_12_03:15:37_2010-1--