Emacs on Mac OS X

During the weekend I spent a few hours setting up a new hacking environment for my latest curiosity, Lisp. Evidently all the cool kids use Emacs for hacking in Lisp so I invested the time to revisit my Emacs setup.

Previously I would SSH into each server on which I had files to edit and run Emacs in each shell. This forced me to maintain .emacs files everywhere and exposed me to network breaks. (I tried screen but OSX+screen+Emacs is the deadly triad of configuration hell.)

Now I use GNU Emacs for Mac OS X, a universal binary compiled just days ago from the GNU source. Instead of running Emacs on a remote server, I use TRAMP to connect and edit remote files. When I want to open a remote file, I prefix the path with /ssh:hostname: or /scp:hostname:. TRAMP can browse and autocomplete in remote directories just as well as in local directories.

I already keep my most used servers in my .ssh/ssh_config file and I use shell scripts to start master connections with logs tailing in terminal windows. Master connections cut down on TRAMP connection times. TRAMP reads ssh_config for hostname autocompletion, so I can open remote files in fewer keystrokes than ever before.

There so many benefits to using Cocoa Emacs instead of Terminal+SSH+Emacs. I don’t have to mess with Terminal’s key maps and then fix them in every remote .emacs file. I don’t even need to install Emacs on remote servers. The kill ring integrates with the clipboard and works across all remote hosts. The network can’t lag my keystrokes or kill my editing session. Frames. Menus. Scroll bars.

I must stop blogging and get back to work. But first I must thank David Caldwell for setting up emacsformacosx.com. Of all the major hacking environment shifts I’ve made, this was the easiest and most powerful.

5 thoughts on “Emacs on Mac OS X

  1. Yeah, and to optimize editing in TRAMP, you might like to disable auto-save-mode, maybe in a find-file-hook. Also checkout ElScreen, I’m sure you’ll like it.

    1. Yes, I did turn off auto-save within hours of posting this. 🙂 I’ll try to remember to try ElScreen when next I hack in Lisp. Thanks!

  2. One thing I’ve found with emacs on OS/X is that the screen doesn’t seem to keep up with the keyboard. For example if I hold the down the movement keys the screen will often not update until I release the key. I wish I knew how to fix this one. It drives me nuts.

Comments are closed.