From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: [PATCH] ob-clojure.el support :ns header argument Date: Mon, 26 Mar 2018 12:05:48 +0800 Message-ID: <955ae32f-3c93-ae3c-a9f8-28645651edc9@gmail.com> References: <4d7d38a2-4a7b-c22a-3d5c-fc05a99aabb8@gmail.com> <7ab04864-666d-b84b-b9ea-6a26868f5cdd@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------72FB550EECDC463904E3B3E0" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0JOQ-00028q-C7 for emacs-orgmode@gnu.org; Mon, 26 Mar 2018 00:05:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0JOM-0003jn-Vr for emacs-orgmode@gnu.org; Mon, 26 Mar 2018 00:05:58 -0400 Received: from mail-pl0-x22e.google.com ([2607:f8b0:400e:c01::22e]:37151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0JOM-0003jd-J9 for emacs-orgmode@gnu.org; Mon, 26 Mar 2018 00:05:54 -0400 Received: by mail-pl0-x22e.google.com with SMTP id w12-v6so11192028plp.4 for ; Sun, 25 Mar 2018 21:05:54 -0700 (PDT) Received: from [0.0.0.0] ([119.28.89.243]) by smtp.gmail.com with ESMTPSA id s63sm25712794pfe.6.2018.03.25.21.05.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 21:05:51 -0700 (PDT) In-Reply-To: <7ab04864-666d-b84b-b9ea-6a26868f5cdd@gmail.com> Content-Language: en-US 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: org-mode This is a multi-part message in MIME format. --------------72FB550EECDC463904E3B3E0 Content-Type: multipart/alternative; boundary="------------3AB8273621A5B25C7DDD6236" --------------3AB8273621A5B25C7DDD6236 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit This is an extra patch. Should be with previous email's three patches. On 03/26/2018 09:59 AM, stardiviner wrote: > > - support :ns header (as discussed at here > https://github.com/clojure-emacs/clojure-mode/pull/465#discussion_r158009538) > > - supoort inject CIDER outside of project > > - support :varinitialization when :session initialization prepare. > > > On 03/22/2018 01:49 AM, stardiviner wrote: >> >> Two patches >> >> One is to support ob-clojure.el future coming header argument :ns. >> >> The second is to support jack-in CIDER outside of Clojure project by >> default. Not no need to ob-clojure project to be created anymore. >> > --------------3AB8273621A5B25C7DDD6236 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

This is an extra patch. Should be with previous email's three patches.


On 03/26/2018 09:59 AM, stardiviner wrote:

- support :ns header (as discussed at here https://github.com/clojure-emacs/clojure-mode/pull/465#discussion_r158009538)

- supoort inject CIDER outside of project

- support :var initialization when :session initialization prepare.


On 03/22/2018 01:49 AM, stardiviner wrote:

Two patches

One is to support ob-clojure.el future coming header argument :ns.

The second is to support jack-in CIDER outside of Clojure project by default. Not no need to ob-clojure project to be created anymore.



--------------3AB8273621A5B25C7DDD6236-- --------------72FB550EECDC463904E3B3E0 Content-Type: text/x-patch; name="0001-ob-clojure.el-org-babel-execute-clojure-support-ns-h.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-ob-clojure.el-org-babel-execute-clojure-support-ns-h.pa"; filename*1="tch" >From 624e9ab91bb09caf4c438cb9eb1cedb7680755d9 Mon Sep 17 00:00:00 2001 From: Bastien Date: Mon, 26 Mar 2018 11:35:21 +0800 Subject: [PATCH] * ob-clojure.el (org-babel-execute:clojure) support :ns header argument. --- lisp/ob-clojure.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index 890f60ada..62c65e971 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -55,6 +55,7 @@ (declare-function slime-eval "ext:slime" (sexp &optional package)) (defvar nrepl-sync-request-timeout) +(defvar cider-buffer-ns) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj")) @@ -109,7 +110,9 @@ using the :show-process parameter." (cider (require 'cider) (let ((result-params (cdr (assq :result-params params))) - (show (cdr (assq :show-process params)))) + (show (cdr (assq :show-process params))) + (ns (cdr (assq :ns params)))) + (when ns (setq-local cider-buffer-ns ns)) (if (member show '(nil "no")) ;; Run code without showing the process. (progn -- 2.16.2 --------------72FB550EECDC463904E3B3E0--