- (re-search-backward "^\n" (max (1- (point)) (point-min)) t)
- (looking-at parsep))
- (setq arg (1+ arg))
- (setq start (point))
- ;; Move back over paragraph-separating lines.
- (forward-char -1) (beginning-of-line)
- (while (and (not (bobp))
- (progn (move-to-left-margin)
- (looking-at parsep)))
- (forward-line -1))
- (if (bobp)
- nil
- (setq arg (1+ arg))
- ;; Go to end of the previous (non-separating) line.
- (end-of-line)
- ;; Search back for line that starts or separates paragraphs.
- (if (if fill-prefix-regexp
- ;; There is a fill prefix; it overrides parstart.
- (let (multiple-lines)
- (while (and (progn (beginning-of-line) (not (bobp)))
- (progn (move-to-left-margin)
- (not (looking-at parsep)))
- (looking-at fill-prefix-regexp))
- (unless (= (point) start)
- (setq multiple-lines t))
- (forward-line -1))
- (move-to-left-margin)
- ;; This deleted code caused a long hanging-indent line
- ;; not to be filled together with the following lines.
- ;; ;; 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-parstart nil 1)
- (setq found-start t)
- ;; Found a candidate, but need to check if it is a
- ;; REAL parstart.
- (progn (setq start (point))
- (move-to-left-margin)
- (not (looking-at parsep)))
- (not (and (looking-at parstart)
- (or (not use-hard-newlines)
- (bobp)
- (get-text-property
- (1- start) 'hard)))))
- (setq found-start nil)
- (goto-char start))
- found-start)
- ;; Found one.
- (progn
- ;; Move forward over paragraph separators.
- ;; We know this cannot reach the place we started
- ;; because we know we moved back over a non-separator.
- (while (and (not (eobp))
- (progn (move-to-left-margin)
- (looking-at parsep)))
- (forward-line 1))
- ;; If line before paragraph is just margin, back up to there.
- (end-of-line 0)
- (if (> (current-column) (current-left-margin))
- (forward-char 1)
- (skip-chars-backward " \t")
- (if (not (bolp))
- (forward-line 1))))
- ;; No starter or separator line => use buffer beg.
- (goto-char (point-min))))))
+ (re-search-backward "^\n" (max (1- (point)) (point-min)) t)
+ (looking-at parsep))
+ (setq arg (1+ arg))
+ (setq start (point))
+ ;; Move back over paragraph-separating lines.
+ (forward-char -1) (beginning-of-line)
+ (while (and (not (bobp))
+ (progn (move-to-left-margin)
+ (looking-at parsep)))
+ (forward-line -1))
+ (if (bobp)
+ nil
+ (setq arg (1+ arg))
+ ;; Go to end of the previous (non-separating) line.
+ (end-of-line)
+ ;; Search back for line that starts or separates paragraphs.
+ (if (if fill-prefix-regexp
+ ;; There is a fill prefix; it overrides parstart.
+ (let (multiple-lines)
+ (while (and (progn (beginning-of-line) (not (bobp)))
+ (progn (move-to-left-margin)
+ (not (looking-at parsep)))
+ (looking-at fill-prefix-regexp))
+ (unless (= (point) start)
+ (setq multiple-lines t))
+ (forward-line -1))
+ (move-to-left-margin)
+ ;; This deleted code caused a long hanging-indent line
+ ;; not to be filled together with the following lines.
+ ;; ;; 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-parstart nil 1)
+ (setq found-start t)
+ ;; Found a candidate, but need to check if it is a
+ ;; REAL parstart.
+ (progn (setq start (point))
+ (move-to-left-margin)
+ (not (looking-at parsep)))
+ (not (and (looking-at parstart)
+ (or (not use-hard-newlines)
+ (bobp)
+ (get-text-property
+ (1- start) 'hard)))))
+ (setq found-start nil)
+ (goto-char start))
+ found-start)
+ ;; Found one.
+ (progn
+ ;; Move forward over paragraph separators.
+ ;; We know this cannot reach the place we started
+ ;; because we know we moved back over a non-separator.
+ (while (and (not (eobp))
+ (progn (move-to-left-margin)
+ (looking-at parsep)))
+ (forward-line 1))
+ ;; If line before paragraph is just margin, back up to there.
+ (end-of-line 0)
+ (if (> (current-column) (current-left-margin))
+ (forward-char 1)
+ (skip-chars-backward " \t")
+ (if (not (bolp))
+ (forward-line 1))))
+ ;; No starter or separator line => use buffer beg.
+ (goto-char (point-min))))))