
Integrating Mapil with (X)Emacs
-------------------------------

	I think there are a number of mailers that are run from inside
Emacs.  I have only examined mh-e, but you may be able to use or adapt
some of the code in this directory.  Emacs is very configurable, so
probably a only elisp stands between you and seamless integration.


		Encoding messages
		-----------------

	The function mapil-encode in mapil-encoding.el can be used to
call mapil on the current emacs buffer.  I put this code in my .emacs
file.  In Mh-e the buffer is the raw message type that Mapil uses, but
it may not be in other mailers.

	Mapil is run in another buffer using the 'shell' command.  If
you want to run Mapil with different options, you should edit the
elisp code.  The

(setq comint-password-prompt-regexp "\\(\\([Oo]ld \\|[Nn]ew \\|^\\)[Pp]assword\\|pass phrase\\|Passphrase\\):\\s *\\'")

line is so emacs will not show your passphrase.  When you enter shell
mode, Control-c Control-m is bound to the function mapil-return.
mapil-return kills the current buffer (the buffer mapil was run in),
presumably returning to the message buffer.  It then reverts the
buffer so you can see what Mapil did.

	I bind mapil-encode to Control-c Control-m so when I want to
process a message with Mapil, I press those keys.  When Mapil is done
and I have finished reading its output, I press Control-c Control-m
again to look at my processed message.

	At least for me, this is a pretty convenient solution.
However, if you use a non-default shell, you should edit mapil-return
so it restores the right value.  


		Decoding messages
		-----------------

	I only use Emacs (actually XEmacs) for encoding messages, so I
haven't written any code for decoding.  It seems, however, that a very
similar solution could work for decoding.  Please, send me code!

