emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/gnus/message.el,v


From: Reiner Steib
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/message.el,v
Date: Tue, 20 Nov 2007 20:12:54 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Reiner Steib <rsteib>   07/11/20 20:12:53

Index: message.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/message.el,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -b -r1.128 -r1.129
--- message.el  16 Nov 2007 16:50:33 -0000      1.128
+++ message.el  20 Nov 2007 20:12:52 -0000      1.129
@@ -50,6 +50,8 @@
 (require 'rfc822)
 (require 'ecomplete)
 
+(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
+
 (defvar gnus-message-group-art)
 (defvar gnus-list-identifiers) ; gnus-sum is required where necessary
 (defvar rmail-enable-mime-composing)
@@ -619,28 +621,28 @@
   :link '(custom-manual "(message)Canceling News")
   :type 'string)
 
-;; Useful to set in site-init.el
-(defcustom message-send-mail-function
-  (let ((program (if (boundp 'sendmail-program)
-                    ;; see paths.el
-                    sendmail-program)))
-    (cond
-     ((and program
-          (string-match "/" program) ;; Skip path
-          (file-executable-p program))
-      'message-send-mail-with-sendmail)
-     ((and program
+(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")
+             (memq system-type '(darwin windows-nt)))
+        'message-send-mail-with-mailclient)
      (t
-      'smtpmail-send-it)))
+        'message-smtpmail-send-it)))
+
+;; Useful to set in site-init.el
+(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)
@@ -649,8 +651,12 @@
                (function-item message-smtpmail-send-it)
                (function-item smtpmail-send-it)
                (function-item feedmail-send-it)
+               (function :tag "Other")
+               (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)
 
@@ -4528,6 +4534,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."




reply via email to

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