From: Eric Schulte <eric.schulte@gmx.com>
To: Hans-Peter Deifel <hpdeifel@gmx.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Re: [babel] Relative path for "dir" header argument
Date: Tue, 05 Jun 2012 08:53:13 -0600 [thread overview]
Message-ID: <878vg195eu.fsf@gmx.com> (raw)
In-Reply-To: <87r4tubuzp.fsf@hpdeifel.de> (Hans-Peter Deifel's message of "Mon, 04 Jun 2012 23:57:46 +0200")
Hans-Peter Deifel <hpdeifel@gmx.de> writes:
> 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
Thanks for this patch, I've just applied it.
--
Eric Schulte
http://cs.unm.edu/~eschulte
prev parent reply other threads:[~2012-06-05 14:53 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 ` [PATCH] " Hans-Peter Deifel
2012-06-05 7:26 ` Forian Schmaus
2012-06-05 14:53 ` Eric Schulte [this message]
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=878vg195eu.fsf@gmx.com \
--to=eric.schulte@gmx.com \
--cc=emacs-orgmode@gnu.org \
--cc=hpdeifel@gmx.de \
/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).