From mboxrd@z Thu Jan 1 00:00:00 1970 From: roberthambrock@gmail.com Subject: [PATCH 3/4] ob-clojure.el: Use :ns flag in org-src-edit Date: Sun, 22 Apr 2018 22:50:02 +0200 Message-ID: <20180422205003.87836-4-roberthambrock@gmail.com> References: <20180422205003.87836-1-roberthambrock@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fALwp-00042y-Cw for emacs-orgmode@gnu.org; Sun, 22 Apr 2018 16:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fALwm-0002tz-BP for emacs-orgmode@gnu.org; Sun, 22 Apr 2018 16:50:59 -0400 Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:37969) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fALwm-0002ta-5L for emacs-orgmode@gnu.org; Sun, 22 Apr 2018 16:50:56 -0400 Received: by mail-wr0-x22b.google.com with SMTP id h3-v6so35819841wrh.5 for ; Sun, 22 Apr 2018 13:50:55 -0700 (PDT) In-Reply-To: <20180422205003.87836-1-roberthambrock@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Cc: Robert Hambrock From: Robert Hambrock * lisp/ob-clojure.el (org-babel-edit-prep:clojure): New function that sets the buffer's namespace to the value of :ns, if provided. (org-babel-edit-prep:clojurescript): Alias for org-babel-edit-prep:clojure. --- lisp/ob-clojure.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index 7f7c24ff1..c59ac96ab 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -215,6 +215,12 @@ using the :show-process parameter." (defun org-babel-execute:clojurescript (body params) (org-babel-execute:clojure body (cons '(:target . "cljs") params))) +(defun org-babel-edit-prep:clojure (babel-info) + (if-let* ((namespace (cdr (assq :ns (nth 2 babel-info))))) + (setq-local cider-buffer-ns namespace))) + +(defalias 'org-babel-edit-prep:clojurescript 'org-babel-edit-prep:clojure) + (provide 'ob-clojure) ;;; ob-clojure.el ends here -- 2.16.3