]> git.eshelyaron.com Git - emacs.git/commitdiff
(fill-individual-paragraphs): Avoid infinite loop
authorRichard M. Stallman <rms@gnu.org>
Wed, 26 Oct 1994 09:32:04 +0000 (09:32 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 26 Oct 1994 09:32:04 +0000 (09:32 +0000)
if mailp is set and no message was yanked.

lisp/textmodes/fill.el

index 6411ba91ea46fc1b861a7694781bdbf33dfea4ee..66c0d94e51f6c7345de07f6e0101839b0241e666 100644 (file)
@@ -358,8 +358,11 @@ MAIL-FLAG for a mail message, i. e. don't fill header lines."
     (save-excursion
       (goto-char min)
       (beginning-of-line)
+      (narrow-to-region (point) max)
       (if mailp 
-         (while (or (looking-at "[ \t]*[^ \t\n]*:") (looking-at "[ \t]*$"))
+         (while (and (not (eobp))
+                     (or (looking-at "[ \t]*[^ \t\n]*:")
+                         (looking-at "[ \t]*$")))
            (if (looking-at "[ \t]*[^ \t\n]*:")
                (search-forward "\n\n" nil 'move)
              (forward-line 1))))