Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm taking yet another run at Emacs. I've installed Cocoa Emacs, and so far so good. Now I'd like to use Cocoa Emacs as my editor for Mutt. With MacVim, it's trivial to use Macvim, i just put:

set editor="vim -o -f" # editor to use when composing messages

in my .muttrc, and everything works. When I want to compose a mail, I type m in Mutt and a new Macvim window opens on top, when I quit, I'm in the Mutt mailing screen (where I can put in cc, attachments, and type y to send).

When I've found anything about using emacs with Mutt it's always been a very complicated explanaition.

Surely there is a simple way to get emacs to do this?


John V.

share|improve this question
up vote 1 down vote accepted

With Emacsclient, keeping Emacs running all the time

Emacs uses a slightly different setup than e.g. vim. The editor itself can remain active all the time (because you may have it open for other things as well) and you use a utility called emacsclient to connect to it (pass a file to edit) if you need it.

Add the following line to your config file (.emacs):

(server-start)  ; Starts server for (among others) emacsclient

Or, if you don't wish to keep the server for emacsclient running at all times, you may issue the command M-x server-start to emacs when you're ready to run. Issuing that command is probably the right thing to do when you're already running emacs, unless you want to reload .emacs.

All you have to do now is to make sure that MUTT uses emacsclient as its editor. You can do this by adding the following line to your config file (.muttrc):

set editor="emacsclient"

Recent versions of mutt (at least 1.4.1) require the following format:

set editor="emacsclient %s"

Source: Emacs and MUTT

Starting Emacs every time

set editor="emacs %s"
share|improve this answer
This works. At the moment I'm using "emacs %s" version, although I have to give complete path. I have a few other issues, but they will be topic for future questions if I don't resolve them! – John Velman Sep 4 '12 at 19:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.