"Coding system to encode outgoing mail.")
(defvar message-draft-coding-system
- (if (string-match "XEmacs\\|Lucid" emacs-version)
- 'escape-quoted 'emacs-mule)
+ (cond
+ ((not (fboundp 'coding-system-p)) nil)
+ ((coding-system-p 'emacs-mule) 'emacs-mule)
+ ((coding-system-p 'escape-quoted) 'escape-quoted)
+ ((coding-system-p 'no-conversion) 'no-conversion)
+ (t nil))
"Coding system to compose mail.")
(defvar message-default-charset 'iso-8859-1
(define-key message-mode-map "\C-c\C-z" 'message-kill-to-signature)
(define-key message-mode-map "\M-\r" 'message-newline-and-reformat)
- (define-key message-mode-map "\C-c\C-a" 'message-insert-mime-part)
- (define-key message-mode-map "\C-c\C-m\C-a" 'message-insert-mime-part)
+ (define-key message-mode-map "\C-c\C-a" 'message-mime-attach-file)
+ (define-key message-mode-map "\C-c\C-m\C-a" 'message-mime-attach-file)
(define-key message-mode-map "\C-c\C-m\C-e" 'message-mime-insert-external)
(define-key message-mode-map "\C-c\C-m\C-q" 'mml-quote-region)
(let ((inhibit-read-only t))
(put-text-property (point-min) (point-max) 'read-only nil))
(message-fix-before-sending)
- (message-encode-message-body)
(run-hooks 'message-send-hook)
(message "Sending...")
(let ((alist message-send-method-alist)
(message-do-fcc)
;;(when (fboundp 'mail-hist-put-headers-into-history)
;; (mail-hist-put-headers-into-history))
- (run-hooks 'message-sent-hook)
+ (save-excursion
+ (run-hooks 'message-sent-hook))
(message "Sending...done")
;; Mark the buffer as unmodified and delete auto-save.
(set-buffer-modified-p nil)
(mail-encode-encoded-word-buffer)
;; Let the user do all of the above.
(run-hooks 'message-header-hook))
+ (message-encode-message-body)
(unwind-protect
(save-excursion
(set-buffer tembuf)
(mail-encode-encoded-word-buffer)
;; Let the user do all of the above.
(run-hooks 'message-header-hook))
+ (message-encode-message-body)
(message-cleanup-headers)
(if (not (message-check-news-syntax))
nil
;; I really think this function should be renamed. It is only useful
;; for inserting file attachments.
-(defun message-insert-mime-part (file type description)
+(defun message-mime-attach-file (file type description)
"Attach a file to the outgoing MIME message.
The file is not inserted or encoded until you send the message with
`\\[message-send-and-exit]' or `\\[message-send]'.