emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Re: [babel] Relative path for "dir" header argument


From: Hans-Peter Deifel
Subject: [O] [PATCH] Re: [babel] Relative path for "dir" header argument
Date: Mon, 04 Jun 2012 23:57:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]