From: Stefan Monnier Date: Mon, 7 Oct 2002 13:54:44 +0000 (+0000) Subject: (fill-paragraph): Go to BOL before calling forward-paragraph to make X-Git-Tag: ttn-vms-21-2-B4~12922 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8748595969efc939ff0645323717d0e0279c54d4;p=emacs.git (fill-paragraph): Go to BOL before calling forward-paragraph to make sure its return value is meaningful. --- diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 0bf4b3e5cef..d8ba7f076c1 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -697,6 +697,12 @@ If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling." ;; 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 "")