summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-11-18 16:46:53 +0000
committerRichard M. Stallman <rms@gnu.org>1995-11-18 16:46:53 +0000
commita36bcceca7c8c943efec126b5d9969ac0f29573b (patch)
treea22ecf4e15d8f8d51b7e9257613dce077ed16389
parent79e79fa1508aba17d50dd06291b7472a7f2177f8 (diff)
downloademacs-a36bcceca7c8c943efec126b5d9969ac0f29573b.tar.gz
(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.
-rw-r--r--lisp/simple.el13
1 files 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.