diff options
| -rw-r--r-- | lisp/textmodes/paragraphs.el | 28 |
1 files 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." | |||
| 456 | (sentence-end (sentence-end))) | 456 | (sentence-end (sentence-end))) |
| 457 | (while (< arg 0) | 457 | (while (< arg 0) |
| 458 | (let ((pos (point)) | 458 | (let ((pos (point)) |
| 459 | (par-beg | 459 | ;; We used to use (start-of-paragraph-text), but this can |
| 460 | (save-excursion | 460 | ;; prevent sentence-end from matching if it is anchored at |
| 461 | (start-of-paragraph-text) | 461 | ;; BOL and the paragraph starts indented. |
| 462 | ;; Move PAR-BEG back over indentation | 462 | (par-beg (save-excursion (backward-paragraph) (point)))) |
| 463 | ;; to allow s1entence-end to match if it is anchored at | 463 | (if (and (re-search-backward sentence-end par-beg t) |
| 464 | ;; BOL and the paragraph starts indented. | 464 | (or (< (match-end 0) pos) |
| 465 | (beginning-of-line) | 465 | (re-search-backward sentence-end par-beg t))) |
| 466 | (point)))) | 466 | (goto-char (match-end 0)) |
| 467 | (if (and (re-search-backward sentence-end par-beg t) | 467 | (goto-char par-beg))) |
| 468 | (or (< (match-end 0) pos) | ||
| 469 | (re-search-backward sentence-end par-beg t))) | ||
| 470 | (goto-char (match-end 0)) | ||
| 471 | (goto-char par-beg))) | ||
| 472 | (setq arg (1+ arg))) | 468 | (setq arg (1+ arg))) |
| 473 | (while (> arg 0) | 469 | (while (> arg 0) |
| 474 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) | 470 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) |
| 475 | (if (re-search-forward sentence-end par-end t) | 471 | (if (re-search-forward sentence-end par-end t) |
| 476 | (skip-chars-backward " \t\n") | 472 | (skip-chars-backward " \t\n") |
| 477 | (goto-char par-end))) | 473 | (goto-char par-end))) |
| 478 | (setq arg (1- arg))) | 474 | (setq arg (1- arg))) |
| 479 | (constrain-to-field nil opoint t))) | 475 | (constrain-to-field nil opoint t))) |
| 480 | 476 | ||