1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

* lisp/ob-clojure.el: Add more ClojureScript src block support.

* lisp/ob-clojure.el: Add ClojureScript src block tangle extension and
header arguments support.

* lisp/ob-clojure.el (org-babel-edit-prep:clojure): Auto inject src
block :ns header argument into editing temporary src block buffer local.

TINYCHANGE
This commit is contained in:
stardiviner 2020-02-13 23:23:03 +08:00 committed by Bastien
parent d37fc58150
commit 003a7fc0b4

View File

@ -61,11 +61,15 @@
(defvar org-babel-tangle-lang-exts)
(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
(add-to-list 'org-babel-tangle-lang-exts '("clojurescript" . "cljs"))
(defvar org-babel-default-header-args:clojure '())
(defvar org-babel-header-args:clojure '((ns . :any)
(package . :any)))
(defvar org-babel-default-header-args:clojurescript '())
(defvar org-babel-header-args:clojurescript '((package . :any)))
(defcustom org-babel-clojure-sync-nrepl-timeout 10
"Timeout value, in seconds, of a Clojure sync call.
If the value is nil, timeout is disabled."
@ -224,6 +228,11 @@ The underlying process performed by the code block can be output
using the :show-process parameter."
(org-babel-execute:clojure body (cons '(:target . "cljs") params)))
(defun org-babel-edit-prep:clojure (babel-info)
"Set org-edit-special src block by injecting `cider-buffer-ns' as namespace."
(if-let* ((namespace (cdr (assq :ns (nth 2 babel-info)))))
(setq-local cider-buffer-ns namespace)))
(defun org-babel-clojure-initiate-session (&optional session _params)
"Initiate a session named SESSION according to PARAMS."
(when (and session (not (string= session "none")))