Why? There are several reasons:
- I wanted to rewrite a cleaner configuration file and use the
ELPA package manager. OS X has no
package manager, at least no one that I use (e.g.,
Homebrew)--anyway, I like compiling
everything from scratch so that I know where things go to be
installed. However, with time I have accumulated a large collection of
.elfiles in my
.lisp.ddirectory, and almost half of them are outdated.
- Aquamacs provides a rich set of facilities for people living with a Mac (key bindings, fullscreen support, etc.) and I have downloaded several versions from the developmental branch without any difficulties. Now, there are tons of gadgets that I don't use, and it doesn't work well when runned in a terminal (and the Emacs that ships with Apple Macbook is version 22.1!).
- This lead me to re-read a lot of documentation, which is quite good because with time we tend to rely on automated commands, sometimes without knowing how they are implemented.
Everything started with my looking at the
overtone project (following
a post mirrored on Planet
Clojure). There's a nice screencast on the Github website, and I also found
this one: How to Hack Overtone with Emacs. So
basically, the author customized his emacs with a lot of add-ons, especially
to assist coding activity: auto-complete, snippets, connection to various
REPLs, etc. I wanted to do the same, but without using the complete
overtone configuration files. That's almost done!
Be sure to grab one of the 24.* series in the build repository. I personally choosed the 24.1-rc pretest version. I haven't had any problem so far.
To configure ELPA, we can add the following two lines in our
(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/") ("tromey" . "http://tromey.com/elpa/")))
This will add Marmalade as well as Tromey ELPA to the default GNU repository. Something that's really important is to configure the keyboard; I just added
(setq mac-option-modifier 'none)
in order to exchange command the option (⌥) and command (⌘) keys. Otherwise,
we cannot type symbols like
Alt-n), or use square brackets (which is
pretty sad when writing R code :-). Other customizations can be added, for
example to make the connection with Mac
pbpaste more transparent.
I am also trying to familiarize myself with ido-mode that I've never used:
(require 'ido) (ido-mode t)
My first impressions were disconcerting, but now I seem to get used to it. I
just have to remember that I now have to
C-d to get into
browsing content of a directory.
.emacs is not entirely clean at the moment: I need to investigate
autoload vs. require
issue more carefully. For the moment, I am quite happy with the configuration of Lisp, Clojure,
R, and Python. I can connect to slime using either
lein swank or
clojure-jack-in from within Emacs. For R, I have
Yasnippets working right out of
the box, together with other goodies from
ESS. I was previously using
most of the basic functionalities I need for interacting with Stata.
An example of an interactive R session is shown below:
Top panel shows how Yasnippet prompting tool is triggered when pressing tab
(⇥), while bottom panel shows available arguments when typing
rnorm in the
R shell directly.
Here is another screenshot which show the beginning of a clojure script with
auto-completion and a running
Next screenshot shows two buffers with Yasnippet providing basic
defn macro (top), or suggesting methods in Python mode
Finally, this configuration works equally well when Emacs run in a Terminal
nw), as can be seen below: