diff options
| author | Richard M. Stallman | 2001-02-17 17:35:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-02-17 17:35:47 +0000 |
| commit | bdb678d27594988945cd4d62b2d0be398f1be77e (patch) | |
| tree | 913e9aa01946dc61b889093e12b6a579c1581d3b | |
| parent | 80d7cf559e6c5e77055d268d8c38b5b4d7606b1c (diff) | |
| download | emacs-bdb678d27594988945cd4d62b2d0be398f1be77e.tar.gz emacs-bdb678d27594988945cd4d62b2d0be398f1be77e.zip | |
Rewrite kill-read-only-ok, Delete Selection mode, replace-rectangle.
| -rw-r--r-- | man/killing.texi | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/man/killing.texi b/man/killing.texi index c297622188f..ec14dc87d7e 100644 --- a/man/killing.texi +++ b/man/killing.texi | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | @c This is part of the Emacs manual. | 1 | @c This is part of the Emacs manual. |
| 2 | @c Copyright (C) 1985,86,87,93,94,95,97,2000 Free Software Foundation, Inc. | 2 | @c Copyright (C) 1985,86,87,93,94,95,97,00,2001 Free Software Foundation, Inc. |
| 3 | @c See file emacs.texi for copying conditions. | 3 | @c See file emacs.texi for copying conditions. |
| 4 | @iftex | 4 | @iftex |
| 5 | @chapter Killing and Moving Text | 5 | @chapter Killing and Moving Text |
| @@ -37,15 +37,14 @@ can use the @kbd{C-x u} (@code{undo}) command to undo it | |||
| 37 | 37 | ||
| 38 | @vindex kill-read-only-ok | 38 | @vindex kill-read-only-ok |
| 39 | @cindex read-only text, killing | 39 | @cindex read-only text, killing |
| 40 | By default, Emacs does not allow to kill text in read-only buffers. | 40 | You cannot kill read-only text, since such text does not allow any |
| 41 | Setting the variable @code{kill-read-only-ok} to a non-@code{nil} value | 41 | kind of modification. But some users like to use the kill commands to |
| 42 | overrides that. To alert you to the fact that you killed read-only | 42 | copy read-only text into the kill ring, without actually changing it. |
| 43 | text, Emacs prints a message to that effect in the echo area. | 43 | If you set the variable @code{kill-read-only-ok} to a non-@code{nil} |
| 44 | 44 | value, the kill commands work specially in a read-only buffer: they | |
| 45 | When @code{kill-read-only-ok} is @code{nil}, Emacs beeps if you try to | 45 | move over text, and copy it to the kill ring, without actually |
| 46 | kill text in a read-only buffers, but it puts the text you wanted to | 46 | deleting it from the buffer. When this happens, a message in the echo |
| 47 | kill into the kill ring anyway. This means you can use kill commands to | 47 | area tells you what is happening. |
| 48 | copy text from read-only buffers. | ||
| 49 | 48 | ||
| 50 | The delete commands include @kbd{C-d} (@code{delete-char}) and | 49 | The delete commands include @kbd{C-d} (@code{delete-char}) and |
| 51 | @key{DEL} (@code{delete-backward-char}), which delete only one character at | 50 | @key{DEL} (@code{delete-backward-char}), which delete only one character at |
| @@ -57,12 +56,13 @@ and @samp{delete} to say which they do. | |||
| 57 | @cindex Delete Selection mode | 56 | @cindex Delete Selection mode |
| 58 | @cindex mode, Delete Selection | 57 | @cindex mode, Delete Selection |
| 59 | @findex delete-selection-mode | 58 | @findex delete-selection-mode |
| 60 | You can arrange for selected text to be killed when you insert something | 59 | Many window systems follow the convention that insertion while text |
| 61 | and replaced by what you insert; this is the way many text interfaces | 60 | is selected deletes the selected text. You can make Emacs behave this |
| 62 | work. To do this turn on Delete Selection mode. with @kbd{M-x | 61 | way by enabling Delete Selection mode, with @kbd{M-x |
| 63 | delete-selection-mode} or using Custom. Also in Delete Selection mode | 62 | delete-selection-mode}, or using Custom. Another effect of this mode |
| 64 | @key{DEL}, @kbd{C-d} and some other keys will just kill the whole | 63 | is that @key{DEL}, @kbd{C-d} and some other keys, when a selection |
| 65 | selection and Transient Mark mode is turned on (@pxref{Transient Mark}). | 64 | exists, will kill the whole selection. It also enables Transient Mark |
| 65 | mode (@pxref{Transient Mark}). | ||
| 66 | 66 | ||
| 67 | @menu | 67 | @menu |
| 68 | * Deletion:: Commands for deleting small amounts of text and | 68 | * Deletion:: Commands for deleting small amounts of text and |
| @@ -502,6 +502,9 @@ starting from the left edge column of the rectangle. | |||
| 502 | @item C-x r t @var{string} @key{RET} | 502 | @item C-x r t @var{string} @key{RET} |
| 503 | Insert @var{string} on each line of the region-rectangle | 503 | Insert @var{string} on each line of the region-rectangle |
| 504 | (@code{string-rectangle}). | 504 | (@code{string-rectangle}). |
| 505 | @item M-x replace-rectangle @key{RET} @var{string} @key{RET} | ||
| 506 | Replaces each line of the region-rectangle with @var{string} | ||
| 507 | (@code{string-rectangle}). | ||
| 505 | @end table | 508 | @end table |
| 506 | 509 | ||
| 507 | The rectangle operations fall into two classes: commands deleting and | 510 | The rectangle operations fall into two classes: commands deleting and |
| @@ -562,13 +565,13 @@ any difference to this command. | |||
| 562 | 565 | ||
| 563 | @kindex C-x r t | 566 | @kindex C-x r t |
| 564 | @findex string-rectangle | 567 | @findex string-rectangle |
| 565 | The command @kbd{C-x r t} (@code{M-x string-rectangle}) inserts a | 568 | The command @kbd{C-x r t} (@code{M-x string-rectangle}) inserts a |
| 566 | string on each line of the region-rectangle before the rectangle, | 569 | string on each line of the region-rectangle before the rectangle, |
| 567 | shifting text right. | 570 | shifting text right. |
| 568 | 571 | ||
| 569 | @findex replace-rectangle | 572 | @findex replace-rectangle |
| 570 | The command @kbd{M-x replace-rectangle} is similar, but replaces the | 573 | The command @kbd{M-x replace-rectangle} is similar to @kbd{C-x r t}, |
| 571 | original rectangle. The string's width need not be the same as the | 574 | but replaces the original rectangle. The string's width need not be |
| 572 | width of the rectangle. If the string's width is less, the text after | 575 | the same as the width of the rectangle. If the string's width is |
| 573 | the rectangle shifts left; if the string is wider than the rectangle, | 576 | less, the text after the rectangle shifts left; if the string is wider |
| 574 | the text after the rectangle shifts right. | 577 | than the rectangle, the text after the rectangle shifts right. |