5

I was following the guide and information from A gentle tutorial to Emacs/Swank/Paredit for Clojure

However after opening elpa and installing clojure-mode, slime and paredit. I restarted emacs and then attempted to use M-x slime however it continually says no match . What am I doing wrong?

I then tried to install clojure-mode from marmalade http://marmalade-repo.org/packages I byte-compiled package el and then added (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) to my.emacs. However marmalade errors with Symbol's value as variable is void: package-archives .

Unsure exactly what I am doing wrong I am on windows7 using emacs 23.3. I have clojure installed to c:/clojure.

Any help appreciated.

Community
  • 1
  • 1
sayth
  • 6,696
  • 12
  • 58
  • 100

5 Answers5

8

My init.el has both (require 'package) and (package-initialize). It's not very big, it looks like this:

(require 'package)
;; Add the original Emacs Lisp Package Archive
(add-to-list 'package-archives
             '("elpa" . "http://tromey.com/elpa/"))
;; Add the user-contributed repository
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)

I'm on emacs 24 (a development build) on Windows 7. I had trouble getting emacs 23 to work with packages too, it was easier for me to just upgrade.

By the way, I noticed that if I set a HOME environment variable, emacs looks there for the .emacs.d directory (instead of in %USER_PROFILE%\AppData\Roaming).

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
2
  1. Download package.el (don't follow the instructions on the ELPA site, just download the package.el provided on marmalade's site).
  2. Put package.el in your .emacs.d directory (~/.emacs.d/).
  3. Add the following to your .emacs file (~/.emacs):

;;Load path to my packages

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

;;Load ELPA (the package.el you downloaded from marmalade)

(require 'package)

;;Load Marmalade (the code found on marmalade's welcome page)

(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))

That's it! I really hope this helps.

EDIT: Sorry, I forgot to mention that you need to add (package-initialize) at the end of the code I provided. If you don't add this line, the packages will install, but won't load.

gary
  • 4,227
  • 3
  • 31
  • 58
1

I think, that you need to put

(require 'package)

before 'add-to-list'

P.S. and add following call after 'add-to-list'

(package-initialize)

this command will load installed packages and activate them

P.P.S. '(require 'package)' maybe not needed, but I'm personally not using 'package.el'

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Thanks it currently still wont work. ELPA works but marmalade wont. Which is a shame because clojure mode on marmalade is 1.9.4 and on ELPA 1.7.1. One things certain the directions on http://marmalade-repo.org/ are definitely vague and likely not accurate. – sayth Jun 29 '11 at 07:28
  • If you always want to have fresh version, you can look onto el-get package (https://github.com/dimitri/el-get) – Alex Ott Jun 29 '11 at 10:58
  • I just tried on my fresh Emacs (from BZR) and package.el shows version from marmalade-repo -- 1.9.2 – Alex Ott Jun 29 '11 at 11:01
0

It seems to me you're missing either (require 'package) or (package-initialize). You can check out my setup here - I'm using both marmalade and clojure-mode on Windows 7 and it works like a charm.

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
  • I have put the package.el in my .emacs.d directory and it still wont load with the (require 'package) and/or (package-initialize) in .emacs. I tried your git package created a directory and cloned to C:\emacs_kit\emacs-dev-kit created ln -s C:/emacs_kit/emacs-dev-kit ~/.emacs.d . After starting emacs though M-X slime still had no match error. – sayth Jun 29 '11 at 07:32
  • On windows 7 .emacs.d should be in "c:/Users/Username/AppData/Roaming/.emacs.d" - otherwise Emacs won't pick it up. – Bozhidar Batsov Jun 29 '11 at 07:58
  • oh yeah I agree, I am trying to setup emacs to work with clojure on a XP PC, Win7 Laptop & Vectorlinux box. – sayth Jun 29 '11 at 08:49
  • 1
    `~/.emacs.d` is not on the load-path by default, so even if you've put `package.el` there, you won't be able to require it. Try `(add-to-list 'load-path (expand-file-name "~/.emacs.d"))` – sanityinc Jun 29 '11 at 16:02
0

Do not know it is same problem, I faced when I were trying to use quicklisp's swank/slime

Finally I found that few /contrib/*.el packages were dependent on each other if A's dependency package is B, if B is not byte-compiled than A will not compile

when you do (require 'A)

it will throw Symbol's variable value is void: A

So ensure you compile each package than try require.

Sharad
  • 437
  • 1
  • 5
  • 17