From: Kyle Meyer <kyle@kyleam.com>
To: Rainer M Krug <Rainer@krugs.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Tangling from indirect buffer
Date: Fri, 04 Sep 2015 10:49:10 -0400 [thread overview]
Message-ID: <87vbbq2qah.fsf@kyleam.com> (raw)
In-Reply-To: <m2zj12bifc.fsf@krugs.de> (Rainer M. Krug's message of "Fri, 04 Sep 2015 12:14:15 +0200")
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
Rainer M Krug <Rainer@krugs.de> writes:
> Hi
>
> it seems that tangling from an indirect buffer does not work. Is this by
> design or a bug?
I don't think that's by design.
> Would it be possible to make this possible?
Does the below patch work for you? If so, I can test it more thoroughly
and send a proper patch.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tangle-indirect.patch --]
[-- Type: text/x-diff, Size: 774 bytes --]
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index d20c2b3..cf48db3 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -242,7 +242,7 @@ (defun org-babel-tangle (&optional arg target-file lang)
(base-name (cond
((string= "yes" tangle)
(file-name-sans-extension
- (buffer-file-name)))
+ (nth 1 spec)))
((string= "no" tangle) nil)
((> (length tangle) 0) tangle)))
(file-name (when base-name
@@ -427,7 +427,7 @@ (defun org-babel-tangle-single-block
(start-line
(save-restriction (widen)
(+ 1 (line-number-at-pos (point)))))
- (file (buffer-file-name))
+ (file (buffer-file-name (buffer-base-buffer)))
(src-lang (nth 0 info))
(params (nth 2 info))
(extra (nth 3 info))
[-- Attachment #3: Type: text/plain, Size: 9 bytes --]
--
Kyle
next prev parent reply other threads:[~2015-09-04 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 10:14 Tangling from indirect buffer Rainer M Krug
2015-09-04 14:49 ` Kyle Meyer [this message]
2015-09-04 20:18 ` Martin Carlé
2015-09-07 8:46 ` Rainer M Krug
2015-09-09 3:55 ` [PATCH] Fix tangling in indirect buffers Kyle Meyer
2015-09-09 11:40 ` Nicolas Goaziou
2015-09-09 13:57 ` Kyle Meyer
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=87vbbq2qah.fsf@kyleam.com \
--to=kyle@kyleam.com \
--cc=Rainer@krugs.de \
--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).