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.

1 Answer 1


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"
  • 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! Commented Sep 4, 2012 at 19:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .