diff options
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/textmodes/paragraphs.el | 22 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c21b12b8de..a7e9afc96c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2011-09-23 Richard Stallman <rms@gnu.org> | 1 | 2011-09-23 Richard Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * textmodes/paragraphs.el (forward-sentence): For backwards case, | ||
| 4 | distinguish start of paragraph from start of its text. | ||
| 5 | |||
| 3 | * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Autoload. | 6 | * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Autoload. |
| 4 | 7 | ||
| 5 | * mail/rmail.el (rmail-view-buffer-kill-buffer-hook): New function. | 8 | * mail/rmail.el (rmail-view-buffer-kill-buffer-hook): New function. |
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 59454043c4e..8fd055f7d87 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -456,19 +456,23 @@ 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 | par-beg par-text-beg) |
| 460 | (save-excursion | 460 | (save-excursion |
| 461 | (start-of-paragraph-text) | 461 | (start-of-paragraph-text) |
| 462 | ;; Move PAR-BEG back over indentation | 462 | ;; Start of real text in the paragraph. |
| 463 | ;; to allow s1entence-end to match if it is anchored at | 463 | ;; We move back to here if we don't see a sentence-end. |
| 464 | ;; BOL and the paragraph starts indented. | 464 | (setq par-text-beg (point)) |
| 465 | (beginning-of-line) | 465 | ;; Start of the first line of the paragraph. |
| 466 | (point)))) | 466 | ;; We use this as the search limit |
| 467 | ;; to allow s1entence-end to match if it is anchored at | ||
| 468 | ;; BOL and the paragraph starts indented. | ||
| 469 | (beginning-of-line) | ||
| 470 | (setq par-beg (point))) | ||
| 467 | (if (and (re-search-backward sentence-end par-beg t) | 471 | (if (and (re-search-backward sentence-end par-beg t) |
| 468 | (or (< (match-end 0) pos) | 472 | (or (< (match-end 0) pos) |
| 469 | (re-search-backward sentence-end par-beg t))) | 473 | (re-search-backward sentence-end par-beg t))) |
| 470 | (goto-char (match-end 0)) | 474 | (goto-char (match-end 0)) |
| 471 | (goto-char par-beg))) | 475 | (goto-char par-text-beg))) |
| 472 | (setq arg (1+ arg))) | 476 | (setq arg (1+ arg))) |
| 473 | (while (> arg 0) | 477 | (while (> arg 0) |
| 474 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) | 478 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) |