Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
This commit is contained in:
commit
3b377f52dd
|
@ -127,8 +127,9 @@ specifying a var of the same value."
|
||||||
(let ((vars-forms (mapconcat ;; define any variables
|
(let ((vars-forms (mapconcat ;; define any variables
|
||||||
(lambda (pair)
|
(lambda (pair)
|
||||||
(format "%s %s" (car pair) (org-babel-clojure-var-to-clojure (cdr pair))))
|
(format "%s %s" (car pair) (org-babel-clojure-var-to-clojure (cdr pair))))
|
||||||
vars "\n ")))
|
vars "\n "))
|
||||||
(format "(let [%s]\n %s)" vars-forms (org-babel-trim body))))
|
(body (org-babel-trim body)))
|
||||||
|
(if (> (length vars-forms) 0) (format "(let [%s]\n %s)" vars-forms body) body)))
|
||||||
|
|
||||||
(defun org-babel-prep-session:clojure (session params)
|
(defun org-babel-prep-session:clojure (session params)
|
||||||
"Prepare SESSION according to the header arguments specified in PARAMS."
|
"Prepare SESSION according to the header arguments specified in PARAMS."
|
||||||
|
|
|
@ -45,15 +45,16 @@
|
||||||
(processed-params (org-babel-process-params params))
|
(processed-params (org-babel-process-params params))
|
||||||
(result-params (third processed-params))
|
(result-params (third processed-params))
|
||||||
(print-level nil) (print-length nil)
|
(print-level nil) (print-length nil)
|
||||||
(body (concat "(let ("
|
(body (if (> (length vars) 0)
|
||||||
|
(concat "(let ("
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (var) (format "%S" (print `(,(car var) ',(cdr var)))))
|
(lambda (var) (format "%S" (print `(,(car var) ',(cdr var)))))
|
||||||
vars "\n ")
|
vars "\n ")
|
||||||
")\n"
|
")\n" body ")")
|
||||||
|
body)))
|
||||||
(if (or (member "code" result-params)
|
(if (or (member "code" result-params)
|
||||||
(member "pp" result-params))
|
(member "pp" result-params))
|
||||||
(concat "(pp " body ")") body) ")")))
|
(concat "(pp " body ")") body)))
|
||||||
body))
|
|
||||||
|
|
||||||
(defun org-babel-execute:emacs-lisp (body params)
|
(defun org-babel-execute:emacs-lisp (body params)
|
||||||
"Execute a block of emacs-lisp code with org-babel."
|
"Execute a block of emacs-lisp code with org-babel."
|
||||||
|
|
|
@ -187,13 +187,16 @@ code blocks by language."
|
||||||
(cons
|
(cons
|
||||||
(cons src-lang
|
(cons src-lang
|
||||||
(cons (list link source-name params
|
(cons (list link source-name params
|
||||||
|
((lambda (body)
|
||||||
|
(if (assoc :no-expand params)
|
||||||
|
body
|
||||||
(funcall
|
(funcall
|
||||||
(intern
|
(intern (concat "org-babel-expand-body:" src-lang))
|
||||||
(concat "org-babel-expand-body:" src-lang))
|
body
|
||||||
|
params)))
|
||||||
(if (and (cdr (assoc :noweb params))
|
(if (and (cdr (assoc :noweb params))
|
||||||
(string= "yes" (cdr (assoc :noweb params))))
|
(string= "yes" (cdr (assoc :noweb params))))
|
||||||
(org-babel-expand-noweb-references info) (second info))
|
(org-babel-expand-noweb-references info) (second info)))
|
||||||
params)
|
|
||||||
(third (cdr (assoc
|
(third (cdr (assoc
|
||||||
src-lang org-babel-tangle-langs))))
|
src-lang org-babel-tangle-langs))))
|
||||||
by-lang)) blocks))))))
|
by-lang)) blocks))))))
|
||||||
|
|
Loading…
Reference in New Issue