From a461b8e01ede654e1db9c35fbf69600a355b36d4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 26 Oct 1994 09:32:04 +0000 Subject: [PATCH] (fill-individual-paragraphs): Avoid infinite loop if mailp is set and no message was yanked. --- lisp/textmodes/fill.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 6411ba91ea4..66c0d94e51f 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -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)))) -- 2.39.5