Hey all, I recently went through this process as a total clojure/emacs noob. Trying to use the command line (especially in Windows) to enter samples that were more than one line was just brutal. Also, I really wanted the emacs experience while toying around with Clojure samples and reading this great book.
In case another total noob stumbles across this and needs help, this is what I did from start to finish to get Clojure Box up and running with the sample code for "Programming Clojure" by Stuart Halloway. (trying to help out the googlers) 1. Install Clojure Box! This is very simple download here: http://clojure.bighugh.com/ 2. Download the book's sample code here: http://www.pragprog.com/titles/shcloj/source_code (I went with the ZIP file) 3. Extract the archive to a place you can remember! 4. Run Clojure Box 5. Use the keyboard shortcut to fine a file: C-x C-f, then type ~/.emacs -> enter (this opens a file, even if it doesn't exist already!) 6. I am assuming this will come up blank for most of you, if you have already customized your emacs install, then you probably don't need this HOWTO. So on your blank screen, add this: (setq swank-clojure-extra-classpaths (list "D:/home/mydrop~1/code/clojure/shcloj-code/code")) your path should be the path to where you extracted your sample code! This where is mine ended up. Mind the FORWARD slashes! That honestly took me 30 minutes to figure out. Even in Windows, emacs likes the FORWARD slashes. I also added: (tool-bar-mode -1) to get rid of the pesky (ugly) graphical toolbar, but do what you like. 7. *IMPORTANT* You must save this file! C-x C-s, you should see emacs tell you where it wrote the file to at the bottom of the screen, mine ended up in "C:/Documents and Settings/chris/Application Data/.emacs 8. Close emacs, then run it again. It will ask you about running processes, because there is a clojure REPL running, totally fine to kill it, you haven't done any work yet, right? When you open it back up, it should look exactly the same as before...BUT! Head back to page 37 (ish) and read about requiring and using other pieces of clojure code. At the REPL type: => (use 'examples.introduction) nil <--- you should get nil as a response! => (take 10 fibs) (0 1 1 2 3 5 8 13 21 34) <--- hooray it worked! We're running the book's sample code! 9. Enjoy the rest of the book with an extremely powerful tool to help mangle the code samples :) This is as far as I've gotten in the book, so hopefully all the versions line up correctly to work with the samples. If there is weird breakage, I am sorry! As I continue to wade through the book I'll try to update if I encounter anything weird and especially if I can find a way to fix it. Also, excuse this if it is redundant, but I was trying to get this to work for a while last night and would have really found something like this helpful. happy Clojuring! On Jul 8, 10:35 pm, Daniel <dan.in.a.bot...@gmail.com> wrote: > On Thu, Jul 9, 2009 at 1:56 AM, Mani<dumb...@gmail.com> wrote: > > > Thanks Shawn, Robert. > > From Robert's post, I am bit confused here. I also read that .emacs is > > in %appdata% folder (vista), but all I see is .emacs.d folder (which I > > guess is for the emacs server). I tried creating one "C-x C-f > > ~/.emacs" - under my home-directory (C:\emacs). Should i just create > > a .emacs under %appdata%/.emacs.d OR right under %appdata%? > > From the EmacsWiki [1]: "If the init file ~/.emacs does not exist, > Emacs will try ~/.emacs.d/init.el" > > Since you usually have more than a couple of things that you want to > configure, emacs.d gives you a directory instead of a file for > configuration. That makes it easier to keep things organized. If you > put what you want into %appdata%/.emacs.d/init.el, you should be fine. > > I guess ClojureBox is a good starting point for Emacs with Clojure. A > little bit more general is the Emacs starter kit [2] from Phil > Hagelberg (Clojure regular), and if nothing else, reading the readme > (displayed on the linked page) is recommended because it gives you a > bit of intro on Emacs configuration (ClojureBox might even use the > starter kit, but according to this [3] it doesn't. Didn't check > though). > > Hope that helps > > Cheers, > Daniel > > [1]http://www.emacswiki.org/emacs/DotEmacsDotD > [2]http://github.com/technomancy/emacs-starter-kit/tree/master > [3]http://groups.google.com/group/clojure/browse_thread/thread/6fd17fb97... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---