diff options
| author | Richard M. Stallman | 1992-10-18 22:56:00 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-10-18 22:56:00 +0000 |
| commit | 2247b0fc583c4350007d2201bf28b05e82256c7d (patch) | |
| tree | 75a61c7936909d351eb28fe3442b222974cf56c5 | |
| parent | 1ddea2ab1f1991b38c94807768b51b87dd42a4e4 (diff) | |
| download | emacs-2247b0fc583c4350007d2201bf28b05e82256c7d.tar.gz emacs-2247b0fc583c4350007d2201bf28b05e82256c7d.zip | |
(kill-sentence, backward-kill-sentence):
(kill-paragraph, backward-kill-paragraph):
Don't change point before calling kill-region.
| -rw-r--r-- | lisp/textmodes/paragraphs.el | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 66e48080bb4..3147367b9ce 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -133,14 +133,14 @@ The paragraph marked is the one that contains point or follows point." | |||
| 133 | With arg N, kill forward to Nth end of paragraph; | 133 | With arg N, kill forward to Nth end of paragraph; |
| 134 | negative arg -N means kill backward to Nth start of paragraph." | 134 | negative arg -N means kill backward to Nth start of paragraph." |
| 135 | (interactive "p") | 135 | (interactive "p") |
| 136 | (kill-region (point) (progn (forward-paragraph arg) (point)))) | 136 | (kill-region (point) (save-excursion (forward-paragraph arg) (point)))) |
| 137 | 137 | ||
| 138 | (defun backward-kill-paragraph (arg) | 138 | (defun backward-kill-paragraph (arg) |
| 139 | "Kill back to start of paragraph. | 139 | "Kill back to start of paragraph. |
| 140 | With arg N, kill back to Nth start of paragraph; | 140 | With arg N, kill back to Nth start of paragraph; |
| 141 | negative arg -N means kill forward to Nth end of paragraph." | 141 | negative arg -N means kill forward to Nth end of paragraph." |
| 142 | (interactive "p") | 142 | (interactive "p") |
| 143 | (kill-region (point) (progn (backward-paragraph arg) (point)))) | 143 | (kill-region (point) (save-excursion (backward-paragraph arg) (point)))) |
| 144 | 144 | ||
| 145 | (defun transpose-paragraphs (arg) | 145 | (defun transpose-paragraphs (arg) |
| 146 | "Interchange this (or next) paragraph with previous one." | 146 | "Interchange this (or next) paragraph with previous one." |
| @@ -204,17 +204,13 @@ See `forward-sentence' for more information." | |||
| 204 | "Kill from point to end of sentence. | 204 | "Kill from point to end of sentence. |
| 205 | With arg, repeat; negative arg -N means kill back to Nth start of sentence." | 205 | With arg, repeat; negative arg -N means kill back to Nth start of sentence." |
| 206 | (interactive "*p") | 206 | (interactive "*p") |
| 207 | (let ((beg (point))) | 207 | (kill-region (point) (save-excursion (forward-sentence arg) (point)))) |
| 208 | (forward-sentence arg) | ||
| 209 | (kill-region beg (point)))) | ||
| 210 | 208 | ||
| 211 | (defun backward-kill-sentence (&optional arg) | 209 | (defun backward-kill-sentence (&optional arg) |
| 212 | "Kill back from point to start of sentence. | 210 | "Kill back from point to start of sentence. |
| 213 | With arg, repeat, or kill forward to Nth end of sentence if negative arg -N." | 211 | With arg, repeat, or kill forward to Nth end of sentence if negative arg -N." |
| 214 | (interactive "*p") | 212 | (interactive "*p") |
| 215 | (let ((beg (point))) | 213 | (kill-region (point) (save-excursion (forward-sentence arg) (point)))) |
| 216 | (backward-sentence arg) | ||
| 217 | (kill-region beg (point)))) | ||
| 218 | 214 | ||
| 219 | (defun mark-end-of-sentence (arg) | 215 | (defun mark-end-of-sentence (arg) |
| 220 | "Put mark at end of sentence. Arg works as in `forward-sentence'." | 216 | "Put mark at end of sentence. Arg works as in `forward-sentence'." |