Synch with `t-gnus-6_14' and Gnus.
[elisp/gnus.git-] / lisp / message.el
index 975ae72..7c0519c 100644 (file)
@@ -43,6 +43,9 @@
 
 (require 'mailheader)
 (require 'nnheader)
+;; This is apparently necessary even though things are autoloaded:
+(if (featurep 'xemacs)
+    (require 'mail-abbrevs))
 (require 'mime-edit)
 (eval-when-compile (require 'static))
 
@@ -800,13 +803,13 @@ actually occur."
 (defvar message-user-agent nil
   "String of the form of PRODUCT/VERSION.  Used for User-Agent header field.")
 
-;; Ignore errors in case this is used in Emacs 19.
-;; Don't use ignore-errors because this is copied into loaddefs.el.
+(static-when (boundp 'MULE)
+  (require 'reporter));; `define-mail-user-agent' is here.
+
 ;;;###autoload
-(ignore-errors
-  (define-mail-user-agent 'message-user-agent
-    'message-mail 'message-send-and-exit
-    'message-kill-buffer 'message-send-hook))
+(define-mail-user-agent 'message-user-agent
+  'message-mail 'message-send-and-exit
+  'message-kill-buffer 'message-send-hook)
 
 (defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
   "If non-nil, delete the deletable headers before feeding to mh.")
@@ -844,7 +847,8 @@ Valid valued are `unique' and `unsent'."
   :type '(choice (const :tag "unique" unique)
                 (const :tag "unsent" unsent)))
 
-(defcustom message-default-charset nil
+(defcustom message-default-charset 
+  (and (featurep 'xemacs) (not (featurep 'mule)) 'iso-8859-1)
   "Default charset used in non-MULE XEmacsen."
   :group 'message
   :type 'symbol)
@@ -2910,12 +2914,15 @@ This sub function is for exclusive use of `message-send-mail'."
            ;; require one newline at the end.
            (or (= (preceding-char) ?\n)
                (insert ?\n))
-           (when (and news
+           (when
+               (save-restriction
+                 (message-narrow-to-headers)
+                 (and news
                       (or (message-fetch-field "cc")
                           (message-fetch-field "to"))
                       (let ((ct (mime-read-Content-Type)))
                         (and (eq 'text (cdr (assq 'type ct)))
-                             (eq 'plain (cdr (assq 'subtype ct))))))
+                             (eq 'plain (cdr (assq 'subtype ct)))))))
              (message-insert-courtesy-copy))
            (setq failure (message-maybe-split-and-send-mail)))
        (kill-buffer tembuf))
@@ -5362,7 +5369,7 @@ regexp varstr."
 ;;; Miscellaneous functions
 
 ;; stolen (and renamed) from nnheader.el
-(if (fboundp 'subst-char-in-string)
+(static-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)