Questions/suggestions are accepted with gratitude.
Apart from MUTT, of course, you need emacs and emacsclient, and a compatible system.
If you haven't got both of these excellent tools, you can download the latest version of emacs from ftp:
host: prep.ai.mit.edu directory: /pub/gnu/emacs file: emacs-M.N.tar.gz
'M' is the major version and 'N' is the minor version.
The rest of this guide assumes that you've installed emacs and emacsclient successfully, and that they are in your path. The guide is "optimized" (don't you just hate that word) for Unix. It is also a good idea to know a little bit about how to configure emacs, as I don't want to cover that topic in full. For more information, type C-h i (Control-h and then 'i') in emacs.
This is very simple. 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.
This is also very simple. All you have to do 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"
An alternative could be to change the environment variable EDITOR. In csh/tcsh you do this by editing .cshrc, and adding the following line (or modifying it):
setenv EDITOR emacsclient
In bash (.bashrc):
export EDITOR=emacsclient
That's all there is to it, really. You can also type the above at your command prompt for the same effect, but before starting MUTT.
There are a few things you need to be careful about, so read this carefully:
C-x #After typing that and answering 'y' to the question, MUTT regains control of the message.
(setq make-backup-files nil)
2004-06-10: Update for more recent versions of mutt and emacs 1996-12-20: Created.Jan Ingvoldstad