[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [UPDATE] Re: ob-clojure evaluate error when Org-mode buffer has ns c

From: stardiviner
Subject: [O] [UPDATE] Re: ob-clojure evaluate error when Org-mode buffer has ns clojure code
Date: Tue, 19 Dec 2017 17:54:45 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

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.
  (find-file (expand-file-name "~/.emacs.d/Org-mode/ob-clojure/src/ob_clojure/core.clj"))

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.

#+BEGIN_SRC clojure :session
(in-ns 'user-kk)
(ns user-kk)

#+BEGIN_SRC clojure :results output
(print "hi")

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))

So I created an PR to disable find namespace in Org-mode buffer:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]