]> git.eshelyaron.com Git - emacs.git/commitdiff
(fill-paragraph): Go to BOL before calling forward-paragraph to make
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 7 Oct 2002 13:54:44 +0000 (13:54 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 7 Oct 2002 13:54:44 +0000 (13:54 +0000)
sure its return value is meaningful.

lisp/textmodes/fill.el

index 0bf4b3e5cefaca7c5d32b1ff15ffe3cc47986429..d8ba7f076c16d65195c618b9aede2c026e521f03 100644 (file)
@@ -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 "")