(message-do-auto-fill): New function. Like
authorKai Grossjohann <kgrossjo@eu.uu.net>
Fri, 12 Oct 2001 13:15:43 +0000 (13:15 +0000)
committerKai Grossjohann <kgrossjo@eu.uu.net>
Fri, 12 Oct 2001 13:15:43 +0000 (13:15 +0000)
`do-auto-fill' but don't fill when in the message header.
(message-setup-1): Put a text property on the message header.
(message-setup-fill-variables): Use `message-do-auto-fill'.

lisp/ChangeLog
lisp/message.el

index 653d998..4dd6dd0 100644 (file)
@@ -1,3 +1,11 @@
+2001-10-12  Kai Gro\e,A_\e(Bjohann  <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+       Suggested by Oliver Scholz <epameinondas@gmx.de>.
+       
+       * message.el (message-do-auto-fill): New function.  Like
+       `do-auto-fill' but don't fill when in the message header.
+       (message-setup-1): Put a text property on the message header.
+       (message-setup-fill-variables): Use `message-do-auto-fill'.
+
 2001-10-10 12:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-send-mail-partially): Insert an empty line
index 5dc8e52..2a93652 100644 (file)
@@ -1654,7 +1654,9 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
     (setq adaptive-fill-first-line-regexp
          (concat quote-prefix-regexp "\\|"
                  adaptive-fill-first-line-regexp))
-    (setq auto-fill-inhibit-regexp "^[A-Z][^: \n\t]+:")))
+    ;;(setq auto-fill-inhibit-regexp "^[A-Z][^: \n\t]+:")
+    (setq auto-fill-inhibit-regexp nil)
+    (setq auto-fill-function 'message-do-auto-fill)))
 
 \f
 
@@ -1926,6 +1928,11 @@ Prefix arg means justify as well."
     (message-newline-and-reformat arg t)
     t))
 
+(defun message-do-auto-fill ()
+  "Like `do-auto-fill', but don't fill in message header."
+  (unless (text-property-any (line-beginning-position) (point) 'field 'header)
+    (do-auto-fill)))
+
 (defun message-insert-signature (&optional force)
   "Insert a signature.  See documentation for variable `message-signature'."
   (interactive (list 0))
@@ -2105,31 +2112,11 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line."
        (indent-rigidly start (mark t) message-indentation-spaces)
       (save-excursion
        (goto-char start)
-       (let (last-line)
-         ;; `last-line' describes the contents of the last line
-         ;; encountered in the loop below. nil means "empty line",
-         ;; spaces "line consisting entirely of whitespace",
-         ;; right-angle "line starts with >", quoted "quote character
-         ;; at the beginning of the line", text "the remaining cases".
          (while (< (point) (mark t))
-           (cond
-            ((eolp) 
+         (if (looking-at ">")
              (insert message-yank-cited-prefix)
-             (setq last-line nil))
-            ((looking-at ">")
-             (if (memq last-line '(nil spaces right-angle quoted))
-                 (progn
-                   (insert message-yank-cited-prefix)
-                   (setq last-line 'quoted))
-               (insert message-yank-prefix)
-               (setq last-line 'right-angle)))
-            ((looking-at "\\s-+$")
-             (insert message-yank-prefix)
-             (setq last-line 'spaces))
-            (t
-             (insert message-yank-prefix)
-             (setq last-line 'text)))
-           (forward-line 1)))))
+           (insert message-yank-prefix))
+         (forward-line 1))))
     (goto-char start)))
 
 (defun message-yank-original (&optional arg)
@@ -3960,6 +3947,7 @@ than 988 characters long, and if they are not, trim them until they are."
      (insert mail-header-separator "\n")
      (1- (point)))
    'read-only nil)
+  (put-text-property (point-min) (1- (point)) 'field 'header)
   (forward-line -1)
   (when (message-news-p)
     (when message-default-news-headers