Guest User

Untitled

a guest
Jun 24th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. How I installed everything:
  2.  
  3. Delete the file ~/.emacs and the folder ~/.emacs.d if you have them
  4.  
  5. then in terminal, from your users home folder, check out the emacs starter kit with Git:
  6.  
  7. git clone git://github.com/technomancy/emacs-starter-kit.git .emacs.d
  8.  
  9. then you can start carbon emacs and use these commands to install clojure, slime and everything else for developing with emacs:
  10.  
  11. M-x package-list-packages
  12.  
  13. move the cursor (or the point as it's called in emacs) to clojure-mode in the list and hit i to set it to install and then x to execute the installation.
  14.  
  15. It'll tell you to add some lines to your .emacs, which you don't do when using the emacs-starter-kit. Create a new file inside the .emacs.d folder instead with your OSX username and the extension .el and put those lines in there. I am not 100% sure if that is the right way to do it, the docs are really sparse for the emacs starter kit (just a readme file) :)
  16.  
  17. then do:
  18. M-x clojure-install (if it doesn't find the command, do an M-x clojure-mode before that)
  19. Hit enter to accept the standard path where you want to checkout clojure and tools, or enter a different path if you like.
  20.  
  21. Then it checks out clojure and some other stuff and you are set to go.
  22.  
  23. M-x slime
  24. starts the REPL inside emacs. Open another buffer with C-x 2 and create a new file in there with C-x C-f and call it something.clj, clojure-mode should get activated automatically for this file, you can set the mode manually by entering M-x clojure-mode.
  25.  
  26. The buffer is not connected to the REPL buffer yet though. I found it easiest to enter M-x menu-bar-mode to get the menubar and then use the mouse to navigate to the Clojure menu and the "Run Lisp" command. Then your buffer with your something.clj file switches to the REPL so you have to switch it back to the file again C-x C-b use arrows to select the buffer and hit enter.
  27.  
  28. Now you can put the cursor onto a (defn ...) that you wrote in something.clj and hit C-M-X to execute the function in the REPL. Check the clojure menu in the menubar for other Clojure related keybindings, try them out a bit to see what they do.
  29.  
  30. The toolbar is also gone in the emacs-starter-kit. To get it back, enter M-x tool-bar-mode. It's easier to have the toolbar for an emacs beginner :)
  31. I think you can put that command in your username.el file so that it gets executed automatically when you start emacs. Haven't tried that yet.
  32.  
  33. If you want to update the starter kit, just cd into the .emacs.d folder and do a "git pull". To update Clojure, hit M-x clojure-update in emacs to update clojure and tools from the repositories.
  34.  
  35. My development workflow looks like this at the moment. I have my something.clj file, load it into the REPL by using the command for that in the Clojure menu in Emacs. Then I add a function and hit M-C-X to execute the new function, or I change one and do the same so that the change is in the REPL.
  36.  
  37. Hope that helps, good luck and have fun ;)
Add Comment
Please, Sign In to add comment