Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / message.el
index 9e0133c..684ebe4 100644 (file)
@@ -508,7 +508,7 @@ and respond with new To and Cc headers."
   :group 'message-interface
   :type '(choice function (const nil)))
 
-(defcustom message-use-followup-to t
+(defcustom message-use-followup-to 'ask
   "*Specifies what to do with Followup-To header.
 If nil, always ignore the header.  If it is t, use its value, but
 query before using the \"poster\" value.  If it is the symbol `ask',
@@ -533,17 +533,6 @@ the value.  If it is the symbol `use', always use the value."
                 (const :tag "always" use)
                 (const :tag "ask" ask)))
 
-(defcustom message-use-mail-followup-to 'ask
-  "*Specifies what to do with Mail-Followup-To header.
-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."
-  :group 'message-interface
-  :type '(choice (const :tag "ignore" nil)
-                (const :tag "maybe" t)
-                (const :tag "always" use)
-                (const :tag "ask" ask)))
-
 ;;; XXX: 'ask and 'use are not implemented yet.
 (defcustom message-use-mail-reply-to 'ask
   "*Specifies what to do with Mail-Reply-To/Reply-To header.
@@ -557,6 +546,17 @@ is never used."
                 (const :tag "always" use)
                 (const :tag "ask" ask)))
 
+(defcustom message-use-mail-followup-to t
+  "*Specifies what to do with Mail-Followup-To header.
+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."
+  :group 'message-interface
+  :type '(choice (const :tag "ignore" nil)
+                (const :tag "maybe" t)
+                (const :tag "always" use)
+                (const :tag "ask" ask)))
+
 (defcustom message-sendmail-f-is-evil 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."
@@ -725,6 +725,17 @@ Note that `message-cite-original' uses `mail-citation-hook' if that is non-nil."
   :group 'message-insertion)
 
 ;;;###autoload
+(defcustom message-suspend-font-lock-when-citing nil
+  "Non-nil means suspend font-lock'ing while citing an original message.
+Some lazy demand-driven fontification tools (or Emacs itself) have a
+bug that they often miss a buffer to be fontified.  It will mostly
+occur when Emacs prompts user for any inputs in the minibuffer.
+Setting this option to non-nil may help you to avoid unpleasant errors
+even if it is an add-hoc expedient."
+  :type 'boolean
+  :group 'message-insertion)
+
+;;;###autoload
 (defcustom message-indent-citation-function 'message-indent-citation
   "*Function for modifying a citation just inserted in the mail buffer.
 This can also be a list of functions.  Each function can find the
@@ -2606,7 +2617,15 @@ be added to \"References\" field.
              (backward-delete-char 1)))))
 
       (unless arg
-       (funcall message-cite-function))
+       (if (and message-suspend-font-lock-when-citing
+                (boundp 'font-lock-mode)
+                (symbol-value 'font-lock-mode))
+           (progn
+             (sit-for 0)
+             (font-lock-mode 0)
+             (funcall message-cite-function)
+             (font-lock-mode 1))
+         (funcall message-cite-function)))
       (message-exchange-point-and-mark)
       (unless (bolp)
        (insert ?\n))
@@ -4631,8 +4650,10 @@ than 988 characters long, and if they are not, trim them until they are."
                     (string-equal name "mail")
                     (string-equal name "news")))
            (setq name (concat "*sent " name "*"))
+         (message-narrow-to-headers)
          (setq to (message-fetch-field "to"))
          (setq group (message-fetch-field "newsgroups"))
+         (widen)
          (setq name
                (cond
                 (to (concat "*sent mail to "
@@ -4839,8 +4860,7 @@ OTHER-HEADERS is an alist of header/value pairs."
          mrt (when message-use-mail-reply-to
                (message-fetch-field "mail-reply-to"))
          mft (when (and (not (or to-address mrt reply-to))
-                        (or message-use-followup-to
-                            message-use-mail-followup-to))
+                        message-use-mail-followup-to)
                (message-fetch-field "mail-followup-to")))
 
     ;; Handle special values of Mail-Copies-To.
@@ -4881,8 +4901,7 @@ sends a copy of your response to " (if (string-match "," mct)
 
     ;; Handle Mail-Followup-To.
     (when (and mft
-              (eq (or message-use-followup-to
-                      message-use-mail-followup-to) 'ask)
+              (eq message-use-mail-followup-to 'ask)
               (not (message-y-or-n-p
                     (concat "Obey Mail-Followup-To: " mft "? ") t "\
 You should normally obey the Mail-Followup-To: header.
@@ -4912,9 +4931,8 @@ that further discussion should take place only in "
        (save-excursion
          (message-set-work-buffer)
          (if (and mft
-                  message-use-followup-to
                   wide
-                  (or (not (eq message-use-followup-to 'ask))
+                  (or (not (eq message-use-mail-followup-to 'ask))
                       (message-y-or-n-p "Obey Mail-Followup-To? " t "\
 You should normally obey the Mail-Followup-To: header.  In this
 article, it has the value of
@@ -4925,8 +4943,12 @@ which directs your response to " (if (string-match "," mft)
                                     "the specified addresses"
                                   "that address only") ".
 
-If a message is posted to several mailing lists, Mail-Followup-To is
-often used to direct the following discussion to one list only,
+Most commonly, Mail-Followup-To is used by a mailing list poster to
+express that responses should be sent to just the list, and not the
+poster as well.
+
+If a message is posted to several mailing lists, Mail-Followup-To may
+also be used to direct the following discussion to one list only,
 because discussions that are spread over several lists tend to be
 fragmented and very difficult to follow.
 
@@ -5074,8 +5096,7 @@ If TO-NEWSGROUPS, use that as the new Newsgroups line."
            distribution (message-fetch-field "distribution")
            mct (when message-use-mail-copies-to
                  (message-fetch-field "mail-copies-to"))
-           mft (when (or message-use-followup-to
-                         message-use-mail-followup-to)
+           mft (when message-use-mail-followup-to
                  (message-fetch-field "mail-followup-to")))
       (when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
                 (string-match "<[^>]+>" gnus-warning))
@@ -5162,8 +5183,7 @@ responses here are directed to other newsgroups."))
            (setq follow-to (list (cons 'Newsgroups newsgroups)))))))
        ;; Handle Mail-Followup-To, followup via e-mail.
        ((and mft
-            (or (not (eq (or message-use-followup-to
-                             message-use-mail-followup-to) 'ask))
+            (or (not (eq message-use-mail-followup-to 'ask))
                 (message-y-or-n-p
                  (concat "Obey Mail-Followup-To: " mft "? ") t "\
 You should normally obey the Mail-Followup-To: header.