From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62290 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: gnus / message-send-mail-with-mailclient [patch] Date: Fri, 17 Mar 2006 18:10:44 +0100 Message-ID: References: <059BF802-B4EB-433E-AF78-024107CD7E16@gmail.com> <553F677F-B2E1-42F3-8DBC-96734109EBA2@gmail.com> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1142615498 27786 80.91.229.2 (17 Mar 2006 17:11:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Mar 2006 17:11:38 +0000 (UTC) Cc: Eli Zaretskii , ding@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 17 18:11:31 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FKITm-00070Y-3m for ged-emacs-devel@m.gmane.org; Fri, 17 Mar 2006 18:11:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FKITl-00082G-IY for ged-emacs-devel@m.gmane.org; Fri, 17 Mar 2006 12:11:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FKITZ-00080J-MX for emacs-devel@gnu.org; Fri, 17 Mar 2006 12:10:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FKITY-0007yj-EU for emacs-devel@gnu.org; Fri, 17 Mar 2006 12:10:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FKITY-0007yZ-9B for emacs-devel@gnu.org; Fri, 17 Mar 2006 12:10:56 -0500 Original-Received: from [134.60.1.1] (helo=mail.uni-ulm.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FKIYP-00067n-Dj; Fri, 17 Mar 2006 12:15:58 -0500 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.4/8.13.4) with ESMTP id k2HHAj6Q010943; Fri, 17 Mar 2006 18:10:46 +0100 (MET) Original-Received: by bridgekeeper.physik.uni-ulm.de (Postfix, from userid 170) id 69BDF114FB; Fri, 17 Mar 2006 18:10:45 +0100 (CET) Original-To: David Reitter Mail-Followup-To: David Reitter , Eli Zaretskii , ding@gnus.org, emacs-devel@gnu.org X-Face: 3Phac&+dw=IZHjhua]bp}LH<*p{qzj8u+ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51772 gmane.emacs.gnus.general:62290 Archived-At: 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/