[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] Re: [babel] Relative path for "dir" header argument
From: |
Eric Schulte |
Subject: |
Re: [O] [PATCH] Re: [babel] Relative path for "dir" header argument |
Date: |
Tue, 05 Jun 2012 08:53:13 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux) |
Hans-Peter Deifel <address@hidden> 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