From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans-Peter Deifel Subject: [PATCH] Re: [babel] Relative path for "dir" header argument Date: Mon, 04 Jun 2012 23:57:46 +0200 Message-ID: <87r4tubuzp.fsf@hpdeifel.de> References: <87vcjf1hip.fsf@hpdeifel.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbfGo-0000nt-5G for emacs-orgmode@gnu.org; Mon, 04 Jun 2012 17:57:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbfGm-0000hU-5m for emacs-orgmode@gnu.org; Mon, 04 Jun 2012 17:57:01 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:36426) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SbfGl-0000hB-R8 for emacs-orgmode@gnu.org; Mon, 04 Jun 2012 17:57:00 -0400 In-Reply-To: <87vcjf1hip.fsf@hpdeifel.de> (Hans-Peter Deifel's message of "Tue, 29 May 2012 11:08:30 +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: emacs-orgmode@gnu.org 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