Synch to No Gnus 200409302052.
[elisp/gnus.git-] / lisp / message.el
index c6f2844..438e637 100644 (file)
@@ -40,7 +40,8 @@
   (require 'cl)
   (require 'smtp)
   (defvar gnus-message-group-art)
   (require 'cl)
   (require 'smtp)
   (defvar gnus-message-group-art)
-  (defvar gnus-list-identifiers)) ; gnus-sum is required where necessary
+  (defvar gnus-list-identifiers) ; gnus-sum is required where necessary
+  (require 'hashcash))
 (require 'canlock)
 (require 'mailheader)
 (require 'nnheader)
 (require 'canlock)
 (require 'mailheader)
 (require 'nnheader)
@@ -158,6 +159,7 @@ mailbox format."
 
 (defcustom message-fcc-externalize-attachments nil
   "If non-nil, attachments are included as external parts in Fcc copies."
 
 (defcustom message-fcc-externalize-attachments nil
   "If non-nil, attachments are included as external parts in Fcc copies."
+  :version "21.4"
   :type 'boolean
   :group 'message-sending)
 
   :type 'boolean
   :group 'message-sending)
 
@@ -191,6 +193,7 @@ the user what do do.  In this case, the subject is matched against
 `message-subject-trailing-was-query' is t, always strip the trailing
 old subject.  In this case, `message-subject-trailing-was-regexp' is
 used."
 `message-subject-trailing-was-query' is t, always strip the trailing
 old subject.  In this case, `message-subject-trailing-was-regexp' is
 used."
+  :version "21.4"
   :type '(choice (const :tag "never" nil)
                 (const :tag "always strip" t)
                  (const ask))
   :type '(choice (const :tag "never" nil)
                 (const :tag "always strip" t)
                  (const ask))
@@ -207,6 +210,7 @@ the variable is t instead of `ask', use
 `message-subject-trailing-was-regexp' instead.
 
 It is okay to create some false positives here, as the user is asked."
 `message-subject-trailing-was-regexp' instead.
 
 It is okay to create some false positives here, as the user is asked."
+  :version "21.4"
   :group 'message-various
   :link '(custom-manual "(message)Message Headers")
   :type 'regexp)
   :group 'message-various
   :link '(custom-manual "(message)Message Headers")
   :type 'regexp)
@@ -219,6 +223,7 @@ If `message-subject-trailing-was-query' is set to t, the subject is
 matched against `message-subject-trailing-was-regexp' in
 `message-strip-subject-trailing-was'.  You should use a regexp creating very
 few false positives here."
 matched against `message-subject-trailing-was-regexp' in
 `message-strip-subject-trailing-was'.  You should use a regexp creating very
 few false positives here."
+  :version "21.4"
   :group 'message-various
   :link '(custom-manual "(message)Message Headers")
   :type 'regexp)
   :group 'message-various
   :link '(custom-manual "(message)Message Headers")
   :type 'regexp)
@@ -231,6 +236,7 @@ few false positives here."
 (defcustom message-mark-insert-begin
   "--8<---------------cut here---------------start------------->8---\n"
   "How to mark the beginning of some inserted text."
 (defcustom message-mark-insert-begin
   "--8<---------------cut here---------------start------------->8---\n"
   "How to mark the beginning of some inserted text."
+  :version "21.4"
   :type 'string
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-various)
   :type 'string
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-various)
@@ -239,6 +245,7 @@ few false positives here."
 (defcustom message-mark-insert-end
   "--8<---------------cut here---------------end--------------->8---\n"
   "How to mark the end of some inserted text."
 (defcustom message-mark-insert-end
   "--8<---------------cut here---------------end--------------->8---\n"
   "How to mark the end of some inserted text."
+  :version "21.4"
   :type 'string
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-various)
   :type 'string
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-various)
@@ -248,6 +255,7 @@ few false positives here."
   "X-No-Archive: Yes\n"
   "Header to insert when you don't want your article to be archived.
 Archives \(such as groups.google.com\) respect this header."
   "X-No-Archive: Yes\n"
   "Header to insert when you don't want your article to be archived.
 Archives \(such as groups.google.com\) respect this header."
+  :version "21.4"
   :type 'string
   :link '(custom-manual "(message)Header Commands")
   :group 'message-various)
   :type 'string
   :link '(custom-manual "(message)Header Commands")
   :group 'message-various)
@@ -257,6 +265,7 @@ Archives \(such as groups.google.com\) respect this header."
   "X-No-Archive: Yes - save http://groups.google.com/"
   "Note to insert why you wouldn't want this posting archived.
 If nil, don't insert any text in the body."
   "X-No-Archive: Yes - save http://groups.google.com/"
   "Note to insert why you wouldn't want this posting archived.
 If nil, don't insert any text in the body."
+  :version "21.4"
   :type '(radio (string :format "%t: %v\n" :size 0)
                (const nil))
   :link '(custom-manual "(message)Header Commands")
   :type '(radio (string :format "%t: %v\n" :size 0)
                (const nil))
   :link '(custom-manual "(message)Header Commands")
@@ -276,6 +285,7 @@ If nil, don't insert any text in the body."
 If nil, `message-cross-post-followup-to' will only do a followup.  Note that
 you can explicitly override this setting by calling
 `message-cross-post-followup-to' with a prefix."
 If nil, `message-cross-post-followup-to' will only do a followup.  Note that
 you can explicitly override this setting by calling
 `message-cross-post-followup-to' with a prefix."
+  :version "21.4"
   :type 'boolean
   :group 'message-various)
 
   :type 'boolean
   :group 'message-various)
 
@@ -283,6 +293,7 @@ you can explicitly override this setting by calling
 (defcustom message-cross-post-note
   "Crosspost & Followup-To: "
   "Note to insert before signature to notify of xpost and follow-up."
 (defcustom message-cross-post-note
   "Crosspost & Followup-To: "
   "Note to insert before signature to notify of xpost and follow-up."
+  :version "21.4"
   :type 'string
   :group 'message-various)
 
   :type 'string
   :group 'message-various)
 
@@ -290,6 +301,7 @@ you can explicitly override this setting by calling
 (defcustom message-followup-to-note
   "Followup-To: "
   "Note to insert before signature to notify of follow-up only."
 (defcustom message-followup-to-note
   "Followup-To: "
   "Note to insert before signature to notify of follow-up only."
+  :version "21.4"
   :type 'string
   :group 'message-various)
 
   :type 'string
   :group 'message-various)
 
@@ -300,6 +312,7 @@ you can explicitly override this setting by calling
 The function will be called with four arguments.  The function should not only
 insert a note, but also ensure old notes are deleted.  See the documentation
 for `message-cross-post-insert-note'."
 The function will be called with four arguments.  The function should not only
 insert a note, but also ensure old notes are deleted.  See the documentation
 for `message-cross-post-insert-note'."
+  :version "21.4"
   :type 'function
   :group 'message-various)
 
   :type 'function
   :group 'message-various)
 
@@ -326,7 +339,7 @@ Otherwise, most addresses look like `angles', but they look like
 
 (defcustom message-insert-canlock t
   "Whether to insert a Cancel-Lock header in news postings."
 
 (defcustom message-insert-canlock t
   "Whether to insert a Cancel-Lock header in news postings."
-  :version "21.3"
+  :version "21.4"
   :group 'message-headers
   :type 'boolean)
 
   :group 'message-headers
   :type 'boolean)
 
@@ -355,6 +368,7 @@ Checks include `subject-cmsg', `multiple-headers', `sendsys',
   "*Headers to be generated or prompted for when sending a message.
 Also see `message-required-news-headers' and
 `message-required-mail-headers'."
   "*Headers to be generated or prompted for when sending a message.
 Also see `message-required-news-headers' and
 `message-required-mail-headers'."
+  :version "21.4"
   :group 'message-news
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
   :group 'message-news
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
@@ -362,6 +376,7 @@ Also see `message-required-news-headers' and
 
 (defcustom message-draft-headers '(References From)
   "*Headers to be generated when saving a draft message."
 
 (defcustom message-draft-headers '(References From)
   "*Headers to be generated when saving a draft message."
+  :version "21.4"
   :group 'message-news
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
   :group 'message-news
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
@@ -783,6 +798,7 @@ is never used."
 If nil, always ignore the header.  If it is the symbol `ask', always
 query the user whether to use the value.  If it is t or the symbol
 `use', always use the value."
 If nil, always ignore the header.  If it is the symbol `ask', always
 query the user whether to use the value.  If it is t or the symbol
 `use', always use the value."
+  :version "21.4"
   :group 'message-interface
   :type '(choice (const :tag "ignore" nil)
                 (const :tag "maybe" t)
   :group 'message-interface
   :type '(choice (const :tag "ignore" nil)
                 (const :tag "maybe" t)
@@ -796,6 +812,7 @@ If non-nil, this variable contains a list of functions which return
 regular expressions to match lists.  These functions can be used in
 conjunction with `message-subscribed-regexps' and
 `message-subscribed-addresses'."
 regular expressions to match lists.  These functions can be used in
 conjunction with `message-subscribed-regexps' and
 `message-subscribed-addresses'."
+  :version "21.4"
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(repeat sexp))
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(repeat sexp))
@@ -804,6 +821,7 @@ conjunction with `message-subscribed-regexps' and
   "*A file containing addresses the user is subscribed to.
 If nil, do not look at any files to determine list subscriptions.  If
 non-nil, each line of this file should be a mailing list address."
   "*A file containing addresses the user is subscribed to.
 If nil, do not look at any files to determine list subscriptions.  If
 non-nil, each line of this file should be a mailing list address."
+  :version "21.4"
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(radio (file :format "%t: %v\n" :size 0)
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(radio (file :format "%t: %v\n" :size 0)
@@ -814,6 +832,7 @@ non-nil, each line of this file should be a mailing list address."
 If nil, do not use any predefined list subscriptions.  This list of
 addresses can be used in conjunction with
 `message-subscribed-address-functions' and `message-subscribed-regexps'."
 If nil, do not use any predefined list subscriptions.  This list of
 addresses can be used in conjunction with
 `message-subscribed-address-functions' and `message-subscribed-regexps'."
+  :version "21.4"
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(repeat string))
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(repeat string))
@@ -823,6 +842,7 @@ addresses can be used in conjunction with
 If nil, do not use any predefined list subscriptions.  This list of
 regular expressions can be used in conjunction with
 `message-subscribed-address-functions' and `message-subscribed-addresses'."
 If nil, do not use any predefined list subscriptions.  This list of
 regular expressions can be used in conjunction with
 `message-subscribed-address-functions' and `message-subscribed-addresses'."
+  :version "21.4"
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(repeat regexp))
   :group 'message-interface
   :link '(custom-manual "(message)Mailing Lists")
   :type '(repeat regexp))
@@ -832,6 +852,7 @@ regular expressions can be used in conjunction with
 If it is the symbol `always', the posting is allowed.  If it is the
 symbol `never', the posting is not allowed.  If it is the symbol
 `ask', you are prompted."
 If it is the symbol `always', the posting is allowed.  If it is the
 symbol `never', the posting is not allowed.  If it is the symbol
 `ask', you are prompted."
+  :version "21.4"
   :group 'message-interface
   :link '(custom-manual "(message)Message Headers")
   :type '(choice (const always)
   :group 'message-interface
   :link '(custom-manual "(message)Message Headers")
   :type '(choice (const always)
@@ -1013,6 +1034,7 @@ an article is yanked by the command `message-yank-original' interactively."
   "*Prefix inserted on cited or empty lines of yanked messages.
 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
 See also `message-yank-prefix'."
   "*Prefix inserted on cited or empty lines of yanked messages.
 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
 See also `message-yank-prefix'."
+  :version "21.4"
   :type 'string
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-insertion)
   :type 'string
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-insertion)
@@ -1081,6 +1103,7 @@ If nil, don't insert a signature."
 ;;;###autoload
 (defcustom message-signature-insert-empty-line t
   "*If non-nil, insert an empty line before the signature separator."
 ;;;###autoload
 (defcustom message-signature-insert-empty-line t
   "*If non-nil, insert an empty line before the signature separator."
+  :version "21.4"
   :type 'boolean
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-insertion)
   :type 'boolean
   :link '(custom-manual "(message)Insertion Variables")
   :group 'message-insertion)
@@ -1265,6 +1288,7 @@ candidates:
   "Regexp of headers to be hidden when composing new messages.
 This can also be a list of regexps to match headers.  Or a list
 starting with `not' and followed by regexps."
   "Regexp of headers to be hidden when composing new messages.
 This can also be a list of regexps to match headers.  Or a list
 starting with `not' and followed by regexps."
+  :version "21.4"
   :group 'message
   :link '(custom-manual "(message)Message Headers")
   :type '(repeat regexp))
   :group 'message
   :link '(custom-manual "(message)Message Headers")
   :type '(repeat regexp))
@@ -1556,6 +1580,7 @@ subaddresses.  So if the first address appears in the recipient list
 for a message, the subaddresses will be removed (if present) before
 the mail is sent.  All addresses in this structure should be
 downcased."
 for a message, the subaddresses will be removed (if present) before
 the mail is sent.  All addresses in this structure should be
 downcased."
+  :version "21.4"
   :group 'message-headers
   :type '(repeat (repeat string)))
 
   :group 'message-headers
   :type '(repeat (repeat string)))
 
@@ -1563,6 +1588,7 @@ downcased."
   "Like `mail-user-agent'.
 Except if it is nil, use Gnus native MUA; if it is t, use
 `mail-user-agent'."
   "Like `mail-user-agent'.
 Except if it is nil, use Gnus native MUA; if it is t, use
 `mail-user-agent'."
+  :version "21.4"
   :type '(radio (const :tag "Gnus native"
                       :format "%t\n"
                       nil)
   :type '(radio (const :tag "Gnus native"
                       :format "%t\n"
                       nil)
@@ -1586,7 +1612,7 @@ If this variable is non-nil, pose the question \"Reply to all
 recipients?\" before a wide reply to multiple recipients.  If the user
 answers yes, reply to all recipients as usual.  If the user answers
 no, only reply back to the author."
 recipients?\" before a wide reply to multiple recipients.  If the user
 answers yes, reply to all recipients as usual.  If the user answers
 no, only reply back to the author."
-  :version "21.3"
+  :version "21.4"
   :group 'message-headers
   :link '(custom-manual "(message)Wide Reply")
   :type 'boolean)
   :group 'message-headers
   :link '(custom-manual "(message)Wide Reply")
   :type 'boolean)
@@ -1604,12 +1630,19 @@ no, only reply back to the author."
                                 (executable-find idna-program)
                                 'ask)
   "Whether to encode non-ASCII in domain names into ASCII according to IDNA."
                                 (executable-find idna-program)
                                 'ask)
   "Whether to encode non-ASCII in domain names into ASCII according to IDNA."
+  :version "21.4"
   :group 'message-headers
   :link '(custom-manual "(message)IDNA")
   :type '(choice (const :tag "Ask" ask)
                 (const :tag "Never" nil)
                 (const :tag "Always" t)))
 
   :group 'message-headers
   :link '(custom-manual "(message)IDNA")
   :type '(choice (const :tag "Ask" ask)
                 (const :tag "Never" nil)
                 (const :tag "Always" t)))
 
+(defcustom message-generate-hashcash nil
+  "*Whether to generate X-Hashcash: headers."
+  :group 'message-headers
+  :link '(custom-manual "(message)Mail Headers")
+  :type 'boolean)
+
 ;;; Internal variables.
 
 (defvar message-sending-message "Sending...")
 ;;; Internal variables.
 
 (defvar message-sending-message "Sending...")
@@ -1735,6 +1768,7 @@ no, only reply back to the author."
          "\\)")
   "Regular expression that matches a valid FQDN."
   ;; see also: gnus-button-valid-fqdn-regexp
          "\\)")
   "Regular expression that matches a valid FQDN."
   ;; see also: gnus-button-valid-fqdn-regexp
+  :version "21.4"
   :group 'message-headers
   :type 'regexp)
 
   :group 'message-headers
   :type 'regexp)
 
@@ -1766,9 +1800,6 @@ no, only reply back to the author."
   (autoload 'rmail-msg-restore-non-pruned-header "rmail")
   (autoload 'rmail-output "rmailout"))
 
   (autoload 'rmail-msg-restore-non-pruned-header "rmail")
   (autoload 'rmail-output "rmailout"))
 
-(eval-when-compile
-  (autoload 'sha1 "sha1-el"))
-
 \f
 
 ;;;
 \f
 
 ;;;
@@ -1820,7 +1851,7 @@ is used by default."
   (if (not header)
       nil
     (let ((regexp (format "[%s]+" (or separator ",")))
   (if (not header)
       nil
     (let ((regexp (format "[%s]+" (or separator ",")))
-         (beg 1)
+         (beg (point-min))
          (first t)
          quoted elems paren)
       (with-temp-buffer
          (first t)
          quoted elems paren)
       (with-temp-buffer
@@ -2581,6 +2612,7 @@ these properties from the message composition buffer.  However, some
 packages requires these properties to be present in order to work.
 If you use one of these packages, turn this option off, and hope the
 message composition doesn't break too bad."
 packages requires these properties to be present in order to work.
 If you use one of these packages, turn this option off, and hope the
 message composition doesn't break too bad."
+  :version "21.4"
   :group 'message-various
   :link '(custom-manual "(message)Various Message Variables")
   :type 'boolean)
   :group 'message-various
   :link '(custom-manual "(message)Various Message Variables")
   :type 'boolean)
@@ -2692,7 +2724,11 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
        (copy-sequence message-startup-parameter-alist))
   (message-setup-fill-variables)
   ;; Allow using comment commands to add/remove quoting.
        (copy-sequence message-startup-parameter-alist))
   (message-setup-fill-variables)
   ;; Allow using comment commands to add/remove quoting.
-  (set (make-local-variable 'comment-start) message-yank-prefix)
+  ;; (set (make-local-variable 'comment-start) message-yank-prefix)
+  (when message-yank-prefix
+    (set (make-local-variable 'comment-start) message-yank-prefix)
+    (set (make-local-variable 'comment-start-skip)
+        (concat "^" (regexp-quote message-yank-prefix) "[ \t]*")))
   (if (featurep 'xemacs)
       (message-setup-toolbar)
     (set (make-local-variable 'font-lock-defaults)
   (if (featurep 'xemacs)
       (message-setup-toolbar)
     (set (make-local-variable 'font-lock-defaults)
@@ -2943,6 +2979,7 @@ prefix FORCE is given."
 E.g., if this list contains a member list with elements `Cc' and `To',
 then `message-carefully-insert-headers' will not insert a `To' header
 when the message is already `Cc'ed to the recipient."
 E.g., if this list contains a member list with elements `Cc' and `To',
 then `message-carefully-insert-headers' will not insert a `To' header
 when the message is already `Cc'ed to the recipient."
+  :version "21.4"
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
   :type '(repeat sexp))
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
   :type '(repeat sexp))
@@ -3568,8 +3605,7 @@ be added to the \"References\" field."
        ;; Insert a blank line if it is peeled off.
        (insert "\n")))
     (goto-char start)
        ;; Insert a blank line if it is peeled off.
        (insert "\n")))
     (goto-char start)
-    (while functions
-      (funcall (pop functions)))
+    (mapc 'funcall functions)
     (when message-citation-line-function
       (unless (bolp)
        (insert "\n"))
     (when message-citation-line-function
       (unless (bolp)
        (insert "\n"))
@@ -3600,14 +3636,13 @@ be added to the \"References\" field."
                                  "unknown sender"))
        (setq x-no-archive (message-fetch-field "x-no-archive")))
       (goto-char start)
                                  "unknown sender"))
        (setq x-no-archive (message-fetch-field "x-no-archive")))
       (goto-char start)
-      (while functions
-       (funcall (pop functions)))
+      (mapc 'funcall functions)
       (when message-citation-line-function
        (unless (bolp)
          (insert "\n"))
        (funcall message-citation-line-function))
       (when (and x-no-archive
       (when message-citation-line-function
        (unless (bolp)
          (insert "\n"))
        (funcall message-citation-line-function))
       (when (and x-no-archive
-                message-cite-articles-with-x-no-archive
+                (not message-cite-articles-with-x-no-archive)
                 (string-match "yes" x-no-archive))
        (undo-boundary)
        (delete-region (point) (mark t))
                 (string-match "yes" x-no-archive))
        (undo-boundary)
        (delete-region (point) (mark t))
@@ -4049,16 +4084,15 @@ not have PROP."
 (defun message-do-actions (actions)
   "Perform all actions in ACTIONS."
   ;; Now perform actions on successful sending.
 (defun message-do-actions (actions)
   "Perform all actions in ACTIONS."
   ;; Now perform actions on successful sending.
-  (while actions
+  (dolist (action actions)
     (ignore-errors
       (cond
        ;; A simple function.
     (ignore-errors
       (cond
        ;; A simple function.
-       ((functionp (car actions))
-       (funcall (car actions)))
+       ((functionp action)
+       (funcall action))
        ;; Something to be evaled.
        (t
        ;; Something to be evaled.
        (t
-       (eval (car actions)))))
-    (pop actions)))
+       (eval action))))))
 
 (defsubst message-maybe-split-and-send-mail ()
   "Split a message if necessary, and send it via mail.
 
 (defsubst message-maybe-split-and-send-mail ()
   "Split a message if necessary, and send it via mail.
@@ -4185,6 +4219,13 @@ This sub function is for exclusive use of `message-send-mail'."
         (message-this-is-mail t)
         (headers message-required-mail-headers)
         failure)
         (message-this-is-mail t)
         (headers message-required-mail-headers)
         failure)
+    (when message-generate-hashcash
+      (save-restriction
+       (message-narrow-to-headers)
+       (message-remove-header "X-Hashcash"))
+      (message "Generating hashcash...")
+      (mail-add-payment)
+      (message "Generating hashcash...done"))
     (save-restriction
       (message-narrow-to-headers)
       ;; Generate the Mail-Followup-To header if the header is not there...
     (save-restriction
       (message-narrow-to-headers)
       ;; Generate the Mail-Followup-To header if the header is not there...
@@ -4320,7 +4361,7 @@ This sub function is for exclusive use of `message-send-mail'."
            (save-excursion
              (set-buffer errbuf)
              (goto-char (point-min))
            (save-excursion
              (set-buffer errbuf)
              (goto-char (point-min))
-             (while (re-search-forward "\n\n* *" nil t)
+             (while (re-search-forward "\n+ *" nil t)
                (replace-match "; "))
              (if (not (zerop (buffer-size)))
                  (error "Sending...failed to %s"
                (replace-match "; "))
              (if (not (zerop (buffer-size)))
                  (error "Sending...failed to %s"
@@ -4343,8 +4384,8 @@ to find out how to use this."
   (case
       (as-binary-process
        (apply
   (case
       (as-binary-process
        (apply
-       'call-process-region 1 (point-max) message-qmail-inject-program
-       nil nil nil
+       'call-process-region (point-min) (point-max)
+       message-qmail-inject-program nil nil nil
        ;; qmail-inject's default behaviour is to look for addresses on the
        ;; command line; if there're none, it scans the headers.
        ;; yes, it does The Right Thing w.r.t. Resent-To and it's kin.
        ;; qmail-inject's default behaviour is to look for addresses on the
        ;; command line; if there're none, it scans the headers.
        ;; yes, it does The Right Thing w.r.t. Resent-To and it's kin.
@@ -4459,7 +4500,7 @@ manual for details."
 (defun message-canlock-generate ()
   "Return a string that is non-trivial to guess.
 Do not use this for anything important, it is cryptographically weak."
 (defun message-canlock-generate ()
   "Return a string that is non-trivial to guess.
 Do not use this for anything important, it is cryptographically weak."
-  (require 'sha1-el)
+  (require 'sha1)
   (let (sha1-maximum-internal-length)
     (sha1 (concat (message-unique-id)
                  (format "%x%x%x" (random) (random t) (random))
   (let (sha1-maximum-internal-length)
     (sha1 (concat (message-unique-id)
                  (format "%x%x%x" (random) (random t) (random))
@@ -5789,7 +5830,7 @@ If the current line has `message-yank-prefix', insert it on the new line."
     (when (looking-at "[ \t]*$")
       (message-delete-line))
     (goto-char begin)
     (when (looking-at "[ \t]*$")
       (message-delete-line))
     (goto-char begin)
-    (re-search-forward ":" nil t)
+    (search-forward ":" nil t)
     (when (looking-at "\n[ \t]+")
       (replace-match " " t t))
     (goto-char (point-max))))
     (when (looking-at "\n[ \t]+")
       (replace-match " " t t))
     (goto-char (point-max))))
@@ -5828,7 +5869,7 @@ they are."
     ;; When sending via news, make sure the total folded length will
     ;; be less than 998 characters.  This is to cater to broken INN
     ;; 2.3 which counts the total number of characters in a header
     ;; When sending via news, make sure the total folded length will
     ;; be less than 998 characters.  This is to cater to broken INN
     ;; 2.3 which counts the total number of characters in a header
-    ;; rather than the physical line length of each line, as it shuld.
+    ;; rather than the physical line length of each line, as it should.
     ;;
     ;; This hack should be removed when it's believed than INN 2.3 is
     ;; no longer widely used.
     ;;
     ;; This hack should be removed when it's believed than INN 2.3 is
     ;; no longer widely used.
@@ -5868,6 +5909,7 @@ they are."
 (defcustom message-beginning-of-line t
   "Whether \\<message-mode-map>\\[message-beginning-of-line]\
  goes to beginning of header values."
 (defcustom message-beginning-of-line t
   "Whether \\<message-mode-map>\\[message-beginning-of-line]\
  goes to beginning of header values."
+  :version "21.4"
   :group 'message-buffers
   :link '(custom-manual "(message)Movement")
   :type 'boolean)
   :group 'message-buffers
   :link '(custom-manual "(message)Movement")
   :type 'boolean)
@@ -6825,18 +6867,17 @@ the message."
                      subject
                    (nnheader-decode-subject subject))
                ""))
                      subject
                    (nnheader-decode-subject subject))
                ""))
-       (if message-wash-forwarded-subjects
-           (setq subject (message-wash-subject subject)))
+       (when message-wash-forwarded-subjects
+         (setq subject (message-wash-subject subject)))
        ;; Make sure funcs is a list.
        (and funcs
             (not (listp funcs))
             (setq funcs (list funcs)))
        ;; Apply funcs in order, passing subject generated by previous
        ;; func to the next one.
        ;; Make sure funcs is a list.
        (and funcs
             (not (listp funcs))
             (setq funcs (list funcs)))
        ;; Apply funcs in order, passing subject generated by previous
        ;; func to the next one.
-       (while funcs
-         (when (functionp (car funcs))
-           (setq subject (funcall (car funcs) subject)))
-         (setq funcs (cdr funcs)))
+       (dolist (func funcs)
+         (when (functionp func)
+           (setq subject (funcall func subject))))
        subject))))
 
 ;;;###autoload
        subject))))
 
 ;;;###autoload
@@ -7205,7 +7246,7 @@ which specify the range to operate on."
     (let ((end1 (make-marker)))
       (move-marker end1 (max start end))
       (goto-char (min start end))
     (let ((end1 (make-marker)))
       (move-marker end1 (max start end))
       (goto-char (min start end))
-      (while (re-search-forward "\b" end1 t)
+      (while (search-forward "\b" end1 t)
        (if (eq (char-after) (char-after (- (point) 2)))
            (delete-char -2))))))
 
        (if (eq (char-after) (char-after (- (point) 2)))
            (delete-char -2))))))
 
@@ -7324,6 +7365,7 @@ This variable is semi-obsolete, set it as nil and use
 (defcustom message-tab-body-function nil
   "*Function to execute when `message-tab' (TAB) is executed in the body.
 If nil, the function bound in `text-mode-map' or `global-map' is executed."
 (defcustom message-tab-body-function nil
   "*Function to execute when `message-tab' (TAB) is executed in the body.
 If nil, the function bound in `text-mode-map' or `global-map' is executed."
+  :version "21.4"
   :group 'message
   :link '(custom-manual "(message)Various Commands")
   :type 'function)
   :group 'message
   :link '(custom-manual "(message)Various Commands")
   :type 'function)