(defun message-send-mail-function ()
"Return suitable value for the variable `message-send-mail-function'."
- (cond ((and (require 'sendmail)
- (boundp 'sendmail-program)
- sendmail-program
- (executable-find sendmail-program))
- 'message-send-mail-with-sendmail)
- ((and (locate-library "smtpmail")
- (boundp 'smtpmail-default-smtp-server)
- smtpmail-default-smtp-server)
- 'message-smtpmail-send-it)
- ((locate-library "mailclient")
- 'message-send-mail-with-mailclient)
+ (declare (obsolete nil "27.1"))
+ (require 'sendmail)
+ (defvar sendmail-program)
+ (cond ((executable-find sendmail-program)
+ #'message-send-mail-with-sendmail)
+ ((bound-and-true-p 'smtpmail-default-smtp-server)
+ #'message-smtpmail-send-it)
(t
- (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
+ #'message-send-mail-with-mailclient)))
(defun message-default-send-mail-function ()
- (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
- ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
- ((eq send-mail-function 'sendmail-query-once) 'sendmail-query-once)
- ((eq send-mail-function 'mailclient-send-it)
- 'message-send-mail-with-mailclient)
- (t (message-send-mail-function))))
+ (cond ((eq send-mail-function #'feedmail-send-it) #'feedmail-send-it)
+ ((eq send-mail-function #'sendmail-query-once) #'sendmail-query-once)
+ ((eq send-mail-function #'sendmail-send-it)
+ #'message-send-mail-with-sendmail)
+ (t #'message-use-send-mail-function)))
+
+(defun message--default-send-mail-function ()
+ "Use the setting of `send-mail-function' if applicable."
+ (funcall (message-default-send-mail-function)))
;; Useful to set in site-init.el
-(defcustom message-send-mail-function (message-default-send-mail-function)
+(defcustom message-send-mail-function #'message--default-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'.
`message-send-mail-function'.
See also `send-mail-function'."
- :type '(radio (function-item message-send-mail-with-sendmail)
+ :type '(radio (function-item message--default-send-mail-function
+ :tag "Use send-mail-function")
+ (function-item message-send-mail-with-sendmail)
(function-item message-send-mail-with-mh)
(function-item message-send-mail-with-qmail)
(function-item message-smtpmail-send-it)
:tag "Use Mailclient package")
(function :tag "Other"))
:group 'message-sending
- :version "23.2"
- :initialize 'custom-initialize-default
+ :version "27.1"
+ :initialize #'custom-initialize-default
:link '(custom-manual "(message)Mail Variables")
:group 'message-mail)
(const never)
(const ask)))
-(defcustom message-sendmail-f-is-evil nil
+(defcustom message-sendmail-f-is-evil
+ (if (boundp 'mail-specify-envelope-from)
+ (not mail-specify-envelope-from)
+ nil)
"Non-nil means don't add \"-f username\" to the sendmail command line.
Doing so would be even more evil than leaving it out."
:group 'message-sending
"Ask QUESTION, displaying remaining args in a temporary buffer if SHOW."
`(message-talkative-question 'y-or-n-p ,question ,show ,@text))
-(defmacro message-delete-line (&optional n)
+(defsubst message-delete-line (&optional n)
"Delete the current line (and the next N lines)."
- `(delete-region (progn (beginning-of-line) (point))
- (progn (forward-line ,(or n 1)) (point))))
+ (delete-region (progn (beginning-of-line) (point))
+ (progn (forward-line (or n 1)) (point))))
(defun message-mark-active-p ()
"Non-nil means the mark and region are currently active in this buffer."
(defmacro message-with-reply-buffer (&rest forms)
"Evaluate FORMS in the reply buffer, if it exists."
+ (declare (indent 0) (debug t))
`(when (buffer-live-p message-reply-buffer)
(with-current-buffer message-reply-buffer
,@forms)))
-(put 'message-with-reply-buffer 'lisp-indent-function 0)
-(put 'message-with-reply-buffer 'edebug-form-spec '(body))
-
(defun message-fetch-reply-field (header)
"Fetch field HEADER from the message we're replying to."
(message-with-reply-buffer
(defmacro message-check (type &rest forms)
"Eval FORMS if TYPE is to be checked."
+ (declare (indent 1) (debug t))
`(or (message-check-element ,type)
(save-excursion
,@forms)))
-(put 'message-check 'lisp-indent-function 1)
-(put 'message-check 'edebug-form-spec '(form body))
-
(defun message-text-with-property (prop &optional start end reverse)
"Return a list of start and end positions where the text has PROP.
START and END bound the search, they default to `point-min' and
;; Pass it on to mh.
(mh-send-letter)))
+(defun message-use-send-mail-function ()
+ (run-hooks 'message-send-mail-hook)
+ (funcall send-mail-function))
+
(defun message-smtpmail-send-it ()
"Send the prepared message buffer with `smtpmail-send-it'.
The only difference from `smtpmail-send-it' is that this command
evaluates `message-send-mail-hook' just before sending a message.
It is useful if your ISP requires the POP-before-SMTP
authentication. See the Gnus manual for details."
+ (declare (obsolete message-use-send-mail-function "27.1"))
(run-hooks 'message-send-mail-hook)
- ;; Change header-delimiter to be what smtpmail expects.
- (goto-char (point-min))
- (when (re-search-forward
- (concat "^" (regexp-quote mail-header-separator) "\n"))
- (replace-match "\n"))
(smtpmail-send-it))
(defun message-send-mail-with-mailclient ()
"Send the prepared message buffer with `mailclient-send-it'.
The only difference from `mailclient-send-it' is that this
command evaluates `message-send-mail-hook' just before sending a message."
+ (declare (obsolete message-use-send-mail-function "27.1"))
(run-hooks 'message-send-mail-hook)
(mailclient-send-it))
(message-check 'new-text
(or
(not message-checksum)
- (not (eq (message-checksum) message-checksum))
+ (not (equal (message-checksum) message-checksum))
(if (message-gnksa-enable-p 'quoted-text-only)
(y-or-n-p
"It looks like no new text has been added. Really post? ")
(repeat :tag "User defined list" gmm-tool-bar-item)
(symbol))
:version "23.1" ;; No Gnus
- :initialize 'custom-initialize-default
- :set 'message-tool-bar-update
+ :initialize #'custom-initialize-default
+ :set #'message-tool-bar-update
:group 'message)
(defcustom message-tool-bar-gnome
See `gmm-tool-bar-from-list' for details on the format of the list."
:type '(repeat gmm-tool-bar-item)
:version "23.1" ;; No Gnus
- :initialize 'custom-initialize-default
- :set 'message-tool-bar-update
+ :initialize #'custom-initialize-default
+ :set #'message-tool-bar-update
:group 'message)
(defcustom message-tool-bar-retro
See `gmm-tool-bar-from-list' for details on the format of the list."
:type '(repeat gmm-tool-bar-item)
:version "23.1" ;; No Gnus
- :initialize 'custom-initialize-default
- :set 'message-tool-bar-update
+ :initialize #'custom-initialize-default
+ :set #'message-tool-bar-update
:group 'message)
(defcustom message-tool-bar-zap-list
See `gmm-tool-bar-from-list' for the format of the list."
:type 'gmm-tool-bar-zap-list
:version "23.1" ;; No Gnus
- :initialize 'custom-initialize-default
- :set 'message-tool-bar-update
+ :initialize #'custom-initialize-default
+ :set #'message-tool-bar-update
:group 'message)
(defvar image-load-path)