aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-07-29 23:56:17 +0000
committerRichard M. Stallman1995-07-29 23:56:17 +0000
commit2be0173802b140b1a79320b63f7fb7b2db1f6f3f (patch)
treea44a9ac81b249792cae696130fc670b7c2dba85c
parent24b5caec3468a764a414e7b090ab86caa4df47f0 (diff)
downloademacs-2be0173802b140b1a79320b63f7fb7b2db1f6f3f.tar.gz
emacs-2be0173802b140b1a79320b63f7fb7b2db1f6f3f.zip
(forward-paragraph): Don't move back over a line
before the paragraph which doesn't start with fill-prefix unless that is the only line we've moved over.
-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.