Importing qgnus-0.20
[elisp/gnus.git-] / lisp / gnus-msg.el
index e7534f3..78d2066 100644 (file)
@@ -217,8 +217,7 @@ Thank you for your help in stamping out bugs.
 If ARG, post to the group under point.
 If ARG is 1, prompt for a group name."
   (interactive "P")
-  ;; Bind this variable here to make message mode hooks
-  ;; work ok.
+  ;; Bind this variable here to make message mode hooks work ok.
   (let ((gnus-newsgroup-name
         (if arg
             (if (= 1 (prefix-numeric-value arg))
@@ -550,6 +549,8 @@ If SILENT, don't prompt the user."
 
 ;; Written by "Mr. Per Persson" <pp@gnu.ai.mit.edu>.
 (defun gnus-inews-insert-mime-headers ()
+  "Insert MIME headers.  
+Assumes ISO-Latin-1 is used iff 8-bit characters are present."
   (goto-char (point-min))
   (let ((mail-header-separator
         (progn
@@ -564,7 +565,7 @@ If SILENT, don't prompt the user."
        (cond ((save-restriction
                 (widen)
                 (goto-char (point-min))
-                (re-search-forward "[\200-\377]" nil t))
+                (re-search-forward "[^\000-\177]" nil t))
               (or (mail-position-on-field "Content-Type")
                   (insert "text/plain; charset=ISO-8859-1"))
               (or (mail-position-on-field "Content-Transfer-Encoding")
@@ -574,6 +575,8 @@ If SILENT, don't prompt the user."
                 (or (mail-position-on-field "Content-Transfer-Encoding")
                     (insert "7bit")))))))
 
+(custom-add-option 'message-header-hook 'gnus-inews-insert-mime-headers)
+
 \f
 ;;;
 ;;; Gnus Mail Functions