summaryrefslogtreecommitdiff
path: root/lisp/simple.el
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
commite4b62d7c109baabff4351208334be2f7890a69c2 (patch)
tree63dbe9d232ef3fe28186c616b875d0d04ca91c5c /lisp/simple.el
parent0bcfa3ac91f3aec6e792125d24a05f17ccf0f91c (diff)
downloademacs-e4b62d7c109baabff4351208334be2f7890a69c2.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.
Diffstat (limited to 'lisp/simple.el')
-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.