From mboxrd@z Thu Jan 1 00:00:00 1970 From: Volker Strobel Subject: Re: Namespace problem org-mode / Clojure Date: Sat, 22 Feb 2014 00:33:41 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2019a5d91af04f2f30d74 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGzbF-00009c-Jz for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 18:33:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGzbD-0001UF-3K for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 18:33:45 -0500 Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]:49795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGzbC-0001TB-Ro for emacs-orgmode@gnu.org; Fri, 21 Feb 2014 18:33:43 -0500 Received: by mail-oa0-f41.google.com with SMTP id o6so4858846oag.0 for ; Fri, 21 Feb 2014 15:33:42 -0800 (PST) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: emacs-orgmode@gnu.org --001a11c2019a5d91af04f2f30d74 Content-Type: text/plain; charset=ISO-8859-1 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 : > 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 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 > --001a11c2019a5d91af04f2f30d74 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for your answer, Tom!=A0
I tried to modify my o= rg file like this:
---------
#+header: :package or= g-works.core
#+BEGIN_SRC clojure :tangle core.clj
(ns o= rg-works.core
=A0 (:gen-class))
#+END_SRC

#+heade= r: :package org-works.core
#+BEGIN_SRC clojure :tangle core.clj

(def a 5)

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

But then, 'M-x org-babe= l-execute-buffer' results in a emacs crash (can't edit anything any= more, 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.str= obel87@gmail.com> writes:

> Hi,
>
> I'm trying to use org-mode with Clojure and already posted my prob= lem at
> https://groups.google.com/forum/#!topic/clojure/lnZWUH4= XxJM
> All my code blocks get evaluated in the namespace user, even if I eval= uate
> 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
> =A0 (: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/l= anguages/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
> =A0 =A0 =A0 =A0 =A0 =A0 =A0'("marmalade" . "http://marmalade= -repo.org/packages/"))
> (package-initialize)
>
> (defvar my-packages '(starter-kit
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 starter-kit-lisp
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 starter-kit-bindings
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 starter-kit-eshell
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 clojure-mode
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 clojure-test-mode
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cider))
>
> (dolist (p my-packages)
> =A0 (when (not (package-installed-p p))
> =A0 =A0 (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-n= av
> 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 prob= lem
> at https://groups.google.com/forum/#!topic/clojure/lnZW= UH4XxJM
> 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/l= anguages/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<= br> > @ /home/pold/org-mode/lisp/). I also tried to copy the content of the<= br> > 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/&quo= t;))
> (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=

--001a11c2019a5d91af04f2f30d74--