From 183e4bd6f1410210a6e69d8fda12bd0f4eabd212 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sat, 15 Nov 1997 20:58:28 +0000 Subject: [PATCH] (fill-individual-paragraphs): Don't get confused in paragraph loop if we start on the last line and it has no final newline. --- lisp/textmodes/fill.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 78e89649ade..d430ad0bc5c 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -969,11 +969,13 @@ MAIL-FLAG for a mail message, i. e. don't fill header lines." (forward-line 1)))) (narrow-to-region (point) max) ;; Loop over paragraphs. - (while (progn + (while (let ((here (point))) ;; Skip over all paragraph-separating lines ;; so as to not include them in any paragraph. - (while (progn (move-to-left-margin) - (and (not (eobp)) (looking-at paragraph-separate))) + (while (and (not (eobp)) + (progn (move-to-left-margin) + (and (not (eobp)) + (looking-at paragraph-separate)))) (forward-line 1)) (skip-chars-forward " \t\n") (not (eobp))) (move-to-left-margin) -- 2.39.2