Merge branch 'master' of orgmode.org:org-mode

This commit is contained in:
Carsten Dominik 2011-06-02 19:48:57 +02:00
commit cf708c72e5
2 changed files with 23 additions and 12 deletions

View File

@ -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}

View File

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