From 459cbd4fd86fcca8478de12ed0c067e032e4760c Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Wed, 1 Jun 2011 06:35:54 -0600 Subject: [PATCH] ob-lisp: setting *default-pathname-defaults* to the directory of the Org-mode file Thanks to Mark Cox for suggesting this change. * lisp/ob-lisp.el (org-babel-execute:lisp): Setting the value of *default-pathname-defaults* to either the value of the :dir header argument or the directory of the containing Org-mode file. --- lisp/ob-lisp.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el index a11a300c1..a7c4ec576 100644 --- a/lisp/ob-lisp.el +++ b/lisp/ob-lisp.el @@ -73,8 +73,13 @@ (with-temp-buffer (insert (org-babel-expand-body:lisp body params)) (slime-eval `(swank:eval-and-grab-output - ,(format "(progn %s)" (buffer-substring-no-properties - (point-min) (point-max)))) + ,(format "(let ((*default-pathname-defaults* %S)) %s)" + (let ((dir (if (assoc :dir params) + (cdr (assoc :dir params)) + default-directory))) + (when dir (concat "#P" dir))) + (buffer-substring-no-properties + (point-min) (point-max)))) (cdr (assoc :package params))))) (org-babel-pick-name (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))