From 9980ebf354c53717846c37d459d186f2dc4e063f Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 27 Aug 2011 11:14:50 +0000 Subject: [PATCH] textmodes/paragraphs.el. Undo previous accidental patch. --- lisp/textmodes/paragraphs.el | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 59454043c4e..a0892b5ebba 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -456,25 +456,21 @@ sentences. Also, every paragraph boundary terminates sentences as well." (sentence-end (sentence-end))) (while (< arg 0) (let ((pos (point)) - (par-beg - (save-excursion - (start-of-paragraph-text) - ;; Move PAR-BEG back over indentation - ;; to allow s1entence-end to match if it is anchored at - ;; BOL and the paragraph starts indented. - (beginning-of-line) - (point)))) - (if (and (re-search-backward sentence-end par-beg t) - (or (< (match-end 0) pos) - (re-search-backward sentence-end par-beg t))) - (goto-char (match-end 0)) - (goto-char par-beg))) + ;; We used to use (start-of-paragraph-text), but this can + ;; prevent sentence-end from matching if it is anchored at + ;; BOL and the paragraph starts indented. + (par-beg (save-excursion (backward-paragraph) (point)))) + (if (and (re-search-backward sentence-end par-beg t) + (or (< (match-end 0) pos) + (re-search-backward sentence-end par-beg t))) + (goto-char (match-end 0)) + (goto-char par-beg))) (setq arg (1+ arg))) (while (> arg 0) (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) - (if (re-search-forward sentence-end par-end t) - (skip-chars-backward " \t\n") - (goto-char par-end))) + (if (re-search-forward sentence-end par-end t) + (skip-chars-backward " \t\n") + (goto-char par-end))) (setq arg (1- arg))) (constrain-to-field nil opoint t))) -- 2.39.2