[MERGE] Add mail-mode GNU Emacs mail package as a mail_client option.

Stephen J. Turnbull stephen at xemacs.org
Wed Mar 26 22:44:30 GMT 2008


Aaron Bentley writes:

 > > Look at it that way:
 > > 
 > > We should support several different ways of sending mail from
 > > Ubuntu because there exists several available MUAs.
 > 
 > Note that Ubuntu *does* provide a standard way of launching the user's
 > preferred mail client: xdg-email.  Windows and Mac also have ways of
 > launching the preferred mail client.
 > 
 > > Now replace Ubuntu by emacs.
 > 
 > If Emacs is an OS, why doesn't it have such a facility?

It does; for starting the mail reader there is a customizable "Read
Mail" menu item (although most users simply use M-x vm or M-x gnus,
etc), and for sending mail there is the `compose-mail' interface.[1]

IMO, the basic strategy should probably be to create an entry that
puts the desired mail text in a file and then invokes "emacs -f
compose-mail" and somehow imports the file into the mail buffer.
Please *do not* sanction `mail-mode', which really sucks in XEmacs,
and I gather doesn't support MIME yet even in Emacs.[2][3]  Problems
you'll run into:

1. Emacsen are heavy programs, and you'd want to use the Emacs client
   utility.  But these are different in Emacs (emacsclient) and XEmacs
   (gnuclient), and both XEmacs and Emacs have had separate clients
   for Windows installations at various times.  (This can be scripted
   around, of course.)  This may be fixed in Emacs 22, but I don't
   think so in XEmacs or in previous versions of Emacs.

2. AFAIK neither Emacs client is smart enough to start Emacs if it's
   not running.  (This can be scripted around, of course.)

3. compose-mail doesn't directly support this kind of interaction, and
   there are some other gotchas that may be waiting such as
   `mail-citation-hook' (you don't want an original message to be
   marked up as a quote!)  This might best be dealt with by a shim
   library say xdg-email.el, so that you can do

   emacs -l xdg-email -f xdg-email-compose -- XDG-EMAIL-ARG-1 ...

   or some terser, more magical variant of that.

 > I've seen lots of people claim that Emacs is a operating system, not an
 > editor.  But this is the first time I've seen an Emacs user admit it.

In the Emacs community, it goes without saying.

 > Bazaar shouldn't need its own facility.  It has one because:
 > 
 > - - xdg-utils isn't installed everywhere (62% of Ubuntu machines have it,
 >   according to popcon.ubuntu.com)
 > - - thunderbird is quirky, and supporting it directly seems to work best.

Emacs is quirky, too.  I doubt mail support will be sufficiently
quirkless to use a general facility.  XDG support in XEmacs is
currently nil, and AFAIK Emacs is not much better.



Footnotes: 
[1]  The reason for the asymmetry is that there is a split between
people who use the same MUA for reading news and mail and for sending
messages, while others use two or even three different applications.
It turns out that while sending a message is the same for almost all
user across news and mail, reader preferences vary wildly.  So there
isn't a configurable read-mail command.  Also, it's rare for another
application, whether Lisp or external, to invoke an Emacs MUA to read
mail or news.

[2]  Gnus users on either Emacsen would be quite upset to find
themselves anywhere other than `message-mode'.  XEmacs defines 4 mail
composition agents by default, and at least two others are available
from third parties.  All support MIME, and I believe all support
`compose-mail'.

[3]  There are add-on packages called tm and SEMI, both orphaned AFAIK,
which can be used to support MIME in mail-mode/Rmail.  Rmail users
also can try the third-party VM package, which has a basically similar
interface.  AFAICS, the primary reason for the continued existence of
Rmail is that the author of VM is an FSF-assignment refusenik, so
hard-core GNU people won't use VM for political/legal paranoia reasons.




More information about the bazaar mailing list