Re: [O] Tangling from indirect buffer

2015-09-07 Thread Rainer M Krug
Kyle Meyer  writes:

> 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.

Yes - works perfectly. I would really appreciate this. Please submit.

Thanks,

Rainer
>
>
>
> --
> Kyle

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


signature.asc
Description: PGP signature


[O] Tangling from indirect buffer

2015-09-04 Thread Rainer M Krug
Hi

it seems that tangling from an indirect buffer does not work. Is this by
design or a bug?

Would it be possible to make this possible? I am working a lot in
indirect buffers (one subfolder R packages, another analysis of data, a
third one results) and would very much like to tangle from them instead of
having to go back to the actual buffer.

Thanks,

Rainer

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


signature.asc
Description: PGP signature


Re: [O] Tangling from indirect buffer

2015-09-04 Thread Kyle Meyer
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.

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 ( 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))

--
Kyle


Re: [O] Tangling from indirect buffer

2015-09-04 Thread Martin Carlé
Indirect buffers are of immense help but I had the same issue.

Can confirm that the hack referring to spec instead to the
buffer-file-name and getting the buffer-base-buffer respectively, does
the trick.

Great!

On 2015-09-04 Fri 17:49, Kyle Meyer wrote:

> 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.

-- 
Fetch my gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 7E3CA33F


smime.p7s
Description: S/MIME cryptographic signature