Tips for using emacsclient and server-mode on OSX

Emacs is a great editor, but has one setback - it is slow to startup if you have loads of packages to load. On my G4 iBook, it takes around 45 seconds before Emacs becomes usable (OK - I use lots of packages). However, Emacs is not meant to be restarted every so often. The canonical usage is to start Emacs once, invoke the server mode (see EmacsClient) and then use the emacsclient from the command line to invoke the editor instance when needed. I.e., the classic client/server model for editing! ...

August 11, 2009 · 3 min

Emulate a three button Mouse in Emacs on a single button Mac trackpad/mouse

Traditionally, mice on Macs have had just one button (including the iBook/Powerbook trackpads) - even through Mac OS (including OS X) can accept 2 or 3 button input without any problems. Emacs on the other hand maps quite a few functions to the second and third chords of the mice. If you want to emulate a three button mouse in Emacs on OS X, a simple customization option will do the trick. ...

August 9, 2009 · 1 min

Using M-` from switching Emacs Frames on OSX

The standard Emacs key-binding for moving to the other frame (‘other-frame’) is C-x 5 o. That’s quite a few key-strokes, and also does not match with the standard OS X key-mapping for switching windows, which is Command-`. On OS X, the Command key maps to Meta in Emacs. However, this is easy to fix. Put the following code-fragment into your .emacs file: (define-key icicle-mode-map [?\M-`] nil) # Only needed if you use Icicles (global-set-key [?\M-`] 'other-frame) # This sets the key binding Note that by default M-` invokes ‘tmm-menubar’ which can also be accessed via [F10]. Also, you do not need the first line (to undefine the key binding in Icicles) if you do not use that package.

August 9, 2009 · 1 min

Using OSX Spotlight from within Emacs

Emacs comes with a ‘locate’ command that uses the locate system command to find files within your system. On OS X, it is easier to use Spotlight, which is trivial to enable in Emacs. In your .emacs file, add the following code: (setq locate-command "mdfind") Now try: M-x locate <enter your search here> Your search results will be displayed in a new Window.

August 8, 2009 · 1 min