changeset 47779:d53b71650f3b

(fill-paragraph): Go to BOL before calling forward-paragraph to make sure its return value is meaningful.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 07 Oct 2002 13:54:44 +0000
parents af8ff2a92902
children 27caec378c23
files lisp/textmodes/fill.el
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Mon Oct 07 04:00:07 2002 +0000
+++ b/lisp/textmodes/fill.el	Mon Oct 07 13:54:44 2002 +0000
@@ -697,6 +697,12 @@
 	    ;; Fill prefix used for filling the paragraph.
 	    fill-pfx)
 	(save-excursion
+	  ;; To make sure the return value of forward-paragraph is meaningful,
+	  ;; we have to start from the beginning of line, otherwise skipping
+	  ;; past the last few chars of a paragraph-separator would count as
+	  ;; a paragraph (and not skipping any chars at EOB would not count
+	  ;; as a paragraph even if it is).
+	  (move-to-left-margin)
 	  (if (not (zerop (forward-paragraph)))
 	      ;; There's no paragraph at or after point: give up.
 	      (setq fill-pfx "")