changeset 14840:dfbf6fd50825

(fill-region-as-paragraph): Fix the second check for whether we reached the end of the paragraph.
author Richard M. Stallman <rms@gnu.org>
date Tue, 19 Mar 1996 20:05:11 +0000
parents bc1d2478d392
children 14bfa8383808
files lisp/textmodes/fill.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Tue Mar 19 08:06:44 1996 +0000
+++ b/lisp/textmodes/fill.el	Tue Mar 19 20:05:11 1996 +0000
@@ -321,7 +321,9 @@
 		      (forward-char -2)
 		      (skip-chars-backward "^ \n" linebeg)))
 		;; If the left margin and fill prefix by themselves
-		;; pass the fill-column, keep at least one word.
+		;; pass the fill-column. or if they are zero
+		;; but we have no room for even one word,
+		;; keep at least one word anyway.
 		;; This handles ALL BUT the first line of the paragraph.
 		(if (if (zerop prefixcol)
 			(save-excursion
@@ -371,7 +373,7 @@
 			(skip-chars-forward "^ \t\n")
 			(setq first nil))))
 		;; Check again to see if we got to the end of the paragraph.
-		(if (eobp)
+		(if (save-excursion (skip-chars-forward " \t") (eobp))
 		    (or nosqueeze (delete-horizontal-space))
 		  ;; Replace whitespace here with one newline, then indent to left
 		  ;; margin.