aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReiner Steib2007-11-20 20:12:53 +0000
committerReiner Steib2007-11-20 20:12:53 +0000
commit2ea6167b2d96f61f2e1a3a988aa0ad48da074d02 (patch)
tree98a66ddb7ec6431bf70761e9fca6419ddaab3286
parent798ae196dbf66afcb8829f7b52e96b6c1736e342 (diff)
downloademacs-2ea6167b2d96f61f2e1a3a988aa0ad48da074d02.tar.gz
emacs-2ea6167b2d96f61f2e1a3a988aa0ad48da074d02.zip
(message-send-mail-function): New function.
(message-send-mail-function): Set default using message-send-mail-function. Adjust doc string. (message-send-mail-with-mailclient): New function.
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/message.el47
2 files changed, 37 insertions, 17 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 212c0711169..c67eece640a 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12007-11-20 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * message.el (message-send-mail-function): New function.
4 (message-send-mail-function): Set default using
5 message-send-mail-function. Adjust doc string.
6 (message-send-mail-with-mailclient): New function.
7
12007-11-17 Richard Stallman <rms@gnu.org> 82007-11-17 Richard Stallman <rms@gnu.org>
2 9
3 * assistant.el: Remove file. 10 * assistant.el: Remove file.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 4ce4b8a01b2..66e14f0e091 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -50,6 +50,8 @@
50(require 'rfc822) 50(require 'rfc822)
51(require 'ecomplete) 51(require 'ecomplete)
52 52
53(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
54
53(defvar gnus-message-group-art) 55(defvar gnus-message-group-art)
54(defvar gnus-list-identifiers) ; gnus-sum is required where necessary 56(defvar gnus-list-identifiers) ; gnus-sum is required where necessary
55(defvar rmail-enable-mime-composing) 57(defvar rmail-enable-mime-composing)
@@ -619,28 +621,28 @@ Done before generating the new subject of a forward."
619 :link '(custom-manual "(message)Canceling News") 621 :link '(custom-manual "(message)Canceling News")
620 :type 'string) 622 :type 'string)
621 623
624(defun message-send-mail-function ()
625 "Return suitable value for the variable `message-send-mail-function'."
626 (cond ((and sendmail-program
627 (executable-find program))
628 'message-send-mail-with-sendmail)
629 ((and (locate-library "mailclient")
630 (memq system-type '(darwin windows-nt)))
631 'message-send-mail-with-mailclient)
632 (t
633 'message-smtpmail-send-it)))
634
622;; Useful to set in site-init.el 635;; Useful to set in site-init.el
623(defcustom message-send-mail-function 636(defcustom message-send-mail-function (message-send-mail-function)
624 (let ((program (if (boundp 'sendmail-program)
625 ;; see paths.el
626 sendmail-program)))
627 (cond
628 ((and program
629 (string-match "/" program) ;; Skip path
630 (file-executable-p program))
631 'message-send-mail-with-sendmail)
632 ((and program
633 (executable-find program))
634 'message-send-mail-with-sendmail)
635 (t
636 'smtpmail-send-it)))
637 "Function to call to send the current buffer as mail. 637 "Function to call to send the current buffer as mail.
638The headers should be delimited by a line whose contents match the 638The headers should be delimited by a line whose contents match the
639variable `mail-header-separator'. 639variable `mail-header-separator'.
640 640
641Valid values include `message-send-mail-with-sendmail' (the default), 641Valid values include `message-send-mail-with-sendmail'
642`message-send-mail-with-mh', `message-send-mail-with-qmail', 642`message-send-mail-with-mh', `message-send-mail-with-qmail',
643`message-smtpmail-send-it', `smtpmail-send-it' and `feedmail-send-it'. 643`message-smtpmail-send-it', `smtpmail-send-it',
644`feedmail-send-it' and `message-send-mail-with-mailclient'. The
645default is system dependent.
644 646
645See also `send-mail-function'." 647See also `send-mail-function'."
646 :type '(radio (function-item message-send-mail-with-sendmail) 648 :type '(radio (function-item message-send-mail-with-sendmail)
@@ -649,8 +651,12 @@ See also `send-mail-function'."
649 (function-item message-smtpmail-send-it) 651 (function-item message-smtpmail-send-it)
650 (function-item smtpmail-send-it) 652 (function-item smtpmail-send-it)
651 (function-item feedmail-send-it) 653 (function-item feedmail-send-it)
652 (function :tag "Other")) 654 (function :tag "Other")
655 (function-item message-send-mail-with-mailclient
656 :tag "Use Mailclient package")
657 (function :tag "Other"))
653 :group 'message-sending 658 :group 'message-sending
659 :initialize 'custom-initialize-default
654 :link '(custom-manual "(message)Mail Variables") 660 :link '(custom-manual "(message)Mail Variables")
655 :group 'message-mail) 661 :group 'message-mail)
656 662
@@ -4528,6 +4534,13 @@ manual for details."
4528 (run-hooks 'message-send-mail-hook) 4534 (run-hooks 'message-send-mail-hook)
4529 (smtpmail-send-it)) 4535 (smtpmail-send-it))
4530 4536
4537(defun message-send-mail-with-mailclient ()
4538 "Send the prepared message buffer with `mailclient-send-it'.
4539This only differs from `smtpmail-send-it' that this command evaluates
4540`message-send-mail-hook' just before sending a message."
4541 (run-hooks 'message-send-mail-hook)
4542 (mailclient-send-it))
4543
4531(defun message-canlock-generate () 4544(defun message-canlock-generate ()
4532 "Return a string that is non-trivial to guess. 4545 "Return a string that is non-trivial to guess.
4533Do not use this for anything important, it is cryptographically weak." 4546Do not use this for anything important, it is cryptographically weak."