trouble setting up emacs

422 views
Skip to first unread message

Bruce Gordon

unread,
Oct 17, 2011, 11:32:32 PM10/17/11
to Clojure
I am trying to follow the directions at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs.
1. I want to install the Emacs Starter Kit. The directions at
http://dev.clojure.org/display/doc/Getting+Started+with+Emacs mention
"GNU Emacs 23 or 24 is recommended", however https://github.com/technomancy/emacs-starter-kit
says "You'll need Emacs 24". The directions say "precompiled versions
are readily available for Debian-based systems...". I'm using a Debian
based system. so I went to http://emacs.naquadah.org/.
a. I executed> wget -q -O - http://emacs.naquadah.org/key.gpg | sudo
apt-key add -
b. I'm now confused as to which version I want: Stable? If so I should
then follow the directions to add 2 lines to /etc/apt/sources.list,
and then what do I do?

2. Once I get emacs 24 installed, the directions sort of leave off
with " In both cases, you need to launch a Clojure instance with the
correct classpath settings. This is most commonly done using a build
tool such as Leiningen. For instructions see the Build Tools section
of Getting Started." Going to http://dev.clojure.org/display/doc/Getting+Started
and perusing the Build Tools doesn't explain how to setup and launch a
Clojure instance. I see some explanations at
http://blog.bensmann.com/setting-up-a-clojure-development-environment
but don't know if that includes some obsolete directions.

thanks, -Bruce

Phil Hagelberg

unread,
Oct 18, 2011, 12:23:23 AM10/18/11
to clo...@googlegroups.com
On Mon, Oct 17, 2011 at 8:32 PM, Bruce Gordon <bruceb...@gmail.com> wrote:
> I am trying to follow the directions at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs.
> 1. I want to install the Emacs Starter Kit. The directions at
> http://dev.clojure.org/display/doc/Getting+Started+with+Emacs mention
> "GNU Emacs 23 or 24 is recommended", however  https://github.com/technomancy/emacs-starter-kit
> says "You'll need Emacs 24".

Emacs 23 or newer is needed for Clojure support. Emacs 24 is needed
for the Starter Kit.

> I'm using a Debian
> based system. so I went to http://emacs.naquadah.org/.
> a. I executed> wget -q -O - http://emacs.naquadah.org/key.gpg | sudo
> apt-key add -
> b. I'm now confused as to which version I want: Stable? If so I should
> then follow the directions to add 2 lines to /etc/apt/sources.list,
> and then what do I do?

That page lists a number of packages all starting with
"emacs-snapshot". So if you want to use the terminal version only, try
emacs-snapshot-nox; if you want a debug build, emacs-snapshot-dbg,
etc.

> 2. Once I get emacs 24 installed, the directions sort of leave off
> with " In both cases, you need to launch a Clojure instance with the
> correct classpath settings. This is most commonly done using a build
> tool such as Leiningen. For instructions see the Build Tools section
> of Getting Started."

The next section labeled "Slime and Swank Clojure" links to the readme
for swank-clojure, which explains how to use M-x clojure-jack-in; the
simplest way to get a slime session going. It should probably be
cleaned up a bit since it's accumulated some cruft over the months,
but it's all correct.

-Phil

MarisO

unread,
Oct 18, 2011, 7:07:38 AM10/18/11
to Clojure
run this script in your .emacs.d directory

------------------------------------------------------
#!/bin/sh

git clone https://github.com/technomancy/clojure-mode.git
wget -P paredit http://mumble.net/~campbell/emacs/paredit.el

wget http://download.savannah.gnu.org/releases/color-theme/color-theme-6.6.0.tar.gz
mkdir color-theme
tar --strip-components=1 --directory=color-theme -xzf color-
theme-6.6.0.tar.gz

rm color-theme-6.6.0.tar.gz
------------------------------------------------------


init.el

------------------------------------------------------
(add-to-list 'load-path "~/.emacs.d/")

;; clojure-mode
(add-to-list 'load-path "~/.emacs.d/clojure-mode")
(require 'clojure-mode)

(fset 'compile-and-goto-repl "\C-x\C-s\C-c\C-k\C-c\C-z")

(global-set-key (kbd "C-c C-g C-r") 'compile-and-goto-repl)
(global-set-key (kbd "C-c C-j C-i") 'clojure-jack-in)

;; paredit
(add-to-list 'load-path "~/.emacs.d/paredit")
(require 'paredit)

(add-hook 'clojure-mode-hook 'enable-paredit-mode)

(global-set-key (kbd "M-p M-m e") 'enable-paredit-mode)
(global-set-key (kbd "M-p M-m d") 'disable-paredit-mode)

;; color theme
(add-to-list 'load-path "~/.emacs.d/color-theme")
(require 'color-theme)

(eval-after-load "color-theme"
'(progn
(color-theme-initialize)))

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



Start emacs, change current directory (M-x cd) to a leiningen project
root and press C-c C-j C-i. It should start clojure repl.
You will need swank as dev dependency.

:dev-dependencies [[swank-clojure "1.3.1"]
[midje "1.1.1"]]



hth,
Maris



On Oct 18, 4:32 am, Bruce Gordon <brucebgor...@gmail.com> wrote:
> I am trying to follow the directions athttp://dev.clojure.org/display/doc/Getting+Started+with+Emacs.
> 1. I want to install the Emacs Starter Kit. The directions athttp://dev.clojure.org/display/doc/Getting+Started+with+Emacsmention
> "GNU Emacs 23 or 24 is recommended", however  https://github.com/technomancy/emacs-starter-kit
> says "You'll need Emacs 24".  The directions say "precompiled versions
> are readily available for Debian-based systems...". I'm using a Debian
> based system. so I went tohttp://emacs.naquadah.org/.
> a. I executed> wget -q -O -http://emacs.naquadah.org/key.gpg| sudo
> apt-key add -
> b. I'm now confused as to which version I want: Stable? If so I should
> then follow the directions to add 2 lines to /etc/apt/sources.list,
> and then what do I do?
>
> 2. Once I get emacs 24 installed, the directions sort of leave off
> with " In both cases, you need to launch a Clojure instance with the
> correct classpath settings. This is most commonly done using a build
> tool such as Leiningen. For instructions see the Build Tools section
> of Getting Started." Going tohttp://dev.clojure.org/display/doc/Getting+Started
> and perusing the Build Tools doesn't explain how to setup and launch a
> Clojure instance. I see some explanations athttp://blog.bensmann.com/setting-up-a-clojure-development-environment

Howard Lewis Ship

unread,
Oct 24, 2011, 7:28:08 PM10/24/11
to clo...@googlegroups.com
I've gotten as far as changing to a directory with a project.clj and
execute C-c C-j C-i

I see this in my *swank* buffer:


Process swank exited abnormally with code 127
sh: line 1: lein: command not found


lein is on my search path (in ~/bin). Where do I update things so
that it is on the path for the Swank process?

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

gaz jones

unread,
Oct 24, 2011, 7:32:38 PM10/24/11
to clo...@googlegroups.com
some kind soul gave me this on the mailing list a while ago, works for me:

;; fix the PATH variable
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (shell-command-to-string "$SHELL -i -c 'echo $PATH'")))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))

(if window-system (set-exec-path-from-shell-PATH))

shove that in your init.el or wherever you are putting your
customisations. it adds your shell path to emacs path and should
enable emacs to find lein.

Phil Hagelberg

unread,
Oct 24, 2011, 7:33:13 PM10/24/11
to clo...@googlegroups.com
On Mon, Oct 24, 2011 at 4:28 PM, Howard Lewis Ship <hls...@gmail.com> wrote:
> lein is on my search path (in ~/bin).  Where do I update things so
> that it is on the path for the Swank process?

In Mac OS X, usually programs that are launched from the GUI don't get
their environment variables (like $PATH) set correctly. Supposedly
there's a fix, but it involves editing a file called plist.xml, so I
have a hard time recommending it with a clear conscience.

-Phil

Howard Lewis Ship

unread,
Oct 24, 2011, 7:55:50 PM10/24/11
to clo...@googlegroups.com
This was helpful:

http://www.emacswiki.org/emacs/MacOSTweaks#toc14

I added the following to my init.el:

(setenv "PATH" (concat (getenv "PATH") ":~/bin"))
(setq exec-path (append exec-path `("~/bin")))


Seems like I could have used (add-to-list 'exec-path "~/bin") for the
second line, is that right?

In any case, my next step is to see if Swank is working (it would help
if I knew what Swank was supposed to do!)

Howard Lewis Ship

unread,
Oct 24, 2011, 8:06:20 PM10/24/11
to clo...@googlegroups.com
So Swank appears to be running, but when I edit a Clojure file and hit
C-x C-e I get an error:

Symbol's function definition is void: lisp-eval-last-sexp

I also see this in my *messages* buffer:

error in process filter: require: Symbol's value as variable is void: slime-clj

Any ideas ... even on where to start?

Roberto Mannai

unread,
Oct 24, 2011, 10:37:01 PM10/24/11
to clo...@googlegroups.com
It seems you're having some problems with incompatible slime versions.
On Mac I'm successfully using Acquamacs
(http://aquamacs.org/download.shtml - do NOT install
Aquamacs-SLIME-xx.pkg.tgz) without any particular workaround. Just
install it, install lein (my script is /usr/bin/lein) and the
clojure-mode. See also
http://groups.google.com/group/clojure/browse_thread/thread/986227536292502b?hl=en

Phil Hagelberg

unread,
Oct 24, 2011, 11:33:27 PM10/24/11
to clo...@googlegroups.com
On Mon, Oct 24, 2011 at 5:06 PM, Howard Lewis Ship <hls...@gmail.com> wrote:
> error in process filter: require: Symbol's value as variable is void: slime-clj

slime-clj is a different poorly-named library that has been renamed to
ritz. Unfortunately the packages are still available for installation.

The swank-clojure readme should cover everything you need as long as
you don't have any other incompatible libraries (like swank-clj or the
CL-compatible version of slime) installed:
https://github.com/technomancy/swank-clojure/blob/1.3.x/README.md The
only piece of elisp you should install is clojure-mode.

-Phil

Reply all
Reply to author
Forward
0 new messages