changeset 38186:b75d5ec491a5

(fill-region-as-paragraph): Don't look further back than LINEBEG.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 25 Jun 2001 19:19:58 +0000
parents d483b73544a0
children 9ed244efd3b9
files lisp/textmodes/fill.el
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Mon Jun 25 15:38:01 2001 +0000
+++ b/lisp/textmodes/fill.el	Mon Jun 25 19:19:58 2001 +0000
@@ -527,15 +527,16 @@
 		;; further fills will assume it ends a sentence.
 		;; If we now know it does not end a sentence,
 		;; avoid putting it at the end of the line.
-		(while (or (and sentence-end-double-space
-				(> (point) (+ linebeg 2))
-				(eq (preceding-char) ?\ )
-				(not (eq (following-char) ?\ ))
-				(eq (char-after (- (point) 2)) ?\.)
-				(progn (forward-char -2) t))
-			   (and fill-nobreak-predicate
-				(funcall fill-nobreak-predicate)
-				(skip-chars-backward " \t")))
+		(while (and (> (point) linebeg)
+			    (or (and sentence-end-double-space
+				     (> (point) (+ linebeg 2))
+				     (eq (preceding-char) ?\ )
+				     (not (eq (following-char) ?\ ))
+				     (eq (char-after (- (point) 2)) ?\.)
+				     (progn (forward-char -2) t))
+				(and fill-nobreak-predicate
+				     (funcall fill-nobreak-predicate)
+				     (skip-chars-backward " \t"))))
 		  (if (re-search-backward " \\|\\c|.\\|.\\c|" linebeg 0)
 		      (forward-char 1)))
 		;; If the left margin and fill prefix by themselves