15 |
also be used for moving those units. But there are other ways of |
also be used for moving those units. But there are other ways of |
16 |
copying text for special purposes. |
copying text for special purposes. |
17 |
|
|
18 |
|
On terminals that support multiple windows for multiple applications, |
19 |
|
the kill commands also provide a way to select text for other applications |
20 |
|
to copy, and the Emacs yank commands can access selections made by |
21 |
|
other programs. |
22 |
|
|
23 |
Emacs has only one kill ring for all buffers, so you can kill text in |
Emacs has only one kill ring for all buffers, so you can kill text in |
24 |
one buffer and yank it in another buffer. |
one buffer and yank it in another buffer. |
25 |
|
|
59 |
individual descriptions use the words @samp{kill} and @samp{delete} to |
individual descriptions use the words @samp{kill} and @samp{delete} to |
60 |
say which kind of operation they perform. |
say which kind of operation they perform. |
61 |
|
|
62 |
|
On window systems, the most recent kill done in Emacs is also the |
63 |
|
primary selection, if it is more recent than any selection you made in |
64 |
|
another program. This means that the paste commands of other window |
65 |
|
applications copy the text that you killed in Emacs. |
66 |
|
|
67 |
@cindex Delete Selection mode |
@cindex Delete Selection mode |
68 |
@cindex mode, Delete Selection |
@cindex mode, Delete Selection |
69 |
@findex delete-selection-mode |
@findex delete-selection-mode |
80 |
blank areas. |
blank areas. |
81 |
* Killing by Lines:: How to kill entire lines of text at one time. |
* Killing by Lines:: How to kill entire lines of text at one time. |
82 |
* Other Kill Commands:: Commands to kill large regions of text and |
* Other Kill Commands:: Commands to kill large regions of text and |
83 |
syntactic units such as words and sentences. |
syntactic units such as words and sentences. |
84 |
@end menu |
@end menu |
85 |
|
|
86 |
@need 1500 |
@need 1500 |
289 |
Append next kill to last batch of killed text (@code{append-next-kill}). |
Append next kill to last batch of killed text (@code{append-next-kill}). |
290 |
@end table |
@end table |
291 |
|
|
292 |
|
On window systems, if there is a current selection in some other |
293 |
|
application, and you selected it more recently than you killed any |
294 |
|
text in Emacs, @kbd{C-y} copies the selection instead of text |
295 |
|
killed within Emacs. |
296 |
|
|
297 |
@menu |
@menu |
298 |
* Kill Ring:: Where killed text is stored. Basic yanking. |
* Kill Ring:: Where killed text is stored. Basic yanking. |
299 |
* Appending Kills:: Several kills in a row all yank together. |
* Appending Kills:: Several kills in a row all yank together. |
320 |
a @kbd{C-u}, precisely. Any other sort of argument, including @kbd{C-u} |
a @kbd{C-u}, precisely. Any other sort of argument, including @kbd{C-u} |
321 |
and digits, specifies an earlier kill to yank (@pxref{Earlier Kills}). |
and digits, specifies an earlier kill to yank (@pxref{Earlier Kills}). |
322 |
|
|
323 |
|
@cindex yanking and text properties |
324 |
|
@vindex yank-excluded-properties |
325 |
|
The yank commands discard certain text properties from the text that |
326 |
|
is yanked, those that might lead to annoying results. For instance, |
327 |
|
they discard text properties that respond to the mouse or specify key |
328 |
|
bindings. The variable @code{yank-excluded-properties} specifies the |
329 |
|
properties to discard. Yanking of register contents and rectangles |
330 |
|
also discard these properties. |
331 |
|
|
332 |
@kindex M-w |
@kindex M-w |
333 |
@findex kill-ring-save |
@findex kill-ring-save |
334 |
To copy a block of text, you can use @kbd{M-w} |
To copy a block of text, you can use @kbd{M-w} |
550 |
|
|
551 |
@table @kbd |
@table @kbd |
552 |
@item C-x r k |
@item C-x r k |
553 |
Kill the text of the region-rectangle, saving its contents as the |
Kill the text of the region-rectangle, saving its contents as the |
554 |
``last killed rectangle'' (@code{kill-rectangle}). |
``last killed rectangle'' (@code{kill-rectangle}). |
555 |
@item C-x r d |
@item C-x r d |
556 |
Delete the text of the region-rectangle (@code{delete-rectangle}). |
Delete the text of the region-rectangle (@code{delete-rectangle}). |
561 |
Insert blank space to fill the space of the region-rectangle |
Insert blank space to fill the space of the region-rectangle |
562 |
(@code{open-rectangle}). This pushes the previous contents of the |
(@code{open-rectangle}). This pushes the previous contents of the |
563 |
region-rectangle rightward. |
region-rectangle rightward. |
564 |
@item M-x clear-rectangle |
@item C-x r c |
565 |
Clear the region-rectangle by replacing its contents with spaces. |
Clear the region-rectangle by replacing its contents with spaces |
566 |
|
(@code{clear-rectangle}). |
567 |
@item M-x delete-whitespace-rectangle |
@item M-x delete-whitespace-rectangle |
568 |
Delete whitespace in each of the lines on the specified rectangle, |
Delete whitespace in each of the lines on the specified rectangle, |
569 |
starting from the left edge column of the rectangle. |
starting from the left edge column of the rectangle. |
616 |
|
|
617 |
@kindex C-x r o |
@kindex C-x r o |
618 |
@findex open-rectangle |
@findex open-rectangle |
619 |
|
@kindex C-x r c |
620 |
@findex clear-rectangle |
@findex clear-rectangle |
621 |
There are two commands you can use for making blank rectangles: |
There are two commands you can use for making blank rectangles: |
622 |
@kbd{M-x clear-rectangle} which blanks out existing text, and @kbd{C-x r |
@kbd{C-x r c} (@code{clear-rectangle}) which blanks out existing text, |
623 |
o} (@code{open-rectangle}) which inserts a blank rectangle. Clearing a |
and @kbd{C-x r o} (@code{open-rectangle}) which inserts a blank |
624 |
rectangle is equivalent to deleting it and then inserting a blank |
rectangle. Clearing a rectangle is equivalent to deleting it and then |
625 |
rectangle of the same size. |
inserting a blank rectangle of the same size. |
626 |
|
|
627 |
@findex delete-whitespace-rectangle |
@findex delete-whitespace-rectangle |
628 |
The command @kbd{M-x delete-whitespace-rectangle} deletes horizontal |
The command @kbd{M-x delete-whitespace-rectangle} deletes horizontal |
641 |
rectangle shifts right. |
rectangle shifts right. |
642 |
|
|
643 |
@findex string-insert-rectangle |
@findex string-insert-rectangle |
644 |
The command @kbd{M-x string-insert-rectangle} is similar to |
The command @kbd{M-x string-insert-rectangle} is similar to |
645 |
@code{string-rectangle}, but inserts the string on each line, |
@code{string-rectangle}, but inserts the string on each line, |
646 |
shifting the original text to the right. |
shifting the original text to the right. |