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
(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)))