emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Namespace problem org-mode / Clojure
@ 2014-02-21 21:22 Volker Strobel
  2014-02-21 22:36 ` Thomas S. Dye
  2014-03-03 12:54 ` Bastien
  0 siblings, 2 replies; 16+ messages in thread
From: Volker Strobel @ 2014-02-21 21:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2154 bytes --]

Hi,

I'm trying to use org-mode with Clojure and already posted my problem at
https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
All my code blocks get evaluated in the namespace user, even if I evaluate
the (ns ...) code block first.

EXAMPLE (core.org in src/org-works of Leiningen project):
-------------------
#+BEGIN_SRC clojure :tangle core.clj
(ns org-works.core
  (:gen-class))
#+END_SRC

#+RESULTS:
: nil

#+BEGIN_SRC clojure :tangle core.clj
(in-ns 'org-works.core)
(def a 5)

#+END_SRC

#+RESULTS:
: #'org-works.core/a

#+BEGIN_SRC clojure :tangle core.clj
(def b 5)

#+END_SRC

#+RESULTS:
: #'user/b

------------------

Funnily enough, it did work once for a few hours (i.e. the vars were
declared in the namespace org-works.core), but then it stopped working.
Now I tried to reinstall emacs 24.3 and follow all the instructions on
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html

Here are some further details of my system configuration:
(M-x org-version: *Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56 @
/home/pold/org-mode/lisp/*). I also tried to copy the content of the
ob-clojure.el file directly to my .emacs.

My .emacs only has a minimal content:
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)

(defvar my-packages '(starter-kit
                      starter-kit-lisp
                      starter-kit-bindings
                      starter-kit-eshell
                      clojure-mode
                      clojure-test-mode
                      cider))

(dolist (p my-packages)
  (when (not (package-installed-p p))
    (package-install p)))

(add-to-list 'load-path "/home/pold/org-mode/lisp")

(require 'org)
(require 'ob-clojure)

(setq org-babel-clojure-backend 'cider)
(require 'cider)

My installed packages are:
(clojure-test-mode cider clojure-mode pkg-info epl dash
starter-kit-bindings starter-kit-eshell starter-kit-lisp elisp-slime-nav
starter-kit magit ido-ubiquitous smex find-file-in-project
idle-highlight-mode paredit).

Any ideas what's going wrong here?

Thanks!

Best, Volker

[-- Attachment #2: Type: text/html, Size: 9895 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-21 21:22 Namespace problem org-mode / Clojure Volker Strobel
@ 2014-02-21 22:36 ` Thomas S. Dye
  2014-02-21 23:33   ` Volker Strobel
  2014-02-23 15:19   ` Soapy Smith
  2014-03-03 12:54 ` Bastien
  1 sibling, 2 replies; 16+ messages in thread
From: Thomas S. Dye @ 2014-02-21 22:36 UTC (permalink / raw)
  To: Volker Strobel; +Cc: emacs-orgmode

Aloha Volker,

I don't use Clojure, but ob-clojure.el defines a header argument
:package. You should be able to do something like:

#+header: :package org-works.core

to execute code in that name space.

hth,
Tom

Volker Strobel <volker.strobel87@gmail.com> writes:

> Hi,
>
> I'm trying to use org-mode with Clojure and already posted my problem at
> https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
> All my code blocks get evaluated in the namespace user, even if I evaluate
> the (ns ...) code block first.
>
> EXAMPLE (core.org in src/org-works of Leiningen project):
> -------------------
> #+BEGIN_SRC clojure :tangle core.clj
> (ns org-works.core
>   (:gen-class))
> #+END_SRC
>
> #+RESULTS:
> : nil
>
> #+BEGIN_SRC clojure :tangle core.clj
> (in-ns 'org-works.core)
> (def a 5)
>
> #+END_SRC
>
> #+RESULTS:
> : #'org-works.core/a
>
> #+BEGIN_SRC clojure :tangle core.clj
> (def b 5)
>
> #+END_SRC
>
> #+RESULTS:
> : #'user/b
>
> ------------------
>
> Funnily enough, it did work once for a few hours (i.e. the vars were
> declared in the namespace org-works.core), but then it stopped working.
> Now I tried to reinstall emacs 24.3 and follow all the instructions on
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
>
> Here are some further details of my system configuration:
> (M-x org-version: *Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56 @
> /home/pold/org-mode/lisp/*). I also tried to copy the content of the
> ob-clojure.el file directly to my .emacs.
>
> My .emacs only has a minimal content:
> (require 'package)
> (add-to-list 'package-archives
>              '("marmalade" . "http://marmalade-repo.org/packages/"))
> (package-initialize)
>
> (defvar my-packages '(starter-kit
>                       starter-kit-lisp
>                       starter-kit-bindings
>                       starter-kit-eshell
>                       clojure-mode
>                       clojure-test-mode
>                       cider))
>
> (dolist (p my-packages)
>   (when (not (package-installed-p p))
>     (package-install p)))
>
> (add-to-list 'load-path "/home/pold/org-mode/lisp")
>
> (require 'org)
> (require 'ob-clojure)
>
> (setq org-babel-clojure-backend 'cider)
> (require 'cider)
>
> My installed packages are:
> (clojure-test-mode cider clojure-mode pkg-info epl dash
> starter-kit-bindings starter-kit-eshell starter-kit-lisp elisp-slime-nav
> starter-kit magit ido-ubiquitous smex find-file-in-project
> idle-highlight-mode paredit).
>
> Any ideas what's going wrong here?
>
> Thanks!
>
> Best, Volker
> Hi,
>
> I'm trying to use org-mode with Clojure and already posted my problem
> at https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
> All my code blocks get evaluated in the namespace user, even if I
> evaluate the (ns ...) code block first. 
>
> EXAMPLE (core.org in src/org-works of Leiningen project):
> -------------------
> #+BEGIN_SRC clojure :tangle core.clj
> (ns org-works.core
> (:gen-class))
> #+END_SRC
>
> #+RESULTS:
> : nil
>
> #+BEGIN_SRC clojure :tangle core.clj
> (in-ns 'org-works.core)
> (def a 5)
>
> #+END_SRC
>
> #+RESULTS:
> : #'org-works.core/a
>
> #+BEGIN_SRC clojure :tangle core.clj
> (def b 5)
>
> #+END_SRC
>
> #+RESULTS:
> : #'user/b
>
> ------------------
>
> Funnily enough, it did work once for a few hours (i.e. the vars were
> declared in the namespace org-works.core), but then it stopped
> working. 
> Now I tried to reinstall emacs 24.3 and follow all the instructions on
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
>
> Here are some further details of my system configuration:
> (M-x org-version: Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56
> @ /home/pold/org-mode/lisp/). I also tried to copy the content of the
> ob-clojure.el file directly to my .emacs.
>
> My .emacs only has a minimal content:
> (require 'package)
> (add-to-list 'package-archives
> '("marmalade" . "http://marmalade-repo.org/packages/"))
> (package-initialize)
>
> (defvar my-packages '(starter-kit
> starter-kit-lisp
> starter-kit-bindings
> starter-kit-eshell
> clojure-mode
> clojure-test-mode
> cider))
>
> (dolist (p my-packages)
> (when (not (package-installed-p p))
> (package-install p)))
>
> (add-to-list 'load-path "/home/pold/org-mode/lisp")
>
> (require 'org)
> (require 'ob-clojure)
>
> (setq org-babel-clojure-backend 'cider)
> (require 'cider)
>
> My installed packages are:
> (clojure-test-mode cider clojure-mode pkg-info epl dash
> starter-kit-bindings starter-kit-eshell starter-kit-lisp
> elisp-slime-nav starter-kit magit ido-ubiquitous smex
> find-file-in-project idle-highlight-mode paredit).
>
> Any ideas what's going wrong here?
>
> Thanks!
>
> Best, Volker
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-21 22:36 ` Thomas S. Dye
@ 2014-02-21 23:33   ` Volker Strobel
  2014-02-22  0:49     ` Thomas S. Dye
  2014-02-23 15:41     ` Soapy Smith
  2014-02-23 15:19   ` Soapy Smith
  1 sibling, 2 replies; 16+ messages in thread
From: Volker Strobel @ 2014-02-21 23:33 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 5621 bytes --]

Thanks for your answer, Tom!
I tried to modify my org file like this:
---------
#+header: :package org-works.core
#+BEGIN_SRC clojure :tangle core.clj
(ns org-works.core
  (:gen-class))
#+END_SRC

#+header: :package org-works.core
#+BEGIN_SRC clojure :tangle core.clj

(def a 5)

#+END_SRC
-----------

But then, 'M-x org-babel-execute-buffer' results in a emacs crash (can't
edit anything anymore, nor close the frame).

Best, Volker



2014-02-21 23:36 GMT+01:00 Thomas S. Dye <tsd@tsdye.com>:

> Aloha Volker,
>
> I don't use Clojure, but ob-clojure.el defines a header argument
> :package. You should be able to do something like:
>
> #+header: :package org-works.core
>
> to execute code in that name space.
>
> hth,
> Tom
>
> Volker Strobel <volker.strobel87@gmail.com> writes:
>
> > Hi,
> >
> > I'm trying to use org-mode with Clojure and already posted my problem at
> > https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
> > All my code blocks get evaluated in the namespace user, even if I
> evaluate
> > the (ns ...) code block first.
> >
> > EXAMPLE (core.org in src/org-works of Leiningen project):
> > -------------------
> > #+BEGIN_SRC clojure :tangle core.clj
> > (ns org-works.core
> >   (:gen-class))
> > #+END_SRC
> >
> > #+RESULTS:
> > : nil
> >
> > #+BEGIN_SRC clojure :tangle core.clj
> > (in-ns 'org-works.core)
> > (def a 5)
> >
> > #+END_SRC
> >
> > #+RESULTS:
> > : #'org-works.core/a
> >
> > #+BEGIN_SRC clojure :tangle core.clj
> > (def b 5)
> >
> > #+END_SRC
> >
> > #+RESULTS:
> > : #'user/b
> >
> > ------------------
> >
> > Funnily enough, it did work once for a few hours (i.e. the vars were
> > declared in the namespace org-works.core), but then it stopped working.
> > Now I tried to reinstall emacs 24.3 and follow all the instructions on
> > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
> >
> > Here are some further details of my system configuration:
> > (M-x org-version: *Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56 @
> > /home/pold/org-mode/lisp/*). I also tried to copy the content of the
> > ob-clojure.el file directly to my .emacs.
> >
> > My .emacs only has a minimal content:
> > (require 'package)
> > (add-to-list 'package-archives
> >              '("marmalade" . "http://marmalade-repo.org/packages/"))
> > (package-initialize)
> >
> > (defvar my-packages '(starter-kit
> >                       starter-kit-lisp
> >                       starter-kit-bindings
> >                       starter-kit-eshell
> >                       clojure-mode
> >                       clojure-test-mode
> >                       cider))
> >
> > (dolist (p my-packages)
> >   (when (not (package-installed-p p))
> >     (package-install p)))
> >
> > (add-to-list 'load-path "/home/pold/org-mode/lisp")
> >
> > (require 'org)
> > (require 'ob-clojure)
> >
> > (setq org-babel-clojure-backend 'cider)
> > (require 'cider)
> >
> > My installed packages are:
> > (clojure-test-mode cider clojure-mode pkg-info epl dash
> > starter-kit-bindings starter-kit-eshell starter-kit-lisp elisp-slime-nav
> > starter-kit magit ido-ubiquitous smex find-file-in-project
> > idle-highlight-mode paredit).
> >
> > Any ideas what's going wrong here?
> >
> > Thanks!
> >
> > Best, Volker
> > Hi,
> >
> > I'm trying to use org-mode with Clojure and already posted my problem
> > at https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
> > All my code blocks get evaluated in the namespace user, even if I
> > evaluate the (ns ...) code block first.
> >
> > EXAMPLE (core.org in src/org-works of Leiningen project):
> > -------------------
> > #+BEGIN_SRC clojure :tangle core.clj
> > (ns org-works.core
> > (:gen-class))
> > #+END_SRC
> >
> > #+RESULTS:
> > : nil
> >
> > #+BEGIN_SRC clojure :tangle core.clj
> > (in-ns 'org-works.core)
> > (def a 5)
> >
> > #+END_SRC
> >
> > #+RESULTS:
> > : #'org-works.core/a
> >
> > #+BEGIN_SRC clojure :tangle core.clj
> > (def b 5)
> >
> > #+END_SRC
> >
> > #+RESULTS:
> > : #'user/b
> >
> > ------------------
> >
> > Funnily enough, it did work once for a few hours (i.e. the vars were
> > declared in the namespace org-works.core), but then it stopped
> > working.
> > Now I tried to reinstall emacs 24.3 and follow all the instructions on
> > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
> >
> > Here are some further details of my system configuration:
> > (M-x org-version: Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56
> > @ /home/pold/org-mode/lisp/). I also tried to copy the content of the
> > ob-clojure.el file directly to my .emacs.
> >
> > My .emacs only has a minimal content:
> > (require 'package)
> > (add-to-list 'package-archives
> > '("marmalade" . "http://marmalade-repo.org/packages/"))
> > (package-initialize)
> >
> > (defvar my-packages '(starter-kit
> > starter-kit-lisp
> > starter-kit-bindings
> > starter-kit-eshell
> > clojure-mode
> > clojure-test-mode
> > cider))
> >
> > (dolist (p my-packages)
> > (when (not (package-installed-p p))
> > (package-install p)))
> >
> > (add-to-list 'load-path "/home/pold/org-mode/lisp")
> >
> > (require 'org)
> > (require 'ob-clojure)
> >
> > (setq org-babel-clojure-backend 'cider)
> > (require 'cider)
> >
> > My installed packages are:
> > (clojure-test-mode cider clojure-mode pkg-info epl dash
> > starter-kit-bindings starter-kit-eshell starter-kit-lisp
> > elisp-slime-nav starter-kit magit ido-ubiquitous smex
> > find-file-in-project idle-highlight-mode paredit).
> >
> > Any ideas what's going wrong here?
> >
> > Thanks!
> >
> > Best, Volker
> >
> >
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>

[-- Attachment #2: Type: text/html, Size: 8266 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-21 23:33   ` Volker Strobel
@ 2014-02-22  0:49     ` Thomas S. Dye
  2014-02-23 15:41     ` Soapy Smith
  1 sibling, 0 replies; 16+ messages in thread
From: Thomas S. Dye @ 2014-02-22  0:49 UTC (permalink / raw)
  To: Volker Strobel; +Cc: emacs-orgmode

Ouch! You'll want advice from an expert then.

All the best,
Tom

Volker Strobel <volker.strobel87@gmail.com> writes:

> Thanks for your answer, Tom!
> I tried to modify my org file like this:
> ---------
> #+header: :package org-works.core
> #+BEGIN_SRC clojure :tangle core.clj
> (ns org-works.core
>   (:gen-class))
> #+END_SRC
>
> #+header: :package org-works.core
> #+BEGIN_SRC clojure :tangle core.clj
>
> (def a 5)
>
> #+END_SRC
> -----------
>
> But then, 'M-x org-babel-execute-buffer' results in a emacs crash (can't
> edit anything anymore, nor close the frame).
>
> Best, Volker
>
>
>
> 2014-02-21 23:36 GMT+01:00 Thomas S. Dye <tsd@tsdye.com>:
>
>> Aloha Volker,
>>
>> I don't use Clojure, but ob-clojure.el defines a header argument
>> :package. You should be able to do something like:
>>
>> #+header: :package org-works.core
>>
>> to execute code in that name space.
>>
>> hth,
>> Tom
>>
>> Volker Strobel <volker.strobel87@gmail.com> writes:
>>
>> > Hi,
>> >
>> > I'm trying to use org-mode with Clojure and already posted my problem at
>> > https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
>> > All my code blocks get evaluated in the namespace user, even if I
>> evaluate
>> > the (ns ...) code block first.
>> >
>> > EXAMPLE (core.org in src/org-works of Leiningen project):
>> > -------------------
>> > #+BEGIN_SRC clojure :tangle core.clj
>> > (ns org-works.core
>> >   (:gen-class))
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : nil
>> >
>> > #+BEGIN_SRC clojure :tangle core.clj
>> > (in-ns 'org-works.core)
>> > (def a 5)
>> >
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : #'org-works.core/a
>> >
>> > #+BEGIN_SRC clojure :tangle core.clj
>> > (def b 5)
>> >
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : #'user/b
>> >
>> > ------------------
>> >
>> > Funnily enough, it did work once for a few hours (i.e. the vars were
>> > declared in the namespace org-works.core), but then it stopped working.
>> > Now I tried to reinstall emacs 24.3 and follow all the instructions on
>> > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
>> >
>> > Here are some further details of my system configuration:
>> > (M-x org-version: *Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56 @
>> > /home/pold/org-mode/lisp/*). I also tried to copy the content of the
>> > ob-clojure.el file directly to my .emacs.
>> >
>> > My .emacs only has a minimal content:
>> > (require 'package)
>> > (add-to-list 'package-archives
>> >              '("marmalade" . "http://marmalade-repo.org/packages/"))
>> > (package-initialize)
>> >
>> > (defvar my-packages '(starter-kit
>> >                       starter-kit-lisp
>> >                       starter-kit-bindings
>> >                       starter-kit-eshell
>> >                       clojure-mode
>> >                       clojure-test-mode
>> >                       cider))
>> >
>> > (dolist (p my-packages)
>> >   (when (not (package-installed-p p))
>> >     (package-install p)))
>> >
>> > (add-to-list 'load-path "/home/pold/org-mode/lisp")
>> >
>> > (require 'org)
>> > (require 'ob-clojure)
>> >
>> > (setq org-babel-clojure-backend 'cider)
>> > (require 'cider)
>> >
>> > My installed packages are:
>> > (clojure-test-mode cider clojure-mode pkg-info epl dash
>> > starter-kit-bindings starter-kit-eshell starter-kit-lisp elisp-slime-nav
>> > starter-kit magit ido-ubiquitous smex find-file-in-project
>> > idle-highlight-mode paredit).
>> >
>> > Any ideas what's going wrong here?
>> >
>> > Thanks!
>> >
>> > Best, Volker
>> > Hi,
>> >
>> > I'm trying to use org-mode with Clojure and already posted my problem
>> > at https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
>> > All my code blocks get evaluated in the namespace user, even if I
>> > evaluate the (ns ...) code block first.
>> >
>> > EXAMPLE (core.org in src/org-works of Leiningen project):
>> > -------------------
>> > #+BEGIN_SRC clojure :tangle core.clj
>> > (ns org-works.core
>> > (:gen-class))
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : nil
>> >
>> > #+BEGIN_SRC clojure :tangle core.clj
>> > (in-ns 'org-works.core)
>> > (def a 5)
>> >
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : #'org-works.core/a
>> >
>> > #+BEGIN_SRC clojure :tangle core.clj
>> > (def b 5)
>> >
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : #'user/b
>> >
>> > ------------------
>> >
>> > Funnily enough, it did work once for a few hours (i.e. the vars were
>> > declared in the namespace org-works.core), but then it stopped
>> > working.
>> > Now I tried to reinstall emacs 24.3 and follow all the instructions on
>> > http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
>> >
>> > Here are some further details of my system configuration:
>> > (M-x org-version: Org-mode version 8.2.5h (release_8.2.5h-643-gd0ae56
>> > @ /home/pold/org-mode/lisp/). I also tried to copy the content of the
>> > ob-clojure.el file directly to my .emacs.
>> >
>> > My .emacs only has a minimal content:
>> > (require 'package)
>> > (add-to-list 'package-archives
>> > '("marmalade" . "http://marmalade-repo.org/packages/"))
>> > (package-initialize)
>> >
>> > (defvar my-packages '(starter-kit
>> > starter-kit-lisp
>> > starter-kit-bindings
>> > starter-kit-eshell
>> > clojure-mode
>> > clojure-test-mode
>> > cider))
>> >
>> > (dolist (p my-packages)
>> > (when (not (package-installed-p p))
>> > (package-install p)))
>> >
>> > (add-to-list 'load-path "/home/pold/org-mode/lisp")
>> >
>> > (require 'org)
>> > (require 'ob-clojure)
>> >
>> > (setq org-babel-clojure-backend 'cider)
>> > (require 'cider)
>> >
>> > My installed packages are:
>> > (clojure-test-mode cider clojure-mode pkg-info epl dash
>> > starter-kit-bindings starter-kit-eshell starter-kit-lisp
>> > elisp-slime-nav starter-kit magit ido-ubiquitous smex
>> > find-file-in-project idle-highlight-mode paredit).
>> >
>> > Any ideas what's going wrong here?
>> >
>> > Thanks!
>> >
>> > Best, Volker
>> >
>> >
>>
>> --
>> Thomas S. Dye
>> http://www.tsdye.com
>>
> Thanks for your answer, Tom! 
> I tried to modify my org file like this:
> ---------
> #+header: :package org-works.core
> #+BEGIN_SRC clojure :tangle core.clj
> (ns org-works.core
> (:gen-class))
> #+END_SRC
>
> #+header: :package org-works.core
> #+BEGIN_SRC clojure :tangle core.clj
>
> (def a 5)
>
> #+END_SRC
> -----------
>
> But then, 'M-x org-babel-execute-buffer' results in a emacs crash
> (can't edit anything anymore, nor close the frame).
>
> Best, Volker
>
> 2014-02-21 23:36 GMT+01:00 Thomas S. Dye <tsd@tsdye.com>:
>
>     Aloha Volker,
>     
>     I don't use Clojure, but ob-clojure.el defines a header argument
>     :package. You should be able to do something like:
>     
>     #+header: :package org-works.core
>     
>     to execute code in that name space.
>     
>     hth,
>     Tom
>     
>     
>     
>     Volker Strobel <volker.strobel87@gmail.com> writes:
>     
>     > Hi,
>     >
>     > I'm trying to use org-mode with Clojure and already posted my
>     problem at
>     > https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
>     > All my code blocks get evaluated in the namespace user, even if
>     I evaluate
>     > the (ns ...) code block first.
>     >
>     > EXAMPLE (core.org in src/org-works of Leiningen project):
>     > -------------------
>     > #+BEGIN_SRC clojure :tangle core.clj
>     > (ns org-works.core
>     > (:gen-class))
>     > #+END_SRC
>     >
>     > #+RESULTS:
>     > : nil
>     >
>     > #+BEGIN_SRC clojure :tangle core.clj
>     > (in-ns 'org-works.core)
>     > (def a 5)
>     >
>     > #+END_SRC
>     >
>     > #+RESULTS:
>     > : #'org-works.core/a
>     >
>     > #+BEGIN_SRC clojure :tangle core.clj
>     > (def b 5)
>     >
>     > #+END_SRC
>     >
>     > #+RESULTS:
>     > : #'user/b
>     >
>     > ------------------
>     >
>     > Funnily enough, it did work once for a few hours (i.e. the vars
>     were
>     > declared in the namespace org-works.core), but then it stopped
>     working.
>     > Now I tried to reinstall emacs 24.3 and follow all the
>     instructions on
>     >
>     http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.
>     html
>     >
>     > Here are some further details of my system configuration:
>     
>     > (M-x org-version: *Org-mode version 8.2.5h
>     (release_8.2.5h-643-gd0ae56 @
>     > /home/pold/org-mode/lisp/*). I also tried to copy the content of
>     the
>     
>     
>     > ob-clojure.el file directly to my .emacs.
>     >
>     > My .emacs only has a minimal content:
>     > (require 'package)
>     > (add-to-list 'package-archives
>     > '("marmalade" . "http://marmalade-repo.org/packages/"))
>     > (package-initialize)
>     >
>     > (defvar my-packages '(starter-kit
>     > starter-kit-lisp
>     > starter-kit-bindings
>     > starter-kit-eshell
>     > clojure-mode
>     > clojure-test-mode
>     > cider))
>     >
>     > (dolist (p my-packages)
>     > (when (not (package-installed-p p))
>     > (package-install p)))
>     >
>     > (add-to-list 'load-path "/home/pold/org-mode/lisp")
>     >
>     > (require 'org)
>     > (require 'ob-clojure)
>     >
>     > (setq org-babel-clojure-backend 'cider)
>     > (require 'cider)
>     >
>     > My installed packages are:
>     > (clojure-test-mode cider clojure-mode pkg-info epl dash
>     > starter-kit-bindings starter-kit-eshell starter-kit-lisp
>     elisp-slime-nav
>     > starter-kit magit ido-ubiquitous smex find-file-in-project
>     > idle-highlight-mode paredit).
>     >
>     > Any ideas what's going wrong here?
>     >
>     > Thanks!
>     >
>     > Best, Volker
>     > Hi,
>     >
>     > I'm trying to use org-mode with Clojure and already posted my
>     problem
>     > at https://groups.google.com/forum/#!topic/clojure/lnZWUH4XxJM
>     > All my code blocks get evaluated in the namespace user, even if
>     I
>     > evaluate the (ns ...) code block first.
>     >
>     > EXAMPLE (core.org in src/org-works of Leiningen project):
>     > -------------------
>     > #+BEGIN_SRC clojure :tangle core.clj
>     > (ns org-works.core
>     > (:gen-class))
>     > #+END_SRC
>     >
>     > #+RESULTS:
>     > : nil
>     >
>     > #+BEGIN_SRC clojure :tangle core.clj
>     > (in-ns 'org-works.core)
>     > (def a 5)
>     >
>     > #+END_SRC
>     >
>     > #+RESULTS:
>     > : #'org-works.core/a
>     >
>     > #+BEGIN_SRC clojure :tangle core.clj
>     > (def b 5)
>     >
>     > #+END_SRC
>     >
>     > #+RESULTS:
>     > : #'user/b
>     >
>     > ------------------
>     >
>     > Funnily enough, it did work once for a few hours (i.e. the vars
>     were
>     > declared in the namespace org-works.core), but then it stopped
>     > working.
>     > Now I tried to reinstall emacs 24.3 and follow all the
>     instructions on
>     >
>     http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.
>     html
>     >
>     > Here are some further details of my system configuration:
>     > (M-x org-version: Org-mode version 8.2.5h
>     (release_8.2.5h-643-gd0ae56
>     > @ /home/pold/org-mode/lisp/). I also tried to copy the content
>     of the
>     > ob-clojure.el file directly to my .emacs.
>     >
>     > My .emacs only has a minimal content:
>     > (require 'package)
>     > (add-to-list 'package-archives
>     > '("marmalade" . "http://marmalade-repo.org/packages/"))
>     > (package-initialize)
>     >
>     > (defvar my-packages '(starter-kit
>     > starter-kit-lisp
>     > starter-kit-bindings
>     > starter-kit-eshell
>     > clojure-mode
>     > clojure-test-mode
>     > cider))
>     >
>     > (dolist (p my-packages)
>     > (when (not (package-installed-p p))
>     > (package-install p)))
>     >
>     > (add-to-list 'load-path "/home/pold/org-mode/lisp")
>     >
>     > (require 'org)
>     > (require 'ob-clojure)
>     >
>     > (setq org-babel-clojure-backend 'cider)
>     > (require 'cider)
>     >
>     > My installed packages are:
>     > (clojure-test-mode cider clojure-mode pkg-info epl dash
>     > starter-kit-bindings starter-kit-eshell starter-kit-lisp
>     > elisp-slime-nav starter-kit magit ido-ubiquitous smex
>     > find-file-in-project idle-highlight-mode paredit).
>     >
>     > Any ideas what's going wrong here?
>     >
>     > Thanks!
>     >
>     > Best, Volker
>     >
>     >
>     
>     
>     --
>     Thomas S. Dye
>     http://www.tsdye.com
>
>

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-21 22:36 ` Thomas S. Dye
  2014-02-21 23:33   ` Volker Strobel
@ 2014-02-23 15:19   ` Soapy Smith
  2014-02-23 18:14     ` Thomas S. Dye
  1 sibling, 1 reply; 16+ messages in thread
From: Soapy Smith @ 2014-02-23 15:19 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode, Volker Strobel

Hi Tom-

I'm not yet good at elisp, but looking at the ob-clojure.el file, the
header option :package is only associated with slime, not cider?

Regards,
Greg



On Fri, 2014-02-21 at 12:36 -1000, Thomas S. Dye wrote:
> Aloha Volker,
> 
> I don't use Clojure, but ob-clojure.el defines a header argument
> :package. You should be able to do something like:
> 
> #+header: :package org-works.core
> 
> to execute code in that name space.
> 
> hth,
> Tom

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-21 23:33   ` Volker Strobel
  2014-02-22  0:49     ` Thomas S. Dye
@ 2014-02-23 15:41     ` Soapy Smith
  2014-02-25  9:22       ` Volker Strobel
  1 sibling, 1 reply; 16+ messages in thread
From: Soapy Smith @ 2014-02-23 15:41 UTC (permalink / raw)
  To: Volker Strobel; +Cc: emacs-orgmode, Thomas S. Dye

Hi Volker-

I tried the your example code blocks on my system, and I concur with
most of the behavior you described.

org-babel-execute-buffer does not work, as it comes back with error
"repl not connected".  It did not cause a crash.
However, if I add explicit namespace declaration to the 2nd block, it
works!  This is true even thought the 3rd block does not(???).

I was thinking back to why I never encountered this problem, and it is
because I have almost always used an explicit namespace declaration at
the top of the block.  Fortunately, after the first block, you don't
have to use the optional parameters, includes etc.  In your example

(ns environment.my-test)

added to subsequent code blocks you wish to execute in the same
namespace should be sufficient.  I think this should be considered the
"work-around" until someone can explain what is going on, or, even
better, can fix this.

I'm the person who updated the worg documentation for Clojure code
blocks.  I'm thinking about adding a list of TODOs at the bottom, as
there have been some other requests recently to the function behavior.
This issue definitely will go on the list.  Hopefully Bastien is
monitoring and can comment if this is appropriate to add to the Clojure
specific worg page (or should it go somewhere else).

Regards,
Greg

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-23 15:19   ` Soapy Smith
@ 2014-02-23 18:14     ` Thomas S. Dye
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas S. Dye @ 2014-02-23 18:14 UTC (permalink / raw)
  To: Soapy Smith; +Cc: emacs-orgmode, Volker Strobel

Soapy Smith <soapy-smith@comcast.net> writes:

> Hi Tom-
>
> I'm not yet good at elisp, but looking at the ob-clojure.el file, the
> header option :package is only associated with slime, not cider?
>
> Regards,
> Greg

I think so. It looks like cider and nrepl use a different variable, ns,
which isn't exposed as a header argument.

Tom

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-23 15:41     ` Soapy Smith
@ 2014-02-25  9:22       ` Volker Strobel
  2014-02-25 11:20         ` Soapy Smith
  0 siblings, 1 reply; 16+ messages in thread
From: Volker Strobel @ 2014-02-25  9:22 UTC (permalink / raw)
  To: Soapy Smith; +Cc: emacs-orgmode


Hi Soapy,

thank you! I feel at ease knowing that you could replicate
the behavior, as I was trying to find the error in my settings for a
long, long time (and as mentioned before, it did work for some time, and
I've no clue why - I've played around with some settings in the init file). 

And yes, adding an explicit namespace declaration (ns, in-ns) to every code
block works, but that's a rather roundabout way (I've many small
snippets in the same namespace) and it produces a bit 'unsightly',
tangled code. So, I'd be really glad, if this issue could be processed.

Best, Volker

Soapy Smith <soapy-smith@comcast.net> writes:

> Hi Volker-
>
> I tried the your example code blocks on my system, and I concur with
> most of the behavior you described.
>
> org-babel-execute-buffer does not work, as it comes back with error
> "repl not connected".  It did not cause a crash.
> However, if I add explicit namespace declaration to the 2nd block, it
> works!  This is true even thought the 3rd block does not(???).
>
> I was thinking back to why I never encountered this problem, and it is
> because I have almost always used an explicit namespace declaration at
> the top of the block.  Fortunately, after the first block, you don't
> have to use the optional parameters, includes etc.  In your example
>
> (ns environment.my-test)
>
> added to subsequent code blocks you wish to execute in the same
> namespace should be sufficient.  I think this should be considered the
> "work-around" until someone can explain what is going on, or, even
> better, can fix this.
>
> I'm the person who updated the worg documentation for Clojure code
> blocks.  I'm thinking about adding a list of TODOs at the bottom, as
> there have been some other requests recently to the function behavior.
> This issue definitely will go on the list.  Hopefully Bastien is
> monitoring and can comment if this is appropriate to add to the Clojure
> specific worg page (or should it go somewhere else).
>
> Regards,
> Greg

-- 
Sent with my mu4e

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-25  9:22       ` Volker Strobel
@ 2014-02-25 11:20         ` Soapy Smith
  2014-02-26 12:22           ` Soapy Smith
  0 siblings, 1 reply; 16+ messages in thread
From: Soapy Smith @ 2014-02-25 11:20 UTC (permalink / raw)
  To: Volker Strobel; +Cc: emacs-orgmode

I will add this issue to the list of TODOs for Clojure code blocks.

One thing I can do quickly is see if the problem exists in version 7.9
org with nrepl (prior to CIDER).  I have a machine which still has the
old configuration.  I will try later today and report.

Regards,
Greg
(alias Soapy Smith)


On Tue, 2014-02-25 at 10:22 +0100, Volker Strobel wrote:
> Hi Soapy,
> 
> thank you! I feel at ease knowing that you could replicate
> the behavior, as I was trying to find the error in my settings for a
> long, long time (and as mentioned before, it did work for some time, and
> I've no clue why - I've played around with some settings in the init file). 
> 
> And yes, adding an explicit namespace declaration (ns, in-ns) to every code
> block works, but that's a rather roundabout way (I've many small
> snippets in the same namespace) and it produces a bit 'unsightly',
> tangled code. So, I'd be really glad, if this issue could be processed.
> 
> Best, Volker

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-25 11:20         ` Soapy Smith
@ 2014-02-26 12:22           ` Soapy Smith
  0 siblings, 0 replies; 16+ messages in thread
From: Soapy Smith @ 2014-02-26 12:22 UTC (permalink / raw)
  To: Volker Strobel; +Cc: emacs-orgmode

On Tue, 2014-02-25 at 06:20 -0500, Soapy Smith wrote:
> I will add this issue to the list of TODOs for Clojure code blocks.
> 
> One thing I can do quickly is see if the problem exists in version 7.9
> org with nrepl (prior to CIDER).  I have a machine which still has the
> old configuration.  I will try later today and report.
> 
> Regards,
> Greg
> (alias Soapy Smith)

The namespaces worked perfectly on the older machine with org 7.9 and
nrepl.  The problem is apparently isolated to the newest configuration
using CIDER with org 8.

Regards,
Greg

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-02-21 21:22 Namespace problem org-mode / Clojure Volker Strobel
  2014-02-21 22:36 ` Thomas S. Dye
@ 2014-03-03 12:54 ` Bastien
  2014-03-04  2:35   ` Soapy Smith
  1 sibling, 1 reply; 16+ messages in thread
From: Bastien @ 2014-03-03 12:54 UTC (permalink / raw)
  To: Volker Strobel; +Cc: emacs-orgmode

Hi Volker and Greg,

I hopefully fixed this in master.

Can you pull and test?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-03-03 12:54 ` Bastien
@ 2014-03-04  2:35   ` Soapy Smith
  2014-03-04 13:05     ` Soapy Smith
  0 siblings, 1 reply; 16+ messages in thread
From: Soapy Smith @ 2014-03-04  2:35 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Volker Strobel

Hi Bastien-

I will check it tomorrow and report.  Thank you!

Regarding TODOs related to Clojure code blocks; where is the best place
for them?

Greg


On Mon, 2014-03-03 at 13:54 +0100, Bastien wrote:
> Hi Volker and Greg,
> 
> I hopefully fixed this in master.
> 
> Can you pull and test?
> 
> Thanks,
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-03-04  2:35   ` Soapy Smith
@ 2014-03-04 13:05     ` Soapy Smith
  2014-03-13 15:18       ` Bastien
  0 siblings, 1 reply; 16+ messages in thread
From: Soapy Smith @ 2014-03-04 13:05 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Volker Strobel

I installed the update and ran Volker's test code.  It works!  The
namespace is preserved from block-to-block.  Thank you Bastien!

I experimented with the :session option, however, I am now not sure I
understand how it is supposed to work.  I believed it would cause the
code block to switch namespaces with a unique session name, however, it
does not do this.  My older system (7.9 org) behaves the same.

Regards,
Greg



On Mon, 2014-03-03 at 21:35 -0500, Soapy Smith wrote:
> Hi Bastien-
> 
> I will check it tomorrow and report.  Thank you!
> 
> Regarding TODOs related to Clojure code blocks; where is the best place
> for them?
> 
> Greg

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-03-04 13:05     ` Soapy Smith
@ 2014-03-13 15:18       ` Bastien
  2014-03-19 14:30         ` Volker Strobel
  0 siblings, 1 reply; 16+ messages in thread
From: Bastien @ 2014-03-13 15:18 UTC (permalink / raw)
  To: Soapy Smith; +Cc: emacs-orgmode, Volker Strobel

Hi,

Soapy Smith <soapy-smith@comcast.net> writes:

> I installed the update and ran Volker's test code.  It works!  The
> namespace is preserved from block-to-block.  Thank you Bastien!

You're welcome!

> I experimented with the :session option, however, I am now not sure I
> understand how it is supposed to work.

Me neither :)  I see there are discussions on the cider-emacs mailing
list about session-handling for cider -- let makes sure someone there
can test sessions in Org Babel and report any problem or possible
enhancement.

Thanks in advance,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-03-13 15:18       ` Bastien
@ 2014-03-19 14:30         ` Volker Strobel
  2014-03-19 23:46           ` Soapy Smith
  0 siblings, 1 reply; 16+ messages in thread
From: Volker Strobel @ 2014-03-19 14:30 UTC (permalink / raw)
  To: Bastien; +Cc: Soapy Smith, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

A belated, but very big thanks to both of you! It works perfectly now :)

Best, Volker


On Thu, Mar 13, 2014 at 4:18 PM, Bastien <bzg@gnu.org> wrote:

> Hi,
>
> Soapy Smith <soapy-smith@comcast.net> writes:
>
> > I installed the update and ran Volker's test code.  It works!  The
> > namespace is preserved from block-to-block.  Thank you Bastien!
>
> You're welcome!
>
> > I experimented with the :session option, however, I am now not sure I
> > understand how it is supposed to work.
>
> Me neither :)  I see there are discussions on the cider-emacs mailing
> list about session-handling for cider -- let makes sure someone there
> can test sessions in Org Babel and report any problem or possible
> enhancement.
>
> Thanks in advance,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 1311 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Namespace problem org-mode / Clojure
  2014-03-19 14:30         ` Volker Strobel
@ 2014-03-19 23:46           ` Soapy Smith
  0 siblings, 0 replies; 16+ messages in thread
From: Soapy Smith @ 2014-03-19 23:46 UTC (permalink / raw)
  To: Volker Strobel; +Cc: Bastien, emacs-orgmode

That's great!  A big thanks to Bastien for fixing the elisp, and keeping
Clojure code blocks working smoothly.

Speaking of org-mode and Clojure...

You may be interested in the recent Clojure org-mode postings at the
Google group:

https://groups.google.com/forum/#!topic/clojure/hWqPXn1_pK4

https://groups.google.com/forum/#!topic/clojure/V8p3Q9UaNYw

I'm planning to look at this later.  It looks like quite a body of work
using org-mode + Clojure.

Regards,
Greg

On Wed, 2014-03-19 at 15:30 +0100, Volker Strobel wrote:
> A belated, but very big thanks to both of you! It works perfectly
> now :)
> 
> 
> Best, Volker

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-03-19 23:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21 21:22 Namespace problem org-mode / Clojure Volker Strobel
2014-02-21 22:36 ` Thomas S. Dye
2014-02-21 23:33   ` Volker Strobel
2014-02-22  0:49     ` Thomas S. Dye
2014-02-23 15:41     ` Soapy Smith
2014-02-25  9:22       ` Volker Strobel
2014-02-25 11:20         ` Soapy Smith
2014-02-26 12:22           ` Soapy Smith
2014-02-23 15:19   ` Soapy Smith
2014-02-23 18:14     ` Thomas S. Dye
2014-03-03 12:54 ` Bastien
2014-03-04  2:35   ` Soapy Smith
2014-03-04 13:05     ` Soapy Smith
2014-03-13 15:18       ` Bastien
2014-03-19 14:30         ` Volker Strobel
2014-03-19 23:46           ` Soapy Smith

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).