emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master f7cf919: * lisp/mail/sendmail.el (sendmail-send-it)


From: Stefan Monnier
Subject: [Emacs-diffs] master f7cf919: * lisp/mail/sendmail.el (sendmail-send-it): Add FIXMEs.
Date: Tue, 30 Jul 2019 16:14:14 -0400 (EDT)

branch: master
commit f7cf9199abf53ed17a751e995e519488bb0b591b
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/mail/sendmail.el (sendmail-send-it): Add FIXMEs.
    
    Remove redundant :groups in the file, as well.
---
 lisp/mail/sendmail.el | 100 +++++++++++++++++++-------------------------------
 1 file changed, 37 insertions(+), 63 deletions(-)

diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 291efab..1da33a4 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -39,7 +39,6 @@
 (defcustom mail-setup-with-from t
   "Non-nil means insert `From:' field when setting up the message."
   :type 'boolean
-  :group 'sendmail
   :version "22.1")
 
 (defcustom sendmail-program
@@ -51,7 +50,6 @@
        (t "sendmail")))
   "Program used to send messages."
   :version "24.1"              ; add executable-find, remove fakemail
-  :group 'mail
   :type 'file)
 
 ;;;###autoload
@@ -72,8 +70,7 @@ Otherwise, most addresses look like `angles', but they look 
like
                 (const parens)
                 (const angles)
                 (const default))
-  :version "27.1"
-  :group 'sendmail)
+  :version "27.1")
 (make-obsolete-variable
  'mail-from-style
  "only the `angles' value is valid according to RFC2822." "27.1" 'set)
@@ -89,8 +86,7 @@ privileged operation.  This variable affects sendmail and
 smtpmail -- if you use feedmail to send mail, see instead the
 variable `feedmail-deduce-envelope-from'."
   :version "21.1"
-  :type 'boolean
-  :group 'sendmail)
+  :type 'boolean)
 
 (defcustom mail-envelope-from nil
   "If non-nil, designate the envelope-from address when sending mail.
@@ -102,16 +98,14 @@ being sent is used), or nil (in which case the value of
   :version "21.1"
   :type '(choice (string :tag "From-name")
                 (const :tag "Use From: header from message" header)
-                (const :tag "Use `user-mail-address'" nil))
-  :group 'sendmail)
+                (const :tag "Use `user-mail-address'" nil)))
 
 ;;;###autoload
 (defcustom mail-self-blind nil
   "Non-nil means insert Bcc to self in messages to be sent.
 This is done when the message is initialized,
 so you can remove or alter the Bcc field to override the default."
-  :type 'boolean
-  :group 'sendmail)
+  :type 'boolean)
 
 ;;;###autoload
 (defcustom mail-interactive t
@@ -122,8 +116,7 @@ so you can remove or alter the Bcc field to override the 
default."
   "Non-nil means when sending a message wait for and display errors.
 Otherwise, let mailer send back a message to report errors."
   :type 'boolean
-  :version "23.1"                      ; changed from nil to t
-  :group 'sendmail)
+  :version "23.1")                     ; changed from nil to t
 
 (defcustom mail-yank-ignored-headers
   (concat "^"
@@ -138,7 +131,6 @@ Otherwise, let mailer send back a message to report errors."
           ":")
   "Delete these headers from old message when it's inserted in a reply."
   :type 'regexp
-  :group 'sendmail
   :version "23.1")
 
 ;; Useful to set in site-init.el
@@ -147,7 +139,7 @@ Otherwise, let mailer send back a message to report errors."
   ;; Assume smtpmail is the preferred choice if it's already configured.
   (if (and (boundp 'smtpmail-smtp-server)
            smtpmail-smtp-server)
-      'smtpmail-send-it 'sendmail-query-once)
+      #'smtpmail-send-it #'sendmail-query-once)
   "Function to call to send the current buffer as mail.
 The headers should be delimited by a line which is
 not a valid RFC 822 (or later) header or continuation line,
@@ -160,14 +152,12 @@ This is used by the default mail-sending commands.  See 
also
                (function-item feedmail-send-it :tag "Use Feedmail package")
                (function-item mailclient-send-it :tag "Use Mailclient package")
                function)
-  :version "24.1"
-  :group 'sendmail)
+  :version "24.1")
 
 ;;;###autoload
 (defcustom mail-header-separator (purecopy "--text follows this line--")
   "Line used to separate headers from text in messages being composed."
-  :type 'string
-  :group 'sendmail)
+  :type 'string)
 
 ;; Set up mail-header-separator for use as a category text property.
 (put 'mail-header-separator 'rear-nonsticky '(category))
@@ -183,16 +173,14 @@ This is used by the default mail-sending commands.  See 
also
   "Name of file to write all outgoing messages in, or nil for none.
 This is normally an mbox file, but for backwards compatibility may also
 be a Babyl file."
-  :type '(choice file (const nil))
-  :group 'sendmail)
+  :type '(choice file (const nil)))
 
 ;;;###autoload
 (defcustom mail-default-reply-to nil
   "Address to insert as default Reply-To field of outgoing messages.
 If nil, it will be initialized from the REPLYTO environment variable
 when you first send mail."
-  :type '(choice (const nil) string)
-  :group 'sendmail)
+  :type '(choice (const nil) string))
 
 (defcustom mail-alias-file nil
   "If non-nil, the name of a file to use instead of the sendmail default.
@@ -201,8 +189,7 @@ feature from that of defining aliases in `.mailrc' to be 
expanded in Emacs.
 This variable has no effect unless your system uses sendmail as its mailer.
 The default file is defined in sendmail's configuration file, e.g.
 `/etc/aliases'."
-  :type '(choice (const :tag "Sendmail default" nil) file)
-  :group 'sendmail)
+  :type '(choice (const :tag "Sendmail default" nil) file))
 
 ;;;###autoload
 (defcustom mail-personal-alias-file (purecopy "~/.mailrc")
@@ -210,15 +197,13 @@ The default file is defined in sendmail's configuration 
file, e.g.
 This file typically should be in same format as the `.mailrc' file used by
 the `Mail' or `mailx' program.
 This file need not actually exist."
-  :type '(choice (const nil) file)
-  :group 'sendmail)
+  :type '(choice (const nil) file))
 
 ;;;###autoload
 (defcustom mail-setup-hook nil
   "Normal hook, run each time a new outgoing message is initialized."
   :type 'hook
-  :options '(fortune-to-signature spook mail-abbrevs-setup)
-  :group 'sendmail)
+  :options '(fortune-to-signature spook mail-abbrevs-setup))
 
 ;;;###autoload
 (defvar mail-aliases t
@@ -236,15 +221,13 @@ The alias definitions in the file have this form:
 (defcustom mail-yank-prefix "> "
   "Prefix insert on lines of yanked message being replied to.
 If this is nil, use indentation, as specified by `mail-indentation-spaces'."
-  :type '(choice (const nil) string)
-  :group 'sendmail)
+  :type '(choice (const nil) string))
 
 ;;;###autoload
 (defcustom mail-indentation-spaces 3
   "Number of spaces to insert at the beginning of each cited line.
 Used by `mail-yank-original' via `mail-indent-citation'."
-  :type 'integer
-  :group 'sendmail)
+  :type 'integer)
 
 ;;;###autoload
 (defcustom mail-citation-hook nil
@@ -257,8 +240,7 @@ in the cited portion of the message.
 
 If this hook is entirely empty (nil), a default action is taken
 instead of no action."
-  :type 'hook
-  :group 'sendmail)
+  :type 'hook)
 
 (defvar mail-citation-header nil
   "While running `mail-citation-hook', this variable holds the message header.
@@ -273,7 +255,6 @@ It should match whatever sort of citation prefixes you want 
to handle,
 with whitespace before and after; it should also match just whitespace.
 The default value matches citations like `foo-bar>' plus whitespace."
   :type 'regexp
-  :group 'sendmail
   :version "24.1")
 
 (defvar mail-abbrevs-loaded nil)
@@ -380,15 +361,13 @@ and should insert whatever you want to insert."
   :type '(choice (const :tag "None" nil)
                 (const :tag "Use `.signature' file" t)
                 (string :tag "String to insert")
-                (sexp :tag "Expression to evaluate"))
-  :group 'sendmail)
+                (sexp :tag "Expression to evaluate")))
 (put 'mail-signature 'risky-local-variable t)
 
 ;;;###autoload
 (defcustom mail-signature-file (purecopy "~/.signature")
   "File containing the text inserted at end of mail buffer."
-  :type 'file
-  :group 'sendmail)
+  :type 'file)
 
 ;;;###autoload
 (defcustom mail-default-directory (purecopy "~/")
@@ -398,7 +377,6 @@ This directory is used for auto-save files of Mail mode 
buffers.
 Note that Message mode does not use this variable; it auto-saves
 in `message-auto-save-directory'."
   :type '(directory :tag "Directory")
-  :group 'sendmail
   :version "22.1")
 
 (defvar mail-reply-action nil)
@@ -411,16 +389,14 @@ in `message-auto-save-directory'."
   "A string containing header lines, to be inserted in outgoing messages.
 It can contain newlines, and should end in one.  It is inserted
 before you edit the message, so you can edit or delete the lines."
-  :type '(choice (const nil) string)
-  :group 'sendmail)
+  :type '(choice (const nil) string))
 
 (defcustom mail-bury-selects-summary t
   "If non-nil, try to show Rmail summary buffer after returning from mail.
 The functions \\[mail-send-on-exit] or \\[mail-dont-send] select
 the Rmail summary buffer before returning, if it exists and this variable
 is non-nil."
-  :type 'boolean
-  :group 'sendmail)
+  :type 'boolean)
 
 (defcustom mail-send-nonascii 'mime
   "Specify whether to allow sending non-ASCII characters in mail.
@@ -430,14 +406,12 @@ If t, that means do allow it.  nil means don't allow it.
 The default is `mime'.
 Including non-ASCII characters in a mail message can be problematical
 for the recipient, who may not know how to decode them properly."
-  :type '(choice (const t) (const nil) (const query) (const mime))
-  :group 'sendmail)
+  :type '(choice (const t) (const nil) (const query) (const mime)))
 
 (defcustom mail-use-dsn nil
   "Ask MTA for notification of failed, delayed or successful delivery.
 Note that only some MTAs (currently only recent versions of Sendmail)
 support Delivery Status Notification."
-  :group 'sendmail
   :type '(repeat (radio (const :tag "Failure" failure)
                        (const :tag "Delay" delay)
                        (const :tag "Success" success)))
@@ -506,7 +480,7 @@ This also saves the value of `send-mail-function' via 
Customize."
   ;; If send-mail-function is already setup, we're incorrectly called
   ;; a second time, probably because someone's using an old value
   ;; of send-mail-function.
-  (if (not (eq send-mail-function 'sendmail-query-once))
+  (if (not (eq send-mail-function #'sendmail-query-once))
       (funcall send-mail-function)
     (let ((function (sendmail-query-user-about-smtp)))
       (funcall function)
@@ -571,8 +545,8 @@ This also saves the value of `send-mail-function' via 
Customize."
 
 ;;;###autoload
 (define-mail-user-agent 'sendmail-user-agent
-  'sendmail-user-agent-compose
-  'mail-send-and-exit)
+  #'sendmail-user-agent-compose
+  #'mail-send-and-exit)
 
 ;;;###autoload
 (defun sendmail-user-agent-compose (&optional to subject other-headers
@@ -687,7 +661,6 @@ This also saves the value of `send-mail-function' via 
Customize."
   "Hook run by Mail mode.
 When composing a mail, this runs immediately after creating, or
 switching to, the `*mail*' buffer.  See also `mail-setup-hook'."
-  :group 'sendmail
   :type 'hook
   :options '(footnote-mode))
 
@@ -724,10 +697,8 @@ Turning on Mail mode runs the normal hooks 
`text-mode-hook' and
   (make-local-variable 'font-lock-defaults)
   (setq font-lock-defaults '(mail-font-lock-keywords t t))
   (make-local-variable 'paragraph-separate)
-  (make-local-variable 'normal-auto-fill-function)
-  (setq normal-auto-fill-function 'mail-mode-auto-fill)
-  (make-local-variable 'fill-paragraph-function)
-  (setq fill-paragraph-function 'mail-mode-fill-paragraph)
+  (setq-local normal-auto-fill-function #'mail-mode-auto-fill)
+  (setq-local fill-paragraph-function #'mail-mode-fill-paragraph)
   ;; Allow using comment commands to add/remove quoting (this only does
   ;; anything if mail-yank-prefix is set to a non-nil value).
   (set (make-local-variable 'comment-start) mail-yank-prefix)
@@ -880,16 +851,14 @@ Prefix arg means don't delete this window."
 (defcustom mail-send-hook nil
   "Hook run just before sending a message."
   :type 'hook
-  :options '(flyspell-mode-off)
-  :group 'sendmail)
+  :options '(flyspell-mode-off))
 
 ;;;###autoload
 (defcustom mail-mailing-lists nil
 "List of mailing list addresses the user is subscribed to.
 The variable is used to trigger insertion of the \"Mail-Followup-To\"
 header when sending a message to a mailing list."
-  :type '(repeat string)
-  :group 'sendmail)
+  :type '(repeat string))
 
 (declare-function mml-to-mime "mml" ())
 
@@ -938,7 +907,7 @@ the user from the mailer."
                                  (push e l)))
                             (split-string new-header-values
                                           ",[[:space:]]+" t))
-                           (mapconcat 'identity l ", "))
+                           (mapconcat #'identity l ", "))
                          "\n"))
                ;; Add Mail-Reply-To if none yet
                (unless (mail-fetch-field "mail-reply-to")
@@ -1185,6 +1154,9 @@ Return non-nil if and only if some part of the header is 
encoded."
 This is a suitable value for `send-mail-function'.  It sends using the
 external program defined by `sendmail-program'."
   (require 'mail-utils)
+  ;; FIXME: A lot of the work done here seems out-of-place (e.g. it should
+  ;; happen regardless of the method used to send, whether via SMTP of
+  ;; /usr/bin/sendmail or anything else).
   (let ((errbuf (if mail-interactive
                    (generate-new-buffer " sendmail errors")
                  0))
@@ -1222,6 +1194,8 @@ external program defined by `sendmail-program'."
              (expand-mail-aliases (point-min) delimline))
          (goto-char (point-min))
          ;; Ignore any blank lines in the header
+          ;; FIXME: mail-header-end should have stopped at an empty line,
+          ;; so the regexp below should never match before delimline!
          (while (and (re-search-forward "\n\n\n*" delimline t)
                      (< (point) delimline))
            (replace-match "\n"))
@@ -1346,11 +1320,11 @@ external program defined by `sendmail-program'."
                                  '("-t")
                                  )
                              (if mail-use-dsn
-                                 (list "-N" (mapconcat 'symbol-name
+                                 (list "-N" (mapconcat #'symbol-name
                                                        mail-use-dsn ",")))
                              )
                      )
-                    (exit-value (apply 'call-process-region args)))
+                    (exit-value (apply #'call-process-region args)))
                (cond ((or (null exit-value) (eq 0 exit-value)))
                      ((numberp exit-value)
                        (setq error t)
@@ -1818,7 +1792,7 @@ If the current line has `mail-yank-prefix', insert it on 
the new line."
       (or (bolp) (newline))
       (goto-char start))))
 
-(define-obsolete-function-alias 'mail-attach-file 'mail-insert-file "24.1")
+(define-obsolete-function-alias 'mail-attach-file #'mail-insert-file "24.1")
 
 (declare-function mml-attach-file "mml"
                  (file &optional type description disposition))



reply via email to

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