Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Cc: Eli Zaretskii <eliz@gnu.org>, ding@gnus.org, emacs-devel@gnu.org
Subject: Re: gnus / message-send-mail-with-mailclient [patch]
Date: Fri, 17 Mar 2006 18:10:44 +0100	[thread overview]
Message-ID: <v9oe053skr.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <553F677F-B2E1-42F3-8DBC-96734109EBA2@gmail.com> (David Reitter's message of "Fri, 17 Mar 2006 12:37:48 +0000")

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	other threads:[~2006-03-17 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <059BF802-B4EB-433E-AF78-024107CD7E16@gmail.com>
2006-03-16 21:27 ` Reiner Steib
2006-03-17  7:39   ` David Reitter
2006-03-17 11:33   ` Eli Zaretskii
2006-03-17 12:37     ` David Reitter
2006-03-17 17:10       ` Reiner Steib [this message]
2006-03-18 10:36         ` Eli Zaretskii
2006-03-18 11:44           ` Reiner Steib
     [not found]             ` <F30F0A45-1C1C-4FA8-96C1-FE5DE59A42FB@gmail.com>
2006-03-24 14:29               ` Reiner Steib
2006-03-24 17:15                 ` David Reitter
2006-03-24 20:29                   ` Kevin Rodgers
2006-03-26  9:35                     ` David Reitter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9oe053skr.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).