emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [babel] [PATCH]


From: Martyn Jago
Subject: [Orgmode] [babel] [PATCH]
Date: Fri, 25 Feb 2011 13:50:18 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Babel

I've been working on an exporter and have come across some strange
behaviour regarding 'empty' source blocks with regard to tangling.

If an attempt is made to tangle a block containing two blank (no
white-space) lines, the block is exported as carriage returns (as I
would expect).

If a block contains one or no blank lines, the #+end_src tag appears to
be consumed by the block (along with subsequent text upto the next
#+end_src tag).

I tracked this down to the org-babel-src-block-regexp variable in ob.el
and have modified it to give what appears to be consistent behaviour.

I also found the following unresolved bug report which may be related...

http://www.mail-archive.com/address@hidden/msg29992.html

I've included a simple test file, and resultant tangled files before and
after the patch to attempt to convey the problem.

NOTE: Since the patch itself modifies a defvar, and since I'm not clear
on how a patched defvar should be updated downstream, the patch includes a
setq statement to update the defvar org-babel-src-block-regexp for test
purposes. The patch cannot therefore be applied as is.

Attachment: empty-block-tangle-test.org
Description: empty-block-tangle-test.org

Attachment: test-out-pre-patch
Description: test-out-pre-patch

Attachment: test-out-post-patch
Description: test-out-post-patch

Attachment: org-babel-src-block-regexp.patch
Description: org-babel-src-block-regexp

Regards

Martyn

---
Org-mode version 7.4 (release_7.4.529.gb23d)
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
 of 2011-02-25 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]