From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: [UPDATE] Re: ob-clojure evaluate error when Org-mode buffer has ns clojure code Date: Tue, 19 Dec 2017 17:54:45 +0800 Message-ID: <27402be3-a688-cd27-f7c5-f07ddff7a31c@gmail.com> References: <87zid7bd46.fsf@gmail.com> <87vanuayo1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eREbw-0004e9-8f for emacs-orgmode@gnu.org; Tue, 19 Dec 2017 04:54:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eREbs-0005UZ-CA for emacs-orgmode@gnu.org; Tue, 19 Dec 2017 04:54:56 -0500 Received: from mail-io0-x22e.google.com ([2607:f8b0:4001:c06::22e]:36383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eREbs-0005UH-6F for emacs-orgmode@gnu.org; Tue, 19 Dec 2017 04:54:52 -0500 Received: by mail-io0-x22e.google.com with SMTP id l10so12955921ioc.3 for ; Tue, 19 Dec 2017 01:54:51 -0800 (PST) In-Reply-To: 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: Tim Cross Cc: Org-mode I got new update on this issue. I think it is caused by `(clojure-find-ns)`. Here is my found: I created a simple clojure project for used by all org-babel-clojure src blocks. ```elisp (progn   (find-file (expand-file-name "~/.emacs.d/Org-mode/ob-clojure/src/ob_clojure/core.clj"))   (cider-jack-in)) ``` I edebug the `org-babel-execute:clojure` process, `org-babel-execute:clojure' has a step: ~(clojure-find-ns)~ . This is from ~clojure-mode~. It will find current clojure buffer possible clojure namespace (even in org-mode). When I the following example org-mode buffer, it will return "namespace-not-found" error in nrepl response dict. Then src blcok has no error, not results. ```org #+BEGIN_SRC clojure :session (in-ns 'user-kk) or (ns user-kk) #+END_SRC #+BEGIN_SRC clojure :results output (print "hi") #+END_SRC ``` Here is a part of function `clojure-find-ns`:       #+begin_src emacs-lisp       (when (or (re-search-backward clojure-namespace-name-regex nil t)                 ;; Or any form at all.                 (and (goto-char (point-min))                      (re-search-forward clojure-namespace-name-regex nil t)))         (match-string-no-properties 4))       #+end_src So I created an PR to disable find namespace in Org-mode buffer: https://github.com/clojure-emacs/clojure-mode/pull/465