From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] Re: [babel] Relative path for "dir" header argument Date: Tue, 05 Jun 2012 08:53:13 -0600 Message-ID: <878vg195eu.fsf@gmx.com> References: <87vcjf1hip.fsf@hpdeifel.de> <87r4tubuzp.fsf@hpdeifel.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbv8V-0003dv-M5 for emacs-orgmode@gnu.org; Tue, 05 Jun 2012 10:53:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sbv8L-0006Vw-Q9 for emacs-orgmode@gnu.org; Tue, 05 Jun 2012 10:53:31 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:52634) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Sbv8L-0006Vf-IN for emacs-orgmode@gnu.org; Tue, 05 Jun 2012 10:53:21 -0400 In-Reply-To: <87r4tubuzp.fsf@hpdeifel.de> (Hans-Peter Deifel's message of "Mon, 04 Jun 2012 23:57:46 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Hans-Peter Deifel Cc: emacs-orgmode@gnu.org Hans-Peter Deifel 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