Cocoa Emacs 23 as a Python IDE on MacOS 10.6 Snow Leopard: Part One
Introduction
So, you want to use Emacs for programming in Python? With many features of an IDE? And you’re on a mac? And you have far too much time on your hands? You may have tried Aquamacs or Carbon Emacs, but you find that you really just want an Emacs that is true to its GNU self and retains sane key bindings instead of trying to be more mac-like. Perhaps you prefer to follow the development of Emacs more closely. Perhaps you are slightly masochistic.
You could simply download one of the binaries available from http://emacsformacosx.com/ and be done with it, but you yearn for the bleeding edge; you want to run Emacs 23 in Cocoa native mode from bzr trunk.
Well friend, you’ve come to the right place.
Welcome to my hand-crafted Emacs tutorial, focusing on how to get started using Emacs on MacOS 10.6 as an integrated development environment for coding Python based web applications.
In order for this to work, of course, you’re going to need a copy of the Developer Tools from Apple installed on your machine. This installation will also require bzr: http://bazaar.canonical.com . The installation of these components is beyond the scope of this tutorial.
While definitely an Emacs fanatic, this author does not claim the same functionality can not be configured using VIM, and freely admits to using VIM on a regular basis. The author is also a recovering TextMate user, the Duke Nukem Forever of editors: http://wiki.macromates.com/FAQ/TextMate2 .
Installation
First of all we are going to grab a copy of Emacs 23 from the official bzr repository and compile it. You said you wanted bleeding edge, right?:
bzr branch http://bzr.savannah.gnu.org/r/emacs/emacs-23 emacs cd emacs
Now we’ll patch this emacs so that we can run in full-screen mode:
wget http://gist.github.com/raw/291150/59bbe67fe996ed4c2c71198a335f1a47a235dd3d/fullscreen.patch patch -p 1 -i fullscreen.patch
If everything goes according to plan:
./configure --with-ns make make install sudo cp -r nextstep/Emacs.app /Applications/
The ‘–with-ns’ flag tells the configure script that we want to build a ‘NextStep’ binary, which is what the Emacs project calls their Mac binary.
Congratulations, now you have compiled your very own bleeding edge Emacs. Careful, it’s sharp.
Let’s try starting it up to verify that it works.:
open /Applications/Emacs.app
Emacs should now be running happily on your Mac.
You can quit Emacs with the following command:
C-x C-c
Tune in next time for a discussion of how to configure Emacs now that it is installed. Until then, try running the built in tutorial: Invoke Emacs and then press:
C-h t