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)
|
||||||
(mapconcat
|
(concat "(let ("
|
||||||
(lambda (var) (format "%S" (print `(,(car var) ',(cdr var)))))
|
(mapconcat
|
||||||
vars "\n ")
|
(lambda (var) (format "%S" (print `(,(car var) ',(cdr var)))))
|
||||||
")\n"
|
vars "\n ")
|
||||||
(if (or (member "code" result-params)
|
")\n" body ")")
|
||||||
(member "pp" result-params))
|
body)))
|
||||||
(concat "(pp " body ")") body) ")")))
|
(if (or (member "code" result-params)
|
||||||
body))
|
(member "pp" result-params))
|
||||||
|
(concat "(pp " 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
|
||||||
(funcall
|
((lambda (body)
|
||||||
(intern
|
(if (assoc :no-expand params)
|
||||||
(concat "org-babel-expand-body:" src-lang))
|
body
|
||||||
|
(funcall
|
||||||
|
(intern (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