Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: gnus / message-send-mail-with-mailclient [patch]
Date: Thu, 16 Mar 2006 22:27:43 +0100	[thread overview]
Message-ID: <v9wteuqdv4.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <059BF802-B4EB-433E-AF78-024107CD7E16@gmail.com> (David Reitter's message of "Thu, 9 Feb 2006 12:06:50 +0000")

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On Thu, Feb 09 2006, David Reitter wrote:

> The send-mail-function defined specifically for the message package  
> doesn't work on systems where no sendmail is running.
> That's why we added the `mailclient' package a while ago.

`message.el' is supposed to work with Emacs 21 as well.  Do you know
whether `mailclient.el' works with Emacs 21?

> The patch below fixes the problem analogous to what has been done in
> the `sendmail' package.

Your patch contains several unrelated changes (make-frame-visible),
wrapped lines and mixed context/unified hunks which makes is hard to
read and to apply.

How about the attached patch.  It includes some additional checks
(partly taken from `message.el' in the development version of Gnus).

I'm not sure (and I can't test) if
  (custom-reevaluate-setting 'message-send-mail-function)
in `startup.el' is necessary.

Bye, Reiner.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rs-message-send-mail-function.patch --]
[-- Type: text/x-patch, Size: 3160 bytes --]

Index: message.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/message.el,v
retrieving revision 1.102
diff -u -r1.102 message.el
--- message.el	24 Feb 2006 05:02:12 -0000	1.102
+++ message.el	16 Mar 2006 21:09:33 -0000
@@ -48,6 +48,7 @@
 (require 'mml)
 (require 'rfc822)
 (eval-and-compile
+  (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
   (autoload 'gnus-find-method-for-group "gnus")
   (autoload 'nnvirtual-find-group-art "nnvirtual")
   (autoload 'gnus-group-decoded-name "gnus-group"))
@@ -584,16 +585,37 @@
   :link '(custom-manual "(message)Canceling News")
   :type 'string)
 
+(defun message-send-mail-function ()
+  "Return suitable value for the variable `message-send-mail-function'."
+  (cond ((and sendmail-program
+	      (executable-find 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)))
+
+;; Prevent problems with `window-system' not having the correct value
+;; when loaddefs.el is loaded. `custom-reevaluate-setting' needs the
+;; standard value.
+;;;###autoload
+(put 'message-send-mail-function 'standard-value
+     '((message-send-mail-function)))
+
 ;; Useful to set in site-init.el
 ;;;###autoload
-(defcustom message-send-mail-function 'message-send-mail-with-sendmail
+(defcustom message-send-mail-function (message-send-mail-function)
   "Function to call to send the current buffer as mail.
 The headers should be delimited by a line whose contents match the
 variable `mail-header-separator'.
 
-Valid values include `message-send-mail-with-sendmail' (the default),
+Valid values include `message-send-mail-with-sendmail',
 `message-send-mail-with-mh', `message-send-mail-with-qmail',
-`message-smtpmail-send-it', `smtpmail-send-it' and `feedmail-send-it'.
+`message-smtpmail-send-it', `smtpmail-send-it',
+`feedmail-send-it' and `message-send-mail-with-mailclient'.  The
+default is system dependent.
 
 See also `send-mail-function'."
   :type '(radio (function-item message-send-mail-with-sendmail)
@@ -602,8 +624,11 @@
 		(function-item message-smtpmail-send-it)
 		(function-item smtpmail-send-it)
 		(function-item feedmail-send-it)
+		(function-item message-send-mail-with-mailclient
+			       :tag "Use Mailclient package")
 		(function :tag "Other"))
   :group 'message-sending
+  :initialize 'custom-initialize-default
   :link '(custom-manual "(message)Mail Variables")
   :group 'message-mail)
 
@@ -3982,6 +4007,13 @@
   (run-hooks 'message-send-mail-hook)
   (smtpmail-send-it))
 
+(defun message-send-mail-with-mailclient ()
+  "Send the prepared message buffer with `mailclient-send-it'.
+This only differs from `smtpmail-send-it' that this command evaluates
+`message-send-mail-hook' just before sending a message."
+  (run-hooks 'message-send-mail-hook)
+  (mailclient-send-it))
+
 (defun message-canlock-generate ()
   "Return a string that is non-trivial to guess.
 Do not use this for anything important, it is cryptographically weak."

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

       reply	other threads:[~2006-03-16 21:27 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 [this message]
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
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=v9wteuqdv4.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.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).