From: Richard M. Stallman Date: Wed, 26 Oct 1994 09:32:04 +0000 (+0000) Subject: (fill-individual-paragraphs): Avoid infinite loop X-Git-Tag: emacs-19.34~6149 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a461b8e01ede654e1db9c35fbf69600a355b36d4;p=emacs.git (fill-individual-paragraphs): Avoid infinite loop if mailp is set and no message was yanked. --- 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))))