From: Volker Strobel <volker.strobel87@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Namespace problem org-mode / Clojure
Date: Sat, 22 Feb 2014 00:33:41 +0100 [thread overview]
Message-ID: <CACCk52LcMYJPOZTfDEDkHOMDFe=g61UT_dDUrrXACS7H3E5E9A@mail.gmail.com> (raw)
In-Reply-To: <m2mwhk5bzw.fsf@tsdye.com>
[-- 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 --]
next prev parent reply other threads:[~2014-02-21 23:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACCk52LcMYJPOZTfDEDkHOMDFe=g61UT_dDUrrXACS7H3E5E9A@mail.gmail.com' \
--to=volker.strobel87@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=tsd@tsdye.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 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).