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.
This commit is contained in:
Eric Schulte 2011-06-01 06:35:54 -06:00
parent cbd4a5b764
commit 459cbd4fd8
1 changed files with 7 additions and 2 deletions

View File

@ -73,8 +73,13 @@
(with-temp-buffer (with-temp-buffer
(insert (org-babel-expand-body:lisp body params)) (insert (org-babel-expand-body:lisp body params))
(slime-eval `(swank:eval-and-grab-output (slime-eval `(swank:eval-and-grab-output
,(format "(progn %s)" (buffer-substring-no-properties ,(format "(let ((*default-pathname-defaults* %S)) %s)"
(point-min) (point-max)))) (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))))) (cdr (assoc :package params)))))
(org-babel-pick-name (cdr (assoc :colname-names params)) (org-babel-pick-name (cdr (assoc :colname-names params))
(cdr (assoc :colnames params))) (cdr (assoc :colnames params)))