emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnus / message-send-mail-with-mailclient [patch]


From: Reiner Steib
Subject: Re: gnus / message-send-mail-with-mailclient [patch]
Date: Fri, 17 Mar 2006 18:10:44 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

On Fri, Mar 17 2006, David Reitter wrote:

> On 17 Mar 2006, at 11:33, Eli Zaretskii wrote:
>>>
>>> +(defun message-send-mail-function ()
>>> +  "Return suitable value for the variable `message-send-mail- 
>
>>> function'."
>>> +  (cond ((and sendmail-program
>>> +         (executable-find program))

This should read (executable-find sendmail-program).

>>> +    'message-send-mail-with-sendmail)
>>> +   ((and (locate-library "mailclient")
>>> +         window-system
>>> +         (memq system-type '(darwin windows-nt)))
>>> +    'message-send-mail-with-mailclient)
>>> +   (t
>>> +    'message-smtpmail-send-it)))
>>
>> Why would you need to test that window-system is non-nil?  Perhaps I'm
>> missing something, but I don't see anything in mailclient.el that
>> would require an Emacs windowed display.  Can you explain?
>>
>> For that matter, why the test for system-type?  Won't it work on other
>> systems as well?

Until know I didn't look at `mailclient.el' because I though it would
use some Windows or Mac specific functionality.  But AFAICS, it only
delegates to `browse-url'.  I don't use neither Windows nor Mac, so I
don't know if this works more or less out of the box there.

On my system (GNU/Linux), "emacs -Q", (setq send-mail-function
'mailclient-send-it), `M-x mail RET' sends the message to mozilla.

How about the following?

--8<---------------cut here---------------start------------->8---
(defun message-send-mail-function ()
  "Return suitable value for the variable `message-send-mail-function'."
  (cond ((and sendmail-program
              (executable-find sendmail-program))
         'message-send-mail-with-sendmail)
        ((and (locate-library "smtpmail")
              (require 'smtpmail)
              smtpmail-default-smtp-server)
         'message-smtpmail-send-it)
        ((locate-library "mailclient")
         'message-send-mail-with-mailclient)
        (t
         (lambda ()
           (error "Don't know how to send mail.  Please customize 
`message-send-mail-function'.")))))
--8<---------------cut here---------------end--------------->8---

For the unbundled Gnus, we need to test if `smtpmail.el' (XEmacs) and
`mailclient.el' (Emacs 21, XEmacs) is available.

> It works fine from a shell (without a window-system) and on other
> systems (as long as the defined mail client, i.e. mailto:// URL
> handler doesn't require one).  That is, provided the function
> `message-send-mail-function' is only used to initialize the variable
> of the same name.

The function `message-send-mail-function' is only to avoid duplicate
code.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]