diff options
| author | Richard M. Stallman | 2011-09-22 09:34:02 -0400 |
|---|---|---|
| committer | Richard M. Stallman | 2011-09-22 09:34:02 -0400 |
| commit | 8f0985161467a7018ba08ccf7c9f37cc7fc3edfe (patch) | |
| tree | 9e1c84e6596d8c444e1881df150130da3316f0ec | |
| parent | e74f1bb6f82eef5bc4909f25b5c10d8e7bffc090 (diff) | |
| download | emacs-8f0985161467a7018ba08ccf7c9f37cc7fc3edfe.tar.gz emacs-8f0985161467a7018ba08ccf7c9f37cc7fc3edfe.zip | |
Fix bug that C-x DEL deleted a newline before paragraph.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/textmodes/paragraphs.el | 28 |
2 files changed, 21 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 013df43f3b7..5278fb3a6bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-09-22 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * textmodes/paragraphs.el (forward-sentence): When setting PAR-BEG, | ||
| 4 | move back only to line beg, don't move back over blank lines. | ||
| 5 | |||
| 1 | 2011-09-22 Michael Albinus <michael.albinus@gmx.de> | 6 | 2011-09-22 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * files.el (copy-directory): Set directory attributes only in case | 8 | * files.el (copy-directory): Set directory attributes only in case |
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index a0892b5ebba..59454043c4e 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -456,21 +456,25 @@ 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 | ;; We used to use (start-of-paragraph-text), but this can | 459 | (par-beg |
| 460 | ;; prevent sentence-end from matching if it is anchored at | 460 | (save-excursion |
| 461 | ;; BOL and the paragraph starts indented. | 461 | (start-of-paragraph-text) |
| 462 | (par-beg (save-excursion (backward-paragraph) (point)))) | 462 | ;; Move PAR-BEG back over indentation |
| 463 | (if (and (re-search-backward sentence-end par-beg t) | 463 | ;; to allow s1entence-end to match if it is anchored at |
| 464 | (or (< (match-end 0) pos) | 464 | ;; BOL and the paragraph starts indented. |
| 465 | (re-search-backward sentence-end par-beg t))) | 465 | (beginning-of-line) |
| 466 | (goto-char (match-end 0)) | 466 | (point)))) |
| 467 | (goto-char par-beg))) | 467 | (if (and (re-search-backward sentence-end par-beg t) |
| 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))) | ||
| 468 | (setq arg (1+ arg))) | 472 | (setq arg (1+ arg))) |
| 469 | (while (> arg 0) | 473 | (while (> arg 0) |
| 470 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) | 474 | (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) |
| 471 | (if (re-search-forward sentence-end par-end t) | 475 | (if (re-search-forward sentence-end par-end t) |
| 472 | (skip-chars-backward " \t\n") | 476 | (skip-chars-backward " \t\n") |
| 473 | (goto-char par-end))) | 477 | (goto-char par-end))) |
| 474 | (setq arg (1- arg))) | 478 | (setq arg (1- arg))) |
| 475 | (constrain-to-field nil opoint t))) | 479 | (constrain-to-field nil opoint t))) |
| 476 | 480 | ||