From e4b62d7c109baabff4351208334be2f7890a69c2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 18 Nov 1995 16:46:53 +0000 Subject: [PATCH] (do-auto-fill): Look at 2nd line for fill prefix even when on the first line. Don't accept non-whitespace prefix from the first line. (do-auto-fill): Ignore the result of fill-context-prefix if it is empty. --- lisp/simple.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 9d34a467d96..fa442280255 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2331,10 +2331,15 @@ Setting this variable automatically makes it local to the current buffer.") ;; Choose a fill-prefix automatically. (if (and adaptive-fill-mode (or (null fill-prefix) (string= fill-prefix ""))) - (setq fill-prefix - (fill-context-prefix - (save-excursion (backward-paragraph 1) (point)) - (point)))) + (let ((prefix + (fill-context-prefix + (save-excursion (backward-paragraph 1) (point)) + (save-excursion (forward-paragraph 1) (point)) + ;; Don't accept a non-whitespace fill prefix + ;; from the first line of a paragraph. + "^[ \t]*$"))) + (and prefix (not (equal prefix "")) + (setq fill-prefix prefix)))) (while (and (not give-up) (> (current-column) fc)) ;; Determine where to split the line. -- 2.39.2