From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: Tangling from indirect buffer Date: Fri, 04 Sep 2015 10:49:10 -0400 Message-ID: <87vbbq2qah.fsf@kyleam.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsIr-0000EM-Ex for emacs-orgmode@gnu.org; Fri, 04 Sep 2015 10:49:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXsIm-0000C5-Fw for emacs-orgmode@gnu.org; Fri, 04 Sep 2015 10:49:21 -0400 Received: from mail-qg0-f41.google.com ([209.85.192.41]:33133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsIm-0000Bx-CB for emacs-orgmode@gnu.org; Fri, 04 Sep 2015 10:49:16 -0400 Received: by qgev79 with SMTP id v79so17638996qge.0 for ; Fri, 04 Sep 2015 07:49:15 -0700 (PDT) In-Reply-To: (Rainer M. Krug's message of "Fri, 04 Sep 2015 12:14:15 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer M Krug Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Rainer M Krug 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=tangle-indirect.patch 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)) --=-=-= Content-Type: text/plain -- Kyle --=-=-=--