diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-07-29 23:56:17 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-07-29 23:56:17 +0000 |
commit | 2be0173802b140b1a79320b63f7fb7b2db1f6f3f (patch) | |
tree | a44a9ac81b249792cae696130fc670b7c2dba85c /lisp/textmodes/paragraphs.el | |
parent | 24b5caec3468a764a414e7b090ab86caa4df47f0 (diff) | |
download | emacs-2be0173802b140b1a79320b63f7fb7b2db1f6f3f.tar.gz emacs-2be0173802b140b1a79320b63f7fb7b2db1f6f3f.tar.bz2 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.
Diffstat (limited to 'lisp/textmodes/paragraphs.el')
-rw-r--r-- | lisp/textmodes/paragraphs.el | 14 |
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." (re-search-backward "^\n" (max (1- (point)) (point-min)) t) (looking-at paragraph-separate)) nil + (setq start (point)) ;; Move back over paragraph-separating lines. (forward-char -1) (beginning-of-line) (while (and (not (bobp)) @@ -140,13 +141,22 @@ to which the end of the previous line belongs, or the end of the buffer." ;; Search back for line that starts or separates paragraphs. (if (if fill-prefix-regexp ;; There is a fill prefix; it overrides paragraph-start. - (progn + (let (multiple-lines) (while (and (progn (beginning-of-line) (not (bobp))) (progn (move-to-left-margin) (not (looking-at paragraph-separate))) (looking-at fill-prefix-regexp)) + (if (not (= (point) start)) + (setq multiple-lines t)) (forward-line -1)) - (not (bobp))) + (move-to-left-margin) + ;; 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. + (and (not (looking-at fill-prefix-regexp)) + multiple-lines + (forward-line 1)) + (not (bobp))) (while (and (re-search-backward sp-paragraph-start nil 1) ;; Found a candidate, but need to check if it is a ;; REAL paragraph-start. |