emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Namespace problem org-mode / Clojure


From: Volker Strobel
Subject: [O] Namespace problem org-mode / Clojure
Date: Fri, 21 Feb 2014 22:22:35 +0100

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


reply via email to

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