aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/textmodes/paragraphs.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 2fc46f6991b..65372363661 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -127,6 +127,7 @@ to which the end of the previous line belongs, or the end of the buffer."
127 (re-search-backward "^\n" (max (1- (point)) (point-min)) t) 127 (re-search-backward "^\n" (max (1- (point)) (point-min)) t)
128 (looking-at paragraph-separate)) 128 (looking-at paragraph-separate))
129 nil 129 nil
130 (setq start (point))
130 ;; Move back over paragraph-separating lines. 131 ;; Move back over paragraph-separating lines.
131 (forward-char -1) (beginning-of-line) 132 (forward-char -1) (beginning-of-line)
132 (while (and (not (bobp)) 133 (while (and (not (bobp))
@@ -140,13 +141,22 @@ to which the end of the previous line belongs, or the end of the buffer."
140 ;; Search back for line that starts or separates paragraphs. 141 ;; Search back for line that starts or separates paragraphs.
141 (if (if fill-prefix-regexp 142 (if (if fill-prefix-regexp
142 ;; There is a fill prefix; it overrides paragraph-start. 143 ;; There is a fill prefix; it overrides paragraph-start.
143 (progn 144 (let (multiple-lines)
144 (while (and (progn (beginning-of-line) (not (bobp))) 145 (while (and (progn (beginning-of-line) (not (bobp)))
145 (progn (move-to-left-margin) 146 (progn (move-to-left-margin)
146 (not (looking-at paragraph-separate))) 147 (not (looking-at paragraph-separate)))
147 (looking-at fill-prefix-regexp)) 148 (looking-at fill-prefix-regexp))
149 (if (not (= (point) start))
150 (setq multiple-lines t))
148 (forward-line -1)) 151 (forward-line -1))
149 (not (bobp))) 152 (move-to-left-margin)
153 ;; Don't move back over a line before the paragraph
154 ;; which doesn't start with fill-prefix
155 ;; unless that is the only line we've moved over.
156 (and (not (looking-at fill-prefix-regexp))
157 multiple-lines
158 (forward-line 1))
159 (not (bobp)))
150 (while (and (re-search-backward sp-paragraph-start nil 1) 160 (while (and (re-search-backward sp-paragraph-start nil 1)
151 ;; Found a candidate, but need to check if it is a 161 ;; Found a candidate, but need to check if it is a
152 ;; REAL paragraph-start. 162 ;; REAL paragraph-start.