emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Girard <nicolas.girard@nerim.net>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Make org-babel-tangle work when target-file is nil
Date: Sun, 29 Nov 2009 16:48:56 +0100	[thread overview]
Message-ID: <51b0095d0911290748v1c04b788k61fbdcb1f02d2c6c@mail.gmail.com> (raw)

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

             reply	other threads:[~2009-11-29 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-29 15:48 Nicolas Girard [this message]
2009-11-29 17:10 ` [PATCH] Make org-babel-tangle work when target-file is nil Eric Schulte
2009-11-29 18:34   ` [babel] " Dan Davison
2009-11-29 19:12     ` Nicolas Girard
2009-11-30 15:55       ` Eric Schulte

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=51b0095d0911290748v1c04b788k61fbdcb1f02d2c6c@mail.gmail.com \
    --to=nicolas.girard@nerim.net \
    --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).