emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: [PATCH] babel: delaying call to block preprocessing
Date: Fri, 12 Nov 2010 03:15:37 +0100	[thread overview]
Message-ID: <87vd432som.wl%n.goaziou@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

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


[-- Attachment #2: 0001-babel-delay-call-to-org-export-blocks-preprocess-in-.patch --]
[-- Type: text/plain, Size: 1476 bytes --]

From f280a3ef4c8bc54eb0a299a66d42a4ac47622730 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

             reply	other threads:[~2010-11-12  2:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12  2:15 Nicolas Goaziou [this message]
2010-11-12 23:44 ` [PATCH] babel: delaying call to block preprocessing Eric Schulte

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=87vd432som.wl%n.goaziou@gmail.com \
    --to=n.goaziou@gmail.com \
    --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 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).