emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Make org-babel-tangle work when target-file is nil
@ 2009-11-29 15:48 Nicolas Girard
  2009-11-29 17:10 ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Girard @ 2009-11-29 15:48 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

Hi all,

I'm glad to be back around there, it's been a while !

As the title says, the attached file makes org-babel-tangle work when
its "target-file" optional argument is nil.

Cheers,
Nicolas

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 814 bytes --]

diff --git a/contrib/babel/lisp/org-babel-tangle.el b/contrib/babel/lisp/org-babel-tangle.el
index c805373..103cc44 100644
--- a/contrib/babel/lisp/org-babel-tangle.el
+++ b/contrib/babel/lisp/org-babel-tangle.el
@@ -100,7 +100,7 @@ exported source code blocks by language."
                                       (file-name-sans-extension (buffer-file-name)))
                                      ((string= "no" tangle) nil)
                                      ((> (length tangle) 0) tangle))
-                                    target-file))
+                                    (or target-file buffer-file-name)))
                      (file-name (when base-name
                                   (if (string= base-name
                                                (file-name-sans-extension base-name))

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Make org-babel-tangle work when target-file is nil
  2009-11-29 15:48 [PATCH] Make org-babel-tangle work when target-file is nil Nicolas Girard
@ 2009-11-29 17:10 ` Eric Schulte
  2009-11-29 18:34   ` [babel] " Dan Davison
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2009-11-29 17:10 UTC (permalink / raw)
  To: Nicolas Girard; +Cc: emacs-orgmode

Thanks Nicolas,

By default source-code blocks are not tangled.  They are only tangled if
their :tangle header argument is equal to "yes" or is a file name -- in
which case target-file is set to that file name.  I believe your patch
would have the effect of making all source-code blocks tangle by
default -- which is not the desired behavior.

I realize that the documentation of tangling, noweb syntax, and these
many header arguments is lacking and this is something that we are
working on fixing.

Best -- Eric

Nicolas Girard <nicolas.girard@nerim.net> writes:

> Hi all,
>
> I'm glad to be back around there, it's been a while !
>
> As the title says, the attached file makes org-babel-tangle work when
> its "target-file" optional argument is nil.
>
> Cheers,
> Nicolas
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [babel] Re: [PATCH] Make org-babel-tangle work when target-file is nil
  2009-11-29 17:10 ` Eric Schulte
@ 2009-11-29 18:34   ` Dan Davison
  2009-11-29 19:12     ` Nicolas Girard
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Davison @ 2009-11-29 18:34 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

"Eric Schulte" <schulte.eric@gmail.com> writes:

> Thanks Nicolas,
>
> By default source-code blocks are not tangled.  They are only tangled if
> their :tangle header argument is equal to "yes" or is a file name -- in
> which case target-file is set to that file name.  I believe your patch
> would have the effect of making all source-code blocks tangle by
> default -- which is not the desired behavior.

Hi Nicolas,

Just to add to that -- when I want to tangle all source blocks in a
file, I include the line

#+property:   tangle yes

in my org file, which can be over-ridden on a per-block basis with
':tangle no'.

Dan


>
> I realize that the documentation of tangling, noweb syntax, and these
> many header arguments is lacking and this is something that we are
> working on fixing.
>
> Best -- Eric
>
> Nicolas Girard <nicolas.girard@nerim.net> writes:
>
>> Hi all,
>>
>> I'm glad to be back around there, it's been a while !
>>
>> As the title says, the attached file makes org-babel-tangle work when
>> its "target-file" optional argument is nil.
>>
>> Cheers,
>> Nicolas
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Make org-babel-tangle work when target-file is nil
  2009-11-29 18:34   ` [babel] " Dan Davison
@ 2009-11-29 19:12     ` Nicolas Girard
  2009-11-30 15:55       ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Girard @ 2009-11-29 19:12 UTC (permalink / raw)
  To: emacs-orgmode

2009/11/29, Dan Davison <davison@stats.ox.ac.uk>:
> "Eric Schulte" <schulte.eric@gmail.com> writes:

Hi guys,

indeed, thanks to your explanations, org-babel tangling code's
behaviour makes much more sense to me.

I've just discovered Eric's Literate Programming fork of
emacs-starter-kit [1] and find it pretty darn good ! I'm currently
using it along with org-babel to rework my Org setup from scratch and
it's working very well !

Btw Eric, why not activating
(if window-system (require 'org-mouse))
by deault in starter-kit-org.org ? Within emacs-starter-kit it makes
perfect sense to me.

Cheers,
Nicolas

[1] http://github.com/eschulte/emacs-starter-kit

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: [PATCH] Make org-babel-tangle work when target-file is nil
  2009-11-29 19:12     ` Nicolas Girard
@ 2009-11-30 15:55       ` Eric Schulte
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Schulte @ 2009-11-30 15:55 UTC (permalink / raw)
  To: Nicolas Girard; +Cc: emacs-orgmode

Nicolas Girard <nicolas.girard@nerim.net> writes:

> 2009/11/29, Dan Davison <davison@stats.ox.ac.uk>:
>> "Eric Schulte" <schulte.eric@gmail.com> writes:
>
> Hi guys,
>
> indeed, thanks to your explanations, org-babel tangling code's
> behaviour makes much more sense to me.
>
> I've just discovered Eric's Literate Programming fork of
> emacs-starter-kit [1] and find it pretty darn good ! I'm currently
> using it along with org-babel to rework my Org setup from scratch and
> it's working very well !
>

Thanks!  If you happen to have any suggestions/improvements please feel
free to fork and make changes and I'll be happy to fold them into the
main version.

>
> Btw Eric, why not activating
> (if window-system (require 'org-mouse))
> by deault in starter-kit-org.org ? Within emacs-starter-kit it makes
> perfect sense to me.
>

To be honest I'm not sure why this is commented out.  It must have been
raising errors at some point.  I'll try uncommenting it and see if the
errors return.

Thanks -- Eric

>
> Cheers,
> Nicolas
>
> [1] http://github.com/eschulte/emacs-starter-kit
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-30 15:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-29 15:48 [PATCH] Make org-babel-tangle work when target-file is nil Nicolas Girard
2009-11-29 17:10 ` Eric Schulte
2009-11-29 18:34   ` [babel] " Dan Davison
2009-11-29 19:12     ` Nicolas Girard
2009-11-30 15:55       ` Eric Schulte

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