summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-06-01 06:35:54 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-06-01 06:41:08 -0600
commit459cbd4fd86fcca8478de12ed0c067e032e4760c (patch)
tree4f165d7b5942f0a20166673a90bf814c2c4426e4
parentcbd4a5b7642400a8ef143edb64cd9aaa67d65d9e (diff)
downloadorg-mode-459cbd4fd86fcca8478de12ed0c067e032e4760c.tar.gz
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.
-rw-r--r--lisp/ob-lisp.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index a11a300..a7c4ec5 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)))