From 46d841d064cd7de4d918abe5d61cec980a061f24 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Mon, 2 Apr 2018 11:58:28 +0800 Subject: [PATCH] * ob-clojure-literate: Get session from global connections list * contrib/lisp/ob-clojure-literate.el (ob-clojure-literate-get-session-list): (org-babel-map): Get session from global connections list. (ob-clojure-literate-specify-session): Renamed from `ob-clojure-literate-specify-session-header-argument'. --- contrib/lisp/ob-clojure-literate.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/lisp/ob-clojure-literate.el b/contrib/lisp/ob-clojure-literate.el index 2d1d30db8..0c928572b 100644 --- a/contrib/lisp/ob-clojure-literate.el +++ b/contrib/lisp/ob-clojure-literate.el @@ -63,7 +63,11 @@ If it is a directory, `ob-clojure-literate' will try to create Clojure project a (defun ob-clojure-literate-get-session-list () "Return a list of available started CIDER REPL sessions list." - (-map 'buffer-name cider-connections)) + (-map 'buffer-name + ;; for multiple connections case. + ;; get global value instead of buffer local. + (default-value 'cider-connections) + )) (defun ob-clojure-literate-set-session () "Set session name for buffer local." @@ -82,7 +86,7 @@ If it is a directory, `ob-clojure-literate' will try to create Clojure project a )) ;;;###autoload -(defun ob-clojure-literate-specify-session-header-argument () +(defun ob-clojure-literate-specify-session () "Specify ob-clojure header argument :session with value selected from a list of available sessions." (interactive) (let ((lang (nth 0 (org-babel-get-src-block-info)))) @@ -297,7 +301,7 @@ reset `RESULT' to `nil'." map) "Keymap for `ob-clojure-literate-mode'.") -(define-key org-babel-map (kbd "M-s") 'ob-clojure-literate-specify-session-header-argument) +(define-key org-babel-map (kbd "M-s") 'ob-clojure-literate-specify-session) (define-key org-babel-map (kbd "M-j") 'ob-clojure-literate-auto-jackin) ;; (define-key org-babel-map (kbd "M-e") 'cider-eval-last-sexp) ;; (define-key org-babel-map (kbd "M-d") 'cider-doc)