From: Hans-Peter Deifel <hpdeifel@gmx.de>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Re: [babel] Relative path for "dir" header argument
Date: Mon, 04 Jun 2012 23:57:46 +0200 [thread overview]
Message-ID: <87r4tubuzp.fsf@hpdeifel.de> (raw)
In-Reply-To: <87vcjf1hip.fsf@hpdeifel.de> (Hans-Peter Deifel's message of "Tue, 29 May 2012 11:08:30 +0200")
On Di, Mai 29 2012, Hans-Peter Deifel wrote:
> Currently, the 'dir'-argument only understands absolute paths, because
> it simply sets default-directory.
>
> I think it would be quite useful to be able to specify paths relative to
> the default-directory of the buffer. What do you think?
I tried to implement exactly that by wrapping `dir' with
`expand-file-name'. So far, it works very well. Here is the patch:
---
lisp/ob.el | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lisp/ob.el b/lisp/ob.el
index d2d94b8..509bd41 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -524,7 +524,8 @@ block."
(nth 1 info))))
(dir (cdr (assoc :dir params)))
(default-directory
- (or (and dir (file-name-as-directory dir)) default-directory))
+ (or (and dir (file-name-as-directory (expand-file-name dir)))
+ default-directory))
(org-babel-call-process-region-original
(if (boundp 'org-babel-call-process-region-original)
org-babel-call-process-region-original
--
1.7.8.6
next prev parent reply other threads:[~2012-06-04 21:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-29 9:08 [babel] Relative path for "dir" header argument Hans-Peter Deifel
2012-06-04 21:57 ` Hans-Peter Deifel [this message]
2012-06-05 7:26 ` [PATCH] " Forian Schmaus
2012-06-05 14:53 ` 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=87r4tubuzp.fsf@hpdeifel.de \
--to=hpdeifel@gmx.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).