2000-11-08 08:38:30 ShengHuo ZHU <zsh@cs.rochester.edu>
[gnus] / lisp / message.el
index 934a4a7..40f581d 100644 (file)
@@ -33,6 +33,7 @@
 (eval-when-compile
   (require 'cl)
   (defvar gnus-list-identifiers))      ; gnus-sum is required where necessary
+
 (require 'mailheader)
 (require 'nnheader)
 ;; This is apparently necessary even though things are autoloaded:
@@ -821,7 +822,7 @@ Defaults to `text-mode-abbrev-table'.")
 (defvar message-font-lock-keywords
   (let* ((cite-prefix "A-Za-z")
         (cite-suffix (concat cite-prefix "0-9_.@-"))
-        (content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)"))
+        (content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?"))
     `((,(concat "^\\([Tt]o:\\)" content)
        (1 'message-header-name-face)
        (2 'message-header-to-face nil t))
@@ -1716,7 +1717,7 @@ With the prefix argument FORCE, insert the header anyway."
     (unless (bolp)
       (save-excursion
        (beginning-of-line)
-       (when (looking-at (concat prefix
+       (when (looking-at (concat prefix "\\|"
                                  supercite-thing))
          (setq quoted (match-string 0))))
       (insert "\n"))
@@ -2129,6 +2130,7 @@ It should typically alter the sending method in some way or other."
        (success t)
        elem sent
        (message-options message-options))
+    (message-options-set-recipient)
     (while (and success
                (setq elem (pop alist)))
       (when (funcall (cadr elem))
@@ -3705,11 +3707,13 @@ OTHER-HEADERS is an alist of header/value pairs."
                    message-use-followup-to
                    (or (not (eq message-use-followup-to 'ask))
                        (message-y-or-n-p
-                       (concat "Obey Mail-Followup-To: " mft "? ") t "\
-You should normally obey the Mail-Followup-To: header.
+                       (concat "Obey Mail-Followup-To? ") t "\
+You should normally obey the Mail-Followup-To: header.  In this
+article, it has the value of
+
+" mft "
 
-       `Mail-Followup-To: " mft "'
-directs your response to " (if (string-match "," mft)
+which directs your response to " (if (string-match "," mft)
                               "the specified addresses"
                             "that address only") ".
 
@@ -3754,7 +3758,6 @@ responses here are directed to other addresses.")))
            (push ccs follow-to)))))
     follow-to))
 
-
 ;;;###autoload
 (defun message-reply (&optional to-address wide)
   "Start editing a reply to the article in the current buffer."
@@ -4472,21 +4475,8 @@ regexp varstr."
 
 ;;; Miscellaneous functions
 
-;; stolen (and renamed) from nnheader.el
-(if (fboundp 'subst-char-in-string)
-    (defsubst message-replace-chars-in-string (string from to)
-      (subst-char-in-string from to string))
-  (defun message-replace-chars-in-string (string from to)
-    "Replace characters in STRING from FROM to TO."
-    (let ((string (substring string 0))        ;Copy string.
-         (len (length string))
-         (idx 0))
-      ;; Replace all occurrences of FROM with TO.
-      (while (< idx len)
-       (when (= (aref string idx) from)
-         (aset string idx to))
-       (setq idx (1+ idx)))
-      string)))
+(defsubst message-replace-chars-in-string (string from to)
+  (mm-subst-char-in-string from to string))
 
 ;;;
 ;;; MIME functions
@@ -4577,6 +4567,16 @@ regexp varstr."
           (push (cons symbol value) message-options))))
   value)
 
+(defun message-options-set-recipient ()
+  (save-restriction
+    (message-narrow-to-headers-or-head)
+    (message-options-set 'message-sender
+                        (mail-strip-quoted-names 
+                         (message-fetch-field "from")))
+    (message-options-set 'message-recipients
+                         (mail-strip-quoted-names 
+                          (message-fetch-field "to")))))
+
 (provide 'message)
 
 (run-hooks 'message-load-hook)