X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmessage.el;h=6d8d2e39ab0e7d29d55d0ce7dff8213f76e92749;hb=5b8ecce52d86ed7352e6e5b5d768c34321a4c58d;hp=f0eb4817377a377b31790e225630f23b301b5304;hpb=26bc703e4093e33e32563bb50564217d34aa62a3;p=gnus diff --git a/lisp/message.el b/lisp/message.el index f0eb48173..6d8d2e39a 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -862,7 +862,9 @@ The cdr of ech entry is a function for applying the face to a region.") (defvar message-draft-coding-system (cond ((not (fboundp 'coding-system-p)) nil) - ((coding-system-p 'emacs-mule) 'emacs-mule) + ((coding-system-p 'emacs-mule) + (if (string-match "nt" system-configuration) + 'emacs-mule-dos 'emacs-mule)) ((memq 'escape-quoted (mm-get-coding-system-list)) 'escape-quoted) ((coding-system-p 'no-conversion) 'no-conversion) (t nil)) @@ -1320,7 +1322,7 @@ Point is left at the beginning of the narrowed-to region." ["Newline and Reformat" message-newline-and-reformat t] ["Rename buffer" message-rename-buffer t] ["Spellcheck" ispell-message t] - ["Attach file as MIME" message-mime-attach-file t] + ["Attach file as MIME" mml-attach-file t] "----" ["Send Message" message-send-and-exit t] ["Abort Message" message-dont-send t] @@ -1352,6 +1354,7 @@ Point is left at the beginning of the narrowed-to region." "Major mode for editing mail and news to be sent. Like Text Mode but with these additional commands: C-c C-s message-send (send the message) C-c C-c message-send-and-exit +C-c C-d Pospone sending the message C-c C-k Kill the message C-c C-f move to a header field (and create it if there isn't): C-c C-f C-t move to To C-c C-f C-s move to Subject C-c C-f C-c move to Cc C-c C-f C-b move to Bcc @@ -2088,14 +2091,12 @@ the user from the mailer." (case-fold-search nil) (news (message-news-p)) (mailbuf (current-buffer))) - (message-encode-message-body) (save-restriction (message-narrow-to-headers) ;; Insert some headers. (let ((message-deletable-headers (if news nil message-deletable-headers))) (message-generate-headers message-required-mail-headers)) - (mail-encode-encoded-word-buffer) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) (unwind-protect @@ -2108,10 +2109,15 @@ the user from the mailer." (set-buffer mailbuf) (buffer-string)))) ;; Remove some headers. + (message-encode-message-body) (save-restriction (message-narrow-to-headers) + ;; We (re)generate the Lines header. + (when (memq 'Lines message-required-mail-headers) + (message-generate-headers '(Lines))) ;; Remove some headers. - (message-remove-header message-ignored-mail-headers t)) + (message-remove-header message-ignored-mail-headers t) + (mail-encode-encoded-word-buffer)) (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) @@ -2264,13 +2270,10 @@ to find out how to use this." result) (if (not (message-check-news-body-syntax)) nil - (message-encode-message-body) (save-restriction (message-narrow-to-headers) ;; Insert some headers. (message-generate-headers message-required-news-headers) - (let ((mail-parse-charset message-posting-charset)) - (mail-encode-encoded-word-buffer)) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) (message-cleanup-headers) @@ -2286,11 +2289,17 @@ to find out how to use this." "%s" (save-excursion (set-buffer messbuf) (buffer-string)))) + (message-encode-message-body) ;; Remove some headers. (save-restriction (message-narrow-to-headers) + ;; We (re)generate the Lines header. + (when (memq 'Lines message-required-mail-headers) + (message-generate-headers '(Lines))) ;; Remove some headers. - (message-remove-header message-ignored-news-headers t)) + (message-remove-header message-ignored-news-headers t) + (let ((mail-parse-charset message-posting-charset)) + (mail-encode-encoded-word-buffer))) (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) @@ -2988,7 +2997,7 @@ Headers already prepared in the buffer are not modified." ;; colon, if there is none. (if (/= (char-after) ? ) (insert " ") (forward-char 1)) ;; Find out whether the header is empty... - (looking-at "[ \t]*$"))) + (looking-at "[ \t]*\n[^ \t]"))) ;; So we find out what value we should insert. (setq value (cond @@ -3830,7 +3839,8 @@ Optional NEWS will use news to forward instead of mail." (when (looking-at "From ") (replace-match "X-From-Line: ")) ;; Send it. - (let (message-required-mail-headers) + (let ((message-inhibit-body-encoding t) + message-required-mail-headers) (message-send-mail)) (kill-buffer (current-buffer))) (message "Resending message to %s...done" address))) @@ -4105,10 +4115,10 @@ regexp varstr." ;;; MIME functions ;;; -(defvar messgage-inhibit-body-encoding nil) +(defvar message-inhibit-body-encoding nil) (defun message-encode-message-body () - (unless messgage-inhibit-body-encoding + (unless message-inhibit-body-encoding (let ((mail-parse-charset (or mail-parse-charset message-default-charset message-posting-charset))