all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: stardiviner <numbchild@gmail.com>
To: Tim Cross <theophilusx@gmail.com>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: [UPDATE] Re: ob-clojure evaluate error when Org-mode buffer has ns clojure code
Date: Tue, 19 Dec 2017 17:54:45 +0800	[thread overview]
Message-ID: <27402be3-a688-cd27-f7c5-f07ddff7a31c@gmail.com> (raw)
In-Reply-To: <CAL1eYuKwrDX6cNTnxu-KKoZP6m1Fi7n4sFgfw45gvfLA6w_9LQ@mail.gmail.com>

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

  reply	other threads:[~2017-12-19  9:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 15:36 ob-clojure evaluate error when Org-mode buffer has ns clojure code numbchild
2017-06-17  1:46 ` Tim Cross
2017-06-17 12:57   ` numbchild
2017-06-17 13:26     ` numbchild
2017-06-18  1:10     ` Tim Cross
2017-06-18  5:48       ` numbchild
2017-06-21  5:12         ` numbchild
2017-12-19  9:54           ` stardiviner [this message]
2017-12-21 10:15             ` [UPDATE] " numbchild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27402be3-a688-cd27-f7c5-f07ddff7a31c@gmail.com \
    --to=numbchild@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=theophilusx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.