Browse Source

ob-clojure.el: Fix let binding expansion and comments removal

* lisp/ob-clojure.el (org-babel-expand-body:clojure): Remove
comment while expanding the body of the source block.
(org-babel-expand-body:clojure): Don't quote the value of src
block variables.
Bastien 5 years ago
parent
commit
b1f564b4b6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/ob-clojure.el

+ 3 - 1
lisp/ob-clojure.el

@@ -104,6 +104,8 @@ If the value is nil, timeout is disabled."
 	 (result-params (cdr (assq :result-params params)))
 	 (print-level nil)
 	 (print-length nil)
+	 ;; Remove comments, they break (let [...] ...) bindings
+	 (body (replace-regexp-in-string "^[ 	]*;+.*$" "" body))
 	 (body (org-trim
 		(concat
 		 ;; Source block specified namespace :ns.
@@ -113,7 +115,7 @@ If the value is nil, timeout is disabled."
 		   (format "(let [%s]\n%s)"
 			   (mapconcat
 			    (lambda (var)
-			      (format "%S (quote %S)" (car var) (cdr var)))
+			      (format "%S %S" (car var) (cdr var)))
 			    vars
 			    "\n      ")
 			   body))))))