(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))
(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.")
: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)
;; 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))
;;; 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)