screen + mutt + emacs
Thanks to all who helped me sort this out. My current setup
integrates mutt, screen and emacs very nicely.
My .screenrc includes:
screen -t mutt 1 mutt
screen -t emacs 2 emacs -nw
In .muttrc, my editor is now set as:
set editor="screen -X select 2; emacsclient %s" # use emacs
In .emacs, I added:
;; mutt setup
(defun end-mail ()
(interactive)
(server-edit)
(shell-command "screen -X select 1"))
(defun my-mutt-mode ()
"Customized mutt mode"
(interactive)
(text-mode)
(auto-fill-mode)
(local-set-key "\C-xm" 'end-mail))
(setq auto-mode-alist (cons '("/tmp/mutt*" . my-mutt-mode) auto-mode-alist))
Now, when I edit mail in mutt, screen switches to emacs, loads text
mode, and turns on auto-fill. I can edit the file there. When I'm
done editing, C-x m ends the editing session and switches back to
mutt.
Thanks again for the help and I hope the above is useful.