emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [PATCH] Make tangling work in an indirect buffer


From: Shaun Johnson
Subject: [O] [PATCH] Make tangling work in an indirect buffer
Date: Wed, 09 Mar 2011 16:57:23 +0000
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

The attached patch makes tangling (org-babel-tangle) work
in indirect buffers. Previously it would fail before running
org-babel-post-tangle-hook because indirect have a buffer-file-name
of nil whereas the code was expecting a string in the following
fragment:

(message "tangled %d code block%s from %s" block-counter
               (if (= block-counter 1) "" "s")
               (file-name-nondirectory (buffer-file-name (or 
(buffer-base-buffer) (current-buffer)))))


I hope the patch is in the correct format.

Shaun.
>From d11bae118dcc1e69fd148002a55e4ae29551c319 Mon Sep 17 00:00:00 2001
From: Shaun Johnson <address@hidden>
Date: Wed, 9 Mar 2011 15:32:40 +0000
Subject: [PATCH] Babel: Stop tangling failing in an indirect buffer

* ob-tangle.el (org-babel-tangle): Make it work in an indirect buffer.

The problem was that the message generated after tangling included the
file name of the current buffer which was nil in an indirect buffer.

TINYCHANGE
---
 lisp/ob-tangle.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 4e203be..f7f7047 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -243,7 +243,7 @@ exported source code blocks by language."
        (org-babel-tangle-collect-blocks lang))
       (message "tangled %d code block%s from %s" block-counter
                (if (= block-counter 1) "" "s")
-              (file-name-nondirectory (buffer-file-name (current-buffer))))
+              (file-name-nondirectory (buffer-file-name (or 
(buffer-base-buffer) (current-buffer)))))
       ;; run `org-babel-post-tangle-hook' in all tangled files
       (when org-babel-post-tangle-hook
        (mapc
-- 
1.7.4.msysgit.0


reply via email to

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