summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2011-06-02 19:48:57 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2011-06-02 19:48:57 +0200
commitcf708c72e5287b9fef0fe290d94fdb0b73674819 (patch)
tree74877e24885cd937a11c5d374241490de8f35270
parent0db883073369936e27ceea500513db5c37b0beee (diff)
parent3433861e62dae79beefc649b7cbbf057a42b3266 (diff)
downloadorg-mode-cf708c72e5287b9fef0fe290d94fdb0b73674819.tar.gz
Merge branch 'master' of orgmode.org:org-mode
-rw-r--r--doc/org.texi4
-rw-r--r--lisp/ob-lisp.el31
2 files changed, 23 insertions, 12 deletions
diff --git a/doc/org.texi b/doc/org.texi
index 6f396a2..eb97759 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10221,9 +10221,9 @@ For example the @code{#+ATTR_LaTeX:} line below is exported as the
@example
#+ATTR_LaTeX: placement=[<options>]\footnotesize
-\begin{figure}[<options>]\footnotesize
+\begin@{figure@}[<options>]\footnotesize
...
-\end{figure}
+\end@{figure@}
@end example
If you would like to let text flow around the image, add the word @samp{wrap}
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index a875d55..4baf603 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -41,6 +41,12 @@
(defvar org-babel-default-header-args:lisp '())
(defvar org-babel-header-arg-names:lisp '(package))
+(defcustom org-babel-lisp-dir-fmt
+ "(let ((*default-pathname-defaults* #P%S)) %%s)"
+ "Format string used to wrap code bodies to set the current directory.
+For example a value of \"(progn ;; %s\\n %%s)\" would ignore the
+current directory string.")
+
(defun org-babel-expand-body:lisp (body params)
"Expand BODY according to PARAMS, return the expanded body."
(let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
@@ -64,17 +70,22 @@
"Execute a block of Common Lisp code with Babel."
(require 'slime)
(org-babel-reassemble-table
- (with-temp-buffer
- (insert (org-babel-expand-body:lisp body params))
- ((lambda (result)
- (if (member "output" (cdr (assoc :result-params params)))
- (car result)
- (condition-case nil
- (read (org-bable-lisp-vector-to-list (cadr result)))
- (error (cadr result)))))
+ ((lambda (result)
+ (if (member "output" (cdr (assoc :result-params params)))
+ (car result)
+ (condition-case nil
+ (read (org-bable-lisp-vector-to-list (cadr result)))
+ (error (cadr result)))))
+ (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))))
+ ,(let ((dir (if (assoc :dir params)
+ (cdr (assoc :dir params))
+ default-directory)))
+ (format
+ (if dir (format org-babel-lisp-dir-fmt dir) "(progn %s)")
+ (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)))