File: killing.texi

package info (click to toggle)
emacs-manual-ja 20.5-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,964 kB
  • ctags: 12
  • sloc: lisp: 119; ansic: 69; makefile: 43; sh: 28
file content (975 lines) | stat: -rw-r--r-- 48,981 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
@c =============================================================
@c = $B85(B $BK](B $BLu(B: $B9b<.0l5*!wEE5$DL?.Bg3X(B
@c = $B2CI.=$@5(B: $BBgLZFXM:!wBgDM(B.$BC^GHBg3X(B = 1998/11/25
@c = 20.4$B2~D{(B: $BBgLZFXM:!wBgDM(B.$BC^GHBg3X(B = 1999/09/12
@c =============================================================
@c This is part of the Emacs manual.
@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@iftex
@c @chapter Killing and Moving Text
@chapter $B%F%-%9%H$N%-%k$H0\F0(B

@c   @dfn{Killing} means erasing text and copying it into the @dfn{kill
@c ring}, from which it can be retrieved by @dfn{yanking} it.  Some systems
@c use the terms ``cutting'' and ``pasting'' for these operations.
@dfn{$B%-%k(B}$B!J(Bkill$B!K$H$O!"%F%-%9%H$r>C$7$5$j!"(B
$B$=$l$r(B@dfn{$B%-%k%j%s%0(B}$B!J(Bkill ring$B!K$K%3%T!<$9$k$3$H$r0UL#$7$^$9!#(B
$B%-%k%j%s%0$+$i$O!"(B@dfn{$B%d%s%/(B}$B!J(Byank$B!K$9$k$3$H$G!"(B
$B%F%-%9%H$r<h$j=P$9$3$H$,$G$-$^$9!#(B
$B$3$l$i$NA`:n$r!X%+%C%H!Y$H!X%Z!<%9%H!Y$H8F$V%7%9%F%`$b$"$j$^$9!#(B

@c   The commonest way of moving or copying text within Emacs is to kill it
@c and later yank it elsewhere in one or more places.  This is very safe
@c because Emacs remembers several recent kills, not just the last one.  It
@c is versatile, because the many commands for killing syntactic units can
@c also be used for moving those units.  But there are other ways of
@c copying text for special purposes.
Emacs$B$K$*$$$F%F%-%9%H$r0\F0$7$?$j%3%T!<$7$?$j$9$k$b$C$H$b0lHLE*$JJ}K!$O!"(B
$B%F%-%9%H$r%-%k$7$F!"$"$H$G?t2U=j$K%d%s%/$9$k$3$H$G$9!#(B
$B$3$NJ}K!$O$H$F$b0BA4$G$9!#(B
$B$H$$$&$N$O!"D>A0$N(B1$B2s$N%-%k$@$1$G$J$/!"(B
$B$3$3:G6a$N?t2sJ,$N%-%k$7$?FbMF$r5-O?$7$F$$$k$+$i$G$9!#(B
$B9=J8C10L$G%-%k$9$kB?$/$N%3%^%s%I$O!"(B
$B9=J8C10L$N%F%-%9%H0\F0$K$b;H$($k$N$G!"MQES$,9-$$$H$b$$$($^$9!#(B
$BB>$K$b!"FCJL$JL\E*$N$?$a$K%F%-%9%H$r%3%T!<$9$kJ}K!$,$"$j$^$9!#(B

@c   Emacs has only one kill ring for all buffers, so you can kill text in
@c one buffer and yank it in another buffer.
Emacs$B$K$O!"$9$Y$F$N%P%C%U%!$KBP$7$F$?$C$?(B1$B$D$N%-%k%j%s%0$7$+$"$j$^$;$s!#(B
$B$=$N$?$a!"$"$k%P%C%U%!$G%-%k$7$?%F%-%9%H$r(B
$BJL$N%P%C%U%!$K%d%s%/$G$-$^$9!#(B

@end iftex

@node Killing, Yanking, Mark, Top
@c @section Deletion and Killing
@section $B:o=|$H%-%k(B

@c @cindex killing text
@c @cindex cutting text
@c @cindex deletion
@cindex $B%F%-%9%H$N%-%k(B
@cindex $B%F%-%9%H$N%+%C%H(B
@cindex $B:o=|(B
@c   Most commands which erase text from the buffer save it in the kill
@c ring so that you can move or copy it to other parts of the buffer.
@c These commands are known as @dfn{kill} commands.  The rest of the
@c commands that erase text do not save it in the kill ring; they are known
@c as @dfn{delete} commands.  (This distinction is made only for erasure of
@c text in the buffer.)  If you do a kill or delete command by mistake, you
@c can use the @kbd{C-x u} (@code{undo}) command to undo it
@c (@pxref{Undo}).
$B%P%C%U%!$+$i%F%-%9%H$r>C$7$5$k%3%^%s%I$N$[$H$s$I$O!"(B
$B$=$N%F%-%9%H$r%-%k%j%s%0$K%3%T!<$7$F$*$/$N$G!"(B
$B%P%C%U%!$NB>$NItJ,$K$=$N%F%-%9%H$r0\F0$7$?$j%3%T!<$7$?$j$G$-$^$9!#(B
$B$3$l$i$N%3%^%s%I$r!"(B@dfn{$B%-%k(B}$B!J(Bkill$B!K%3%^%s%I$H8F$S$^$9!#(B
$B$=$l0J30$N!X%F%-%9%H$r>C$9%3%^%s%I!Y$O!"(B
$B%F%-%9%H$r%-%k%j%s%0$KJ]B8$7$^$;$s!#(B
$B$3$l$i$r(B@dfn{$B:o=|(B}$B!J(Bdelete$B!K%3%^%s%I$H8F$S$^$9!#(B
$B!JN><T$r6hJL$9$k$N$O!"%P%C%U%!Fb$N%F%-%9%H$r>C$9>l9g$@$1!#!K(B
$B%-%k%3%^%s%I$d:o=|%3%^%s%I$r8m$C$F<B9T$7$F$7$^$C$?>l9g$K$O!"(B
@kbd{C-x u}$B!J(B@code{undo}$B!K%3%^%s%I$r;H$C$F!"$b$H$KLa$9$3$H$,$G$-$^$9!#(B

@c   The delete commands include @kbd{C-d} (@code{delete-char}) and
@c @key{DEL} (@code{delete-backward-char}), which delete only one character at
@c a time, and those commands that delete only spaces or newlines.  Commands
@c that can destroy significant amounts of nontrivial data generally kill.
@c The commands' names and individual descriptions use the words @samp{kill}
@c and @samp{delete} to say which they do.
$B:o=|%3%^%s%I$K$O!"0lEY$K(B1$B$D$NJ8;z$@$1$r:o=|$9$k(B
@kbd{C-d}$B!J(B@code{delete-char}$B!K$d(B@key{DEL}$B!J(B@code{delete-backward-char}$B!K!"(B
$B6uGr$d2~9T$@$1$r:o=|$9$k%3%^%s%I$,$"$j$^$9!#(B
$BC1=c$G$O$J$$%G!<%?$r$+$J$j$NJ,NL$GGK2u$9$k2DG=@-$N$"$k%3%^%s%I$O!"(B
$B0lHL$K%-%k$r9T$$$^$9!#(B
$B%3%^%s%IL>$d8D!9$N@bL@$G$O!"$=$N%3%^%s%I$,$I$A$i$NF/$-$r$9$k$+$K$h$C$F!"(B
@samp{$B%-%k(B}$B!J(Bkill$B!K$H(B@samp{$B:o=|(B}$B!J(Bdelete$B!K$r;H$$J,$1$F$$$^$9!#(B

@menu
* Deletion::            Commands for deleting small amounts of text and
                          blank areas.
* Killing by Lines::    How to kill entire lines of text at one time.
* Other Kill Commands:: Commands to kill large regions of text and
                          syntactic units such as words and sentences. 
@end menu

@node Deletion
@c @subsection Deletion
@subsection $B:o=|(B
@c ??? Should be backward-delete-char
@findex delete-backward-char
@findex delete-char
@kindex DEL
@kindex C-d

@table @kbd
@item C-d
@c Delete next character (@code{delete-char}).
$B$D$.$NJ8;z$r:o=|$9$k!J(B@code{delete-char}$B!K!#(B
@item @key{DEL}
@c Delete previous character (@code{delete-backward-char}).
$B$^$($NJ8;z$r:o=|$9$k!J(B@code{delete-backward-char}$B!K!#(B
@item M-\
@c Delete spaces and tabs around point (@code{delete-horizontal-space}).
$B%]%$%s%H$N<~$j$N6uGr$H%?%V$r:o=|$9$k!J(B@code{delete-horizontal-space}$B!K!#(B
@item M-@key{SPC}
@c Delete spaces and tabs around point, leaving one space
@c (@code{just-one-space}).
$B%]%$%s%H$N<~$j$N6uGr$H%?%V$r:o=|$7!"6uGr$r(B1$B8D$@$1;D$9(B
$B!J(B@code{just-one-space}$B!K!#(B
@item C-x C-o
@c Delete blank lines around the current line (@code{delete-blank-lines}).
$B8=:_9T$N<~$j$N6u9T$r:o=|$9$k!J(B@code{delete-blank-lines}$B!K!#(B
@item M-^
@c Join two lines by deleting the intervening newline, along with any
@c indentation following it (@code{delete-indentation}).
$B9T4V$N2~9T$H$=$l$KB3$/;z2<$2$r:o=|$7$F(B2$B9T$r7R$2$k(B
$B!J(B@code{delete-indentation}$B!K!#(B
@end table

@c   The most basic delete commands are @kbd{C-d} (@code{delete-char}) and
@c @key{DEL} (@code{delete-backward-char}).  @kbd{C-d} deletes the
@c character after point, the one the cursor is ``on top of.''  This
@c doesn't move point.  @key{DEL} deletes the character before the cursor,
@c and moves point back.  You can delete newlines like any other characters
@c in the buffer; deleting a newline joins two lines.  Actually, @kbd{C-d}
@c and @key{DEL} aren't always delete commands; when given arguments, they
@c kill instead, since they can erase more than one character this way.
$B$b$C$H$b4pK\E*$J:o=|%3%^%s%I$O!"(B@kbd{C-d}$B!J(B@code{delete-char}$B!K$H(B
@key{DEL}$B!J(B@code{delete-backward-char}$B!K$G$9!#(B
@kbd{C-d}$B$O%]%$%s%H$ND>8e$NJ8;z!"(B
$B$D$^$j!"%+!<%=%k$,=E$J$C$F$$$kJ8;z$r:o=|$7$^$9!#(B
$B$3$N%3%^%s%I$G$O!"%]%$%s%H$OF0$-$^$;$s!#(B
@key{DEL}$B$O%+!<%=%k$ND>A0$NJ8;z$r:o=|$7$F!"(B
$B%]%$%s%H$r(B1$B$D$^$($K0\F0$7$^$9!#(B
$B%P%C%U%!Fb$NB>$NJ8;z$HF1MM$K!"2~9T$b:o=|$G$-$^$9!#(B
$B2~9T$r:o=|$9$k$H!"(B2$B$D$N9T$,7R$,$j$^$9!#(B
$B<B:]$K$O!"(B@kbd{C-d}$B$H(B@key{DEL}$B$,$D$M$K:o=|%3%^%s%I$G$"$k$o$1$G$O$"$j$^$;$s!#(B
$B0z?t$r;XDj$9$k$H%-%k%3%^%s%I$H$J$j!"(B
$BF1$8J}K!$G(B2$BJ8;z0J>e$r>C$9$3$H$,$G$-$^$9!#(B

@kindex M-\
@findex delete-horizontal-space
@kindex M-SPC
@findex just-one-space
@c   The other delete commands are those which delete only whitespace
@c characters: spaces, tabs and newlines.  @kbd{M-\}
@c (@code{delete-horizontal-space}) deletes all the spaces and tab
@c characters before and after point.  @kbd{M-@key{SPC}}
@c (@code{just-one-space}) does likewise but leaves a single space after
@c point, regardless of the number of spaces that existed previously (even
@c zero).
$BB>$N:o=|%3%^%s%I$O!"6uGr!"%?%V!"2~9T$H$$$C$?GrJ8;z$@$1$r:o=|$7$^$9!#(B
@kbd{M-\}$B!J(B@code{delete-horizontal-space}$B!K$O!"(B
$B%]%$%s%H$NA08e$K$"$k$9$Y$F$N6uGr$H%?%VJ8;z$r:o=|$7$^$9!#(B
@kbd{M-@key{SPC}}$B!J(B@code{just-one-space}$B!K$bF1MM$K:o=|$7$^$9$,!"(B
$B:#$"$k6uGr$N8D?t$K4X78$J$/!J$?$H$((B0$B8D$G$b!K!"(B
$B%]%$%s%H$ND>8e$K6uGr$r(B1$B8D$@$1;D$7$^$9!#(B

@c   @kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines
@c after the current line.  If the current line is blank, it deletes all
@c blank lines preceding the current line as well (leaving one blank line,
@c the current line).
@kbd{C-x C-o}$B!J(B@code{delete-blank-lines}$B!K$O!"(B
$B8=:_9T$KB3$/$9$Y$F$N6u9T$r:o=|$7$^$9!#(B
$B8=:_9T$,6u9T$G$"$k>l9g$K$O!"!J6u9T$G$"$k8=:_9T$@$1$r;D$7$F!K(B
$B@h9T$9$k6u9T$bF1MM$K$9$Y$F:o=|$7$^$9!#(B

@c   @kbd{M-^} (@code{delete-indentation}) joins the current line and the
@c previous line, by deleting a newline and all surrounding spaces, usually
@c leaving a single space.  @xref{Indentation,M-^}.
@kbd{M-^}$B!J(B@code{delete-indentation}$B!K$O!"(B
$B2~9T$H$=$N<~$j$N6uGr$r:o=|$7$F!"(B
$BDL>o$O6uGr$r(B1$B8D;D$7$F8=:_9T$H@h9T$9$k9T$r7R$2$^$9!#(B
@xref{Indentation,M-^}$B!#(B

@node Killing by Lines
@c @subsection Killing by Lines
@subsection $B9TC10L$N%-%k(B

@table @kbd
@item C-k
@c Kill rest of line or one or more lines (@code{kill-line}).
$B9T$N;D$j$NItJ,!"$"$k$$$O!"9TA4BN$r(B1$B9T0J>e%-%k$9$k!J(B@code{kill-line}$B!K!#(B
@end table

@kindex C-k
@findex kill-line
@c   The simplest kill command is @kbd{C-k}.  If given at the beginning of
@c a line, it kills all the text on the line, leaving it blank.  When used
@c on a blank line, it kills the whole line including its newline.  To kill
@c an entire non-blank line, go to the beginning and type @kbd{C-k} twice.
$B$b$C$H$bC1=c$J%-%k%3%^%s%I$O(B@kbd{C-k}$B$G$9!#(B
$B9T$N@hF,$G;H$&$H!"$=$N9T$N$9$Y$F$N%F%-%9%H$r%-%k$7$F!"6u9T$K$7$^$9!#(B
$B6u9T$G;H$&$H!"2~9T$r4^$a$F$=$N9T$r40A4$K%-%k$7$^$9!#(B
$B6u9T$G$J$$9T$r40A4$K%-%k$9$k$K$O!"9TF,$G(B@kbd{C-k}$B$r(B2$B2sBG$A$^$9!#(B

@c   More generally, @kbd{C-k} kills from point up to the end of the line,
@c unless it is at the end of a line.  In that case it kills the newline
@c following point, thus merging the next line into the current one.
@c Spaces and tabs that you can't see at the end of the line are ignored
@c when deciding which case applies, so if point appears to be at the end
@c of the line, you can be sure @kbd{C-k} will kill the newline.
$B0lHL$K!"(B@kbd{C-k}$B$O!"9TKv$G$J$1$l$P!"(B
$B%]%$%s%H$+$i$=$N9T$NKvHx$^$G$r%-%k$7$^$9!#(B
$B9TKv$G$O!"%]%$%s%H$N$&$7$m$N2~9T$r%-%k$9$k$N$G!"(B
$B8=:_9T$H8eB3$N9T$,7R$,$j$^$9!#(B
$B$I$A$i$NF0:n$r$9$k$+7h$a$k$H$-$K$O!"(B
$B9TKv$K$"$C$F8+$K$/$$6uGr$d%?%V$rL5;k$7$^$9$+$i!"(B
$B%]%$%s%H$,9TKv$K$"$k$h$&$K8+$($F$$$l$P!"(B
@kbd{C-k}$B$G2~9T$,%-%k$5$l$k$H9M$($F$/$@$5$$!#(B

@c   When @kbd{C-k} is given a positive argument, it kills that many lines
@c and the newlines that follow them (however, text on the current line
@c before point is spared).  With a negative argument @minus{}@var{n}, it
@c kills @var{n} lines preceding the current line (together with the text
@c on the current line before point).  Thus, @kbd{C-u - 2 C-k} at the front
@c of a line kills the two previous lines.
@kbd{C-k}$B$K@5$N0z?t$r;XDj$9$k$H!"(B
$B$=$N8D?t$N9T$H$=$l$i$KB3$/2~9T$r%-%k$7$^$9(B
$B!J$?$@$7!"8=:_9T$N%]%$%s%H$h$j$^$($N%F%-%9%H$O;D$9!K!#(B
$BIi$N0z?t(B@minus{}@var{n}$B$r;XDj$9$k$H!"(B
@kbd{C-k}$B$O8=:_9T$K@h9T$9$k(B@var{n}$B9T(B
$B!J$H8=:_9T$N%]%$%s%H0LCV$h$j$^$($N%F%-%9%H$r4^$a$F!K$r:o=|$7$^$9!#(B
$B$D$^$j!"%]%$%s%H$,9TF,$K$"$k>uBV$G(B@kbd{C-u - 2 C-k}$B$H$9$l$P!"(B
$B@h9T$9$k(B2$B9T$r%-%k$7$^$9!#(B

@c   @kbd{C-k} with an argument of zero kills the text before point on the
@c current line.
@kbd{C-k}$B$K0z?t(B0$B$r;XDj$9$k$H!"(B
$B8=:_9T$N%]%$%s%H$h$j$^$($N%F%-%9%H$r%-%k$7$^$9!#(B

@vindex kill-whole-line
@c   If the variable @code{kill-whole-line} is non-@code{nil}, @kbd{C-k} at
@c the very beginning of a line kills the entire line including the
@c following newline.  This variable is normally @code{nil}.
$BJQ?t(B@code{kill-whole-line}$B$,(B@code{nil}$B0J30$N>l9g!"(B
$B9TF,$G(B@kbd{C-k}$B$r;H$&$H!"9TKv$N2~9T$b4^$a$F9TA4BN$r%-%k$7$^$9!#(B
$B$3$NJQ?t$O!"DL>o!"(B@code{nil}$B$G$9!#(B

@node Other Kill Commands
@c @subsection Other Kill Commands
@subsection $BB>$N%-%k%3%^%s%I(B
@findex kill-region
@kindex C-w

@c DoubleWideCommands
@table @kbd
@item C-w
@c Kill region (from point to the mark) (@code{kill-region}).
$B%j!<%8%g%s!J%]%$%s%H$+$i%^!<%/$^$G!K$r%-%k$9$k!J(B@code{kill-region}$B!K!#(B
@item M-d
@c Kill word (@code{kill-word}).  @xref{Words}.
$BC18l$r%-%k$9$k!J(B@code{kill-word}$B!K!#(B
@pxref{Words}$B!#(B
@item M-@key{DEL}
@c Kill word backwards (@code{backward-kill-word}).
$BC18l$r8e8~$-$K%-%k$9$k!J(B@code{backward-kill-word}$B!K!#(B
@item C-x @key{DEL}
@c Kill back to beginning of sentence (@code{backward-kill-sentence}).
@c @xref{Sentences}.
$BJ8$N@hF,$^$G$r8e8~$-$K%-%k$9$k!J(B@code{backward-kill-sentence}$B!K!#(B
@pxref{Sentences}$B!#(B
@item M-k
@c Kill to end of sentence (@code{kill-sentence}).
$BJ8$NKvHx$^$G$r%-%k$9$k!J(B@code{kill-sentence}$B!K!#(B
@item C-M-k
@c Kill sexp (@code{kill-sexp}).  @xref{Lists}.
S$B<0$r%-%k$9$k!J(B@code{kill-sexp}$B!K!#(B
@pxref{Lists}$B!#(B
@item M-z @var{char}
@c Kill through the next occurrence of @var{char} (@code{zap-to-char}).
$B$D$.$K(B@var{char}$B$,8=$l$k2U=j$^$G$r%-%k$9$k!J(B@code{zap-to-char}$B!K!#(B
@end table

@c   A kill command which is very general is @kbd{C-w}
@c (@code{kill-region}), which kills everything between point and the
@c mark.  With this command, you can kill any contiguous sequence of
@c characters, if you first set the region around them.
$BHFMQE*$J%-%k%3%^%s%I$H$$$($P(B@kbd{C-w}$B!J(B@code{kill-region}$B!K$G$9!#(B
$B$3$N%3%^%s%I$O!"$"$i$+$8$aO"B3NN0h$r%]%$%s%H$H%^!<%/$G0O$s$G$*$1$P!"(B
$B$I$s$JO"B3NN0h$G$b%-%k$G$-$^$9!#(B

@kindex M-z
@findex zap-to-char
@c   A convenient way of killing is combined with searching: @kbd{M-z}
@c (@code{zap-to-char}) reads a character and kills from point up to (and
@c including) the next occurrence of that character in the buffer.  A
@c numeric argument acts as a repeat count.  A negative argument means to
@c search backward and kill text before point.
$BC5:w$HAH$_9g$o$;$?JXMx$J%-%k$N;EJ}$b$"$j$^$9!#(B
@kbd{M-z}$B!J(B@code{zap-to-char}$B!K$O(B1$BJ8;z$rFI$_<h$j!"(B
$B%]%$%s%H$+$i%P%C%U%!Fb$G$=$NJ8;z$,$D$.$K8=$l$k2U=j$^$G$r(B
$B!J$=$NJ8;z$b4^$a$F!K%-%k$7$^$9!#(B
$B?t0z?t$r;XDj$7$?>l9g$O!"H?I|2s?t$r0UL#$7$^$9!#(B
$BIi$N0z?t$N>l9g$O!"%]%$%s%H0LCV$+$i5UJ}8~$KC5:w$7!"(B
$B%]%$%s%H$ND>A0$^$G$r%-%k$7$^$9!#(B

@c   Other syntactic units can be killed: words, with @kbd{M-@key{DEL}} and
@c @kbd{M-d} (@pxref{Words}); sexps, with @kbd{C-M-k} (@pxref{Lists}); and
@c sentences, with @kbd{C-x @key{DEL}} and @kbd{M-k}
@c (@pxref{Sentences}).@refill
$BB>$N9=J8C10L$G$b%-%k$G$-$^$9!#(B
@kbd{M-@key{DEL}}$B$d(B@kbd{M-d}$B!J(B@pxref{Words}$B!K$GC18l$r!"(B
@kbd{C-M-k}$B!J(B@pxref{Lists}$B!K$G(BS$B<0$r!"(B
@kbd{C-x @key{DEL}}$B$d(B@kbd{M-k}$B!J(B@pxref{Sentences}$B!K$GJ8$r%-%k$G$-$^$9!#(B

@c   You can use kill commands in read-only buffers.  They don't actually
@c change the buffer, and they beep to warn you of that, but they do copy
@c the text you tried to kill into the kill ring, so you can yank it into
@c other buffers.  Most of the kill commands move point across the text
@c they copy in this way, so that successive kill commands build up a
@c single kill ring entry as usual.
$BFI$_=P$7@lMQ$N%P%C%U%!$G$b%-%k$G$-$^$9!#(B
$B<B:]$K$O%P%C%U%!$KJQ99$r2C$($k$3$H$O$"$j$^$;$s$7!"(B
$B%Y%k$rLD$i$7$F$=$N;]7Y9p$rH/$7$^$9$,!"(B
$B%-%k$7$h$&$H$7$?%F%-%9%H$O%-%k%j%s%0$K%3%T!<$5$l$^$9!#(B
$B$G$9$+$i!"JL$N%P%C%U%!$K$=$N%F%-%9%H$r%d%s%/$G$-$^$9!#(B
$B$[$H$s$I$N%-%k%3%^%s%I$O!"(B
$B$3$N$h$&$K%3%T!<$9$k%F%-%9%H$r1[$($F%]%$%s%H$r?J$a$^$9$+$i!"(B
$BO"B3$7$F%-%k%3%^%s%I$r<B9T$7$F$b(B
$B%-%k%j%s%0$KF~$k9`L\$ODL>o$I$*$j(B1$B8D$@$1$G$9!#(B

@node Yanking, Accumulating Text, Killing, Top
@c @section Yanking
@section $B%d%s%/(B
@c @cindex moving text
@c @cindex copying text
@c @cindex kill ring
@c @cindex yanking
@c @cindex pasting
@cindex $B%F%-%9%H$N0\F0(B
@cindex $B%F%-%9%H$N%3%T!<(B
@cindex $B%-%k%j%s%0(B
@cindex $B%d%s%/(B
@cindex $B%Z!<%9%H(B

@c   @dfn{Yanking} means reinserting text previously killed.  This is what
@c some systems call ``pasting.''  The usual way to move or copy text is to
@c kill it and then yank it elsewhere one or more times.
@dfn{$B%d%s%/(B}$B!J(Byank$B!K$H$O!"(B
$B0JA0$K%-%k$7$?%F%-%9%H$r%P%C%U%!$K$U$?$?$SA^F~$9$k$3$H$G$9!#(B
$BB>$N%7%9%F%`$G$O!X%Z!<%9%H!Y$H8F$V$3$H$b$"$j$^$9!#(B
$B%F%-%9%H$r0\F0$7$?$j%3%T!<$7$?$j$9$kIaDL$NJ}K!$O!"(B
$B$=$N%F%-%9%H$r$$$C$?$s%-%k$7$F$+$i!"JL$N>l=j$K!J(B1$B2s0J>e!K%d%s%/$9$k$3$H$G$9!#(B

@table @kbd
@item C-y
@c Yank last killed text (@code{yank}).
$B:G8e$K%-%k$7$?%F%-%9%H$r%d%s%/$9$k!J(B@code{yank}$B!K!#(B
@item M-y
@c Replace text just yanked with an earlier batch of killed text
@c (@code{yank-pop}).
$B$?$C$?:#%d%s%/$7$?%F%-%9%H$r$=$l$h$j0JA0$K%-%k$7$?0l2t$N%F%-%9%H$GCV$-49$($k(B
$B!J(B@code{yank-pop}$B!K!#(B
@item M-w
@c Save region as last killed text without actually killing it
@c (@code{kill-ring-save}).
$B%j!<%8%g%s$r<B:]$K$O%-%k$;$:$K!":G8e$K%-%k$7$?%F%-%9%H$H$7$FJ]B8$9$k(B
$B!J(B@code{kill-ring-save}$B!K!#(B
@item C-M-w
@c Append next kill to last batch of killed text (@code{append-next-kill}).
$B$D$.$N%-%k$r!":G8e$K%-%k$7$?0l2t$N%F%-%9%H$KIU$12C$($k(B
$B!J(B@code{append-next-kill}$B!K!#(B
@end table

@menu
* Kill Ring::		Where killed text is stored.  Basic yanking.
* Appending Kills::	Several kills in a row all yank together.
* Earlier Kills::	Yanking something killed some time ago.
@end menu

@node Kill Ring
@c @subsection The Kill Ring
@subsection $B%-%k%j%s%0(B

@c   All killed text is recorded in the @dfn{kill ring}, a list of blocks of
@c text that have been killed.  There is only one kill ring, shared by all
@c buffers, so you can kill text in one buffer and yank it in another buffer.
@c This is the usual way to move text from one file to another.
@c (@xref{Accumulating Text}, for some other ways.)
$B$9$Y$F$N%-%k$5$l$?%F%-%9%H$O!"%-%k$5$l$?%F%-%9%H$N2t$r%j%9%H$H$9$k(B
@dfn{$B%-%k%j%s%0(B}$B!J(Bkill ring$B!K$K5-O?$5$l$F$$$^$9!#(B
$B%-%k%j%s%0$O$?$C$?(B1$B$D$7$+$J$/$F!"$9$Y$F$N%P%C%U%!$G6&M-$7$F$$$^$9!#(B
$B$G$9$+$i!"$"$k%P%C%U%!$G%-%k$7$?%F%-%9%H$O!"(B
$BJL$N%P%C%U%!$G%d%s%/$G$-$^$9!#(B
$BIaDL!"$3$N$h$&$K$7$F!"$"$k%U%!%$%k$+$iJL$N%U%!%$%k$X%F%-%9%H$r0\F0$7$^$9!#(B
$B!JJL$NJ}K!$K$D$$$F$O!"(B@pxref{Accumulating Text}$B!#!K(B

@kindex C-y
@findex yank
@c   The command @kbd{C-y} (@code{yank}) reinserts the text of the most recent
@c kill.  It leaves the cursor at the end of the text.  It sets the mark at
@c the beginning of the text.  @xref{Mark}.
$B%3%^%s%I(B@kbd{C-y}$B!J(B@code{yank}$B!K$O!"(B
$B:G8e$K%-%k$7$?%F%-%9%H$r$U$?$?$SA^F~$7$^$9!#(B
$B%+!<%=%k$OA^F~$7$?%F%-%9%H$NKvHx$KCV$+$l$^$9!#(B
$B%^!<%/$OA^F~$7$?%F%-%9%H$N@hF,$KCV$+$l$^$9!#(B
@xref{Mark}$B!#(B

@c   @kbd{C-u C-y} leaves the cursor in front of the text, and sets the
@c mark after it.  This happens only if the argument is specified with just
@c a @kbd{C-u}, precisely.  Any other sort of argument, including @kbd{C-u}
@c and digits, specifies an earlier kill to yank (@pxref{Earlier Kills}).
@kbd{C-u C-y}$B$O!"%F%-%9%H$N$^$($K%+!<%=%k$rCV$-!"$&$7$m$K%^!<%/$rCV$-$^$9!#(B
$B0z?t$H$7$F(B@kbd{C-u}$B$@$1$r;XDj$7$?>l9g$K8B$j!"$3$&$J$j$^$9!#(B
@kbd{C-u}$B$H?t;z$r4^$a$?B>$N0z?t$r;XDj$9$k$H!"(B
$B$$$/$D$^$($N%-%kFbMF$r%d%s%/$9$k$+$r0UL#$7$^$9!J(B@pxref{Earlier Kills}$B!K!#(B

@kindex M-w
@findex kill-ring-save
@c   To copy a block of text, you can use @kbd{M-w}
@c (@code{kill-ring-save}), which copies the region into the kill ring
@c without removing it from the buffer.  This is approximately equivalent
@c to @kbd{C-w} followed by @kbd{C-x u}, except that @kbd{M-w} does not
@c alter the undo history and does not temporarily change the screen.
$B0l2t$N%F%-%9%H$r%3%T!<$9$k>l9g$O!"(B
@kbd{M-w}$B!J(B@code{kill-ring-save}$B!K$r;H$&$H$h$$$G$7$g$&!#(B
$B$3$N%3%^%s%I$O!"%P%C%U%!$+$i%j!<%8%g%s$r%-%k$;$:$K!"(B
$B%j!<%8%g%s$r%-%k%j%s%0$K%3%T!<$7$^$9!#(B
$B$3$N%3%^%s%I$O!"(B@kbd{C-w}$B$KB3$1$F(B@kbd{C-x u}$B$r<B9T$9$k$N$H$[$\F1Ey$G$9$,!"(B
@kbd{M-w}$B$O%"%s%I%%MzNr$rJQ99$7$^$;$s$7!"0l;~E*$K$;$h2hLLI=<($bJQ$o$j$^$;$s!#(B

@node Appending Kills
@c @subsection Appending Kills
@subsection $B%-%k$7$?%F%-%9%H$NDI2C(B

@c @cindex appending kills in the ring
@c @cindex television
@cindex $B%-%k%F%-%9%H$N%j%s%0$X$NDI2C(B
@cindex $B%F%l%S(B
@c   Normally, each kill command pushes a new entry onto the kill ring.
@c However, two or more kill commands in a row combine their text into a
@c single entry, so that a single @kbd{C-y} yanks all the text as a unit,
@c just as it was before it was killed.
$BDL>o!"3F%-%k%3%^%s%I$O!"%-%k%j%s%0$K?7$?$J9`L\$r2!$79~$_$^$9!#(B
$B$7$+$7!"O"B3$7$?%-%k%3%^%s%I$G$O!"(B
$B$=$l$>$l$G%-%k$7$?%F%-%9%H$r(B1$B$D$N9`L\$K$^$H$a$^$9!#(B
$B$=$N$?$a!"(B1$B2s$N(B@kbd{C-y}$B$G!"%-%k$9$k$^$($N>uBV$K!"(B
$B$=$l$i$N%F%-%9%H$r$R$H$^$H$a$K%d%s%/$G$-$^$9!#(B

@c   Thus, if you want to yank text as a unit, you need not kill all of it
@c with one command; you can keep killing line after line, or word after
@c word, until you have killed it all, and you can still get it all back at
@c once.
$B$7$?$,$C$F!"%F%-%9%H$r0l2t$G%d%s%/$7$?$$>l9g$G$b!"(B
1$B$D$N%3%^%s%I$G$=$l$i$r%-%k$9$kI,MW$O$"$j$^$;$s!#(B
$B$9$Y$F$r%-%k$9$k$^$G!"(B1$B9T$:$D!"$"$k$$$O!"(B1$BC18l$:$D%-%k$7$F$$$C$F$b!"(B
$B0l3g$7$F$b$H$KLa$9$3$H$,$G$-$^$9!#(B

@c   Commands that kill forward from point add onto the end of the previous
@c killed text.  Commands that kill backward from point add text onto the
@c beginning.  This way, any sequence of mixed forward and backward kill
@c commands puts all the killed text into one entry without rearrangement.
@c Numeric arguments do not break the sequence of appending kills.  For
@c example, suppose the buffer contains this text:
$B%]%$%s%H0LCV$+$iA08~$-$K%-%k$9$k%3%^%s%I$G$O!"(B
$BD>A0$K%-%k$7$?%F%-%9%H$NKvHx$KIU$12C$($^$9!#(B
$B%]%$%s%H0LCV$+$i8e8~$-$K%-%k$9$k%3%^%s%I$G$O!"(B
$B%F%-%9%H$N@hF,$KIU$12C$($^$9!#(B
$B$3$N$h$&$K!"A08~$-!?8e8~$-$NN>J}$N%-%k%3%^%s%I$r$I$N$h$&$K:.$<$F<B9T$7$F$b!"(B
$B%-%k$7$?%F%-%9%H$N=gHV$rJx$9$3$H$J$/(B
1$B$D$N9`L\$H$7$F%-%k%j%s%0$K5-O?$5$l$^$9!#(B
$B?t0z?t$r;XDj$7$F$b!"$3$N$h$&$JDI2C7ONs$,ES@Z$l$k$3$H$O$"$j$^$;$s!#(B
$B$?$H$($P!"%P%C%U%!$K$D$.$N%F%-%9%H$,F~$C$F$$$F!"(B
@point{}$B$N0LCV$K%]%$%s%H$,$"$k$H$7$^$7$g$&!#(B

@example
This is a line @point{}of sample text.
@end example

@noindent
@c with point shown by @point{}.  If you type @kbd{M-d M-@key{DEL} M-d
@c M-@key{DEL}}, killing alternately forward and backward, you end up with
@c @samp{a line of sample} as one entry in the kill ring, and @samp{This
@c is@ @ text.} in the buffer.  (Note the double space, which you can clean
@c up with @kbd{M-@key{SPC}} or @kbd{M-q}.)
@kbd{M-d M-@key{DEL} M-d M-@key{DEL}}$B$HBG$C$F!"(B
$BA08~$-!?8e8~$-$H8r8_$K%-%k$7$F$b!"(B
$B%-%k%j%s%0$K$O(B1$B$D$N9`L\$H$7$F(B@samp{a line of sample}$B$,F~$j!"(B
$B%P%C%U%!$K$O(B@samp{This is@ @ text.}$B$,;D$j$^$9!#(B
$B!J6uGr$,(B2$B8D;D$C$F$$$k$3$H$KCm0U!#(B
$B$3$l$i$O(B@kbd{M-@key{SPC}}$B$d(B@kbd{M-q}$B$G0lA]$G$-$k!#!K(B

@c   Another way to kill the same text is to move back two words with
@c @kbd{M-b M-b}, then kill all four words forward with @kbd{C-u M-d}.
@c This produces exactly the same results in the buffer and in the kill
@c ring.  @kbd{M-f M-f C-u M-@key{DEL}} kills the same text, all going
@c backward; once again, the result is the same.  The text in the kill ring
@c entry always has the same order that it had in the buffer before you
@c killed it.
$BF1$8$h$&$K%F%-%9%H$r%-%k$9$k$b$&(B1$B$D$NJ}K!$O!"(B
@kbd{M-b M-b}$B$G8e8~$-$K(B2$B8l0\F0$7$F$+$i!"(B
@kbd{C-u M-d}$B$GA08~$-$K(B4$B8l%-%k$7$^$9!#(B
$B$3$&$7$F$b!"%P%C%U%!$H%-%k%j%s%0$NCf?H$O!"(B
$B@h$NNc$H$^$C$?$/F1$87k2L$K$J$j$^$9!#(B
@kbd{M-f M-f C-u M-@key{DEL}}$B$H$7$F$b!"(B
$B8e8~$-$KF1$8%F%-%9%H$r%-%k$7$^$9!#(B
$B$3$l$G$b$d$O$jF1$87k2L$,F@$i$l$^$9!#(B
$B%-%k%j%s%0$N9`L\Fb$N%F%-%9%H$N=g=x$O!"(B
$B%-%k$9$k$^$($N%P%C%U%!Fb$G$N=g=x$HF1$8$G$9!#(B

@kindex C-M-w
@findex append-next-kill
@c   If a kill command is separated from the last kill command by other
@c commands (not just numeric arguments), it starts a new entry on the kill
@c ring.  But you can force it to append by first typing the command
@c @kbd{C-M-w} (@code{append-next-kill}) right before it.  The @kbd{C-M-w}
@c tells the following command, if it is a kill command, to append the text
@c it kills to the last killed text, instead of starting a new entry.  With
@c @kbd{C-M-w}, you can kill several separated pieces of text and
@c accumulate them to be yanked back in one place.@refill
$B%-%k%3%^%s%I$H:G8e$N%-%k%3%^%s%I$N$"$$$@$K(B
$B!JC1$J$k?t0z?t$G$O$J$$!KB>$N%3%^%s%I$,F~$k$H!"(B
$B%-%k%j%s%0$K$O?7$?$J9`L\$,:n$i$l$^$9!#(B
$B$7$+$7!"%-%k%3%^%s%I$rBG$DD>A0$K(B
$B%3%^%s%I(B@kbd{C-M-w}$B!J(B@code{append-next-kill}$B!K$rBG$C$F$*$1$P!"(B
$B4{B8$N9`L\$XDI2C$9$k$h$&$K6/@)$G$-$^$9!#(B
@kbd{C-M-w}$B$O!"$D$.$,%-%k%3%^%s%I$G$"$l$P!"(B
$B?7$?$J9`L\$r:n@.$9$k$+$o$j$K%-%k$7$?%F%-%9%H$r(B
$B0JA0$K%-%k$7$?%F%-%9%H$KIU$12C$($k$h$&;X<($7$^$9!#(B
@kbd{C-M-w}$B$r;H$&$3$H$G!"(B
$B$^$H$a$F(B1$B$+=j$K%d%s%/$G$-$k$h$&$K!"(B
$BN%$l$?>l=j$K$"$k$$$/$D$+$N%F%-%9%HCGJR$r%-%k$7$F=8$a$F$*$1$^$9!#(B

@c   A kill command following @kbd{M-w} does not append to the text that
@c @kbd{M-w} copied into the kill ring.
@kbd{M-w}$B$KB3$/%-%k%3%^%s%I$G$O!"(B
@kbd{M-w}$B$,%-%k%j%s%0$K%3%T!<$7$?%F%-%9%H$K$OIU$12C$($^$;$s!#(B

@node Earlier Kills
@c @subsection Yanking Earlier Kills
@subsection $B0JA0$K%-%k$7$?%F%-%9%H$N%d%s%/(B

@c @cindex yanking previous kills
@cindex $B@h$K%-%k$7$?%F%-%9%H$N%d%s%/(B
@kindex M-y
@findex yank-pop
@c   To recover killed text that is no longer the most recent kill, use the
@c @kbd{M-y} command (@code{yank-pop}).  It takes the text previously
@c yanked and replaces it with the text from an earlier kill.  So, to
@c recover the text of the next-to-the-last kill, first use @kbd{C-y} to
@c yank the last kill, and then use @kbd{M-y} to replace it with the
@c previous kill.  @kbd{M-y} is allowed only after a @kbd{C-y} or another
@c @kbd{M-y}.
$BD>A0$K%-%k$7$?$b$N$G$O$J$$%F%-%9%H$r<h$j=P$9$K$O!"(B
@kbd{M-y}$B%3%^%s%I!J(B@code{yank-pop}$B!K$r;H$$$^$9!#(B
@kbd{M-y}$B$O!"D>A0$K%d%s%/$7$?%F%-%9%H$r(B
$B$=$l0JA0$K%-%k$7$?%F%-%9%H$GCV$-49$($^$9!#(B
$B$?$H$($P!":G8e$+$i(B2$B$D$a$N%-%k%F%-%9%H$r<h$j=P$9$K$O!"(B
$B$^$:(B@kbd{C-y}$B$G:G8e$K%-%k$7$?%F%-%9%H$r%d%s%/$7$F$+$i!"(B
@kbd{M-y}$B$G(B1$B$D$^$($N$b$N$KCV$-49$($^$9!#(B
@kbd{M-y}$B$O(B@kbd{C-y}$B$dB>$N(B@kbd{M-y}$B$ND>8e$G$7$+;H$($^$;$s!#(B

@c   You can understand @kbd{M-y} in terms of a ``last yank'' pointer which
@c points at an entry in the kill ring.  Each time you kill, the ``last
@c yank'' pointer moves to the newly made entry at the front of the ring.
@c @kbd{C-y} yanks the entry which the ``last yank'' pointer points to.
@c @kbd{M-y} moves the ``last yank'' pointer to a different entry, and the
@c text in the buffer changes to match.  Enough @kbd{M-y} commands can move
@c the pointer to any entry in the ring, so you can get any entry into the
@c buffer.  Eventually the pointer reaches the end of the ring; the next
@c @kbd{M-y} moves it to the first entry again.
$B%-%k%j%s%0Fb$N9`L\$r;X$9!X:G=*%d%s%/!Y%]%$%s%?$r9M$($k$H!"(B
@kbd{M-y}$B$NF0:n$rM}2r$7$d$9$$$G$7$g$&!#(B
$B%-%k$9$k$?$S$K!"!X:G=*%d%s%/!Y%]%$%s%?$O!"(B
$B%j%s%0$N@hF,$K?7$?$K:n$i$l$?9`L\$r;X$7$^$9!#(B
@kbd{C-y}$B$O!"!X:G=*%d%s%/!Y%]%$%s%?$,;X$99`L\$r%d%s%/$7$^$9!#(B
@kbd{M-y}$B$O!"!X:G=*%d%s%/!Y%]%$%s%?$rJL$N9`L\$X0\F0$7!"(B
$B$=$l$K9g$o$;$F%P%C%U%!$N%F%-%9%H$rJQ99$7$^$9!#(B
@kbd{M-y}$B%3%^%s%I$r7+$jJV$;$P%j%s%0Fb$N$I$N9`L\$X$b%]%$%s%?$r0\F0$G$-$k$N$G!"(B
$B$I$N9`L\$G$b%P%C%U%!$K<h$j9~$a$^$9!#(B
$B%]%$%s%?$,%j%s%0$N:G8e$KC#$9$k$H!"(B
$B$D$.$N(B@kbd{M-y}$B$O%]%$%s%?$r$U$?$?$S%j%s%0$N@hF,$N9`L\$K0\F0$7$^$9!#(B

@c   @kbd{M-y} moves the ``last yank'' pointer around the ring, but it does
@c not change the order of the entries in the ring, which always runs from
@c the most recent kill at the front to the oldest one still remembered.
@kbd{M-y}$B$O!"%j%s%0Fb$G!X:G=*%d%s%/!Y%]%$%s%?$r0\F0$7$^$9$,!"(B
$B%j%s%0Fb$N9`L\$N=gHV$rJQ$($k$3$H$O$"$j$^$;$s!#(B
$B$D$M$K!":G8e$K%-%k$7$?$b$N$,@hF,$K$"$j!"(B
$B5-O?$K;D$C$F$$$k:G8E$N$b$N$,:G8eHx$K$"$j$^$9!#(B

@c   @kbd{M-y} can take a numeric argument, which tells it how many entries
@c to advance the ``last yank'' pointer by.  A negative argument moves the
@c pointer toward the front of the ring; from the front of the ring, it
@c moves ``around'' to the last entry and continues forward from there.
@kbd{M-y}$B$K$O?t0z?t$r;XDj$G$-$F!"(B
$B!X:G=*%d%s%/!Y%]%$%s%?$r$$$/$D?J$a$k$+$r;XDj$7$^$9!#(B
$BIi$N0z?t$G$O!"%]%$%s%?$r%j%s%0$N@hF,$K8~$1$F0\F0$7$^$9!#(B
$B%j%s%0$N@hF,$+$i$O:G8e$N9`L\$X0\F0$7!"$=$3$+$i@hF,$K8~$1$F0\F0$7$^$9!#(B

@c   Once the text you are looking for is brought into the buffer, you can
@c stop doing @kbd{M-y} commands and it will stay there.  It's just a copy
@c of the kill ring entry, so editing it in the buffer does not change
@c what's in the ring.  As long as no new killing is done, the ``last
@c yank'' pointer remains at the same place in the kill ring, so repeating
@c @kbd{C-y} will yank another copy of the same previous kill.
$BL\E*$N%F%-%9%H$,%P%C%U%!$KF~$C$?$J$i$P!"(B
@kbd{M-y}$B%3%^%s%I$N7+$jJV$7$r;_$a$l$P!"$_$D$1$?%F%-%9%H$,;D$j$^$9!#(B
$B$=$N%F%-%9%H$O%-%k%j%s%0$N9`L\$N%3%T!<$J$N$G!"(B
$B%P%C%U%!Fb$GJT=8$7$F$b%j%s%0Fb$N9`L\$OJQ$o$j$^$;$s!#(B
$B?7$?$K%-%k$7$J$$8B$j!"!X:G=*%d%s%/!Y%]%$%s%?$O(B
$B%-%k%j%s%0Fb$NF1$8>l=j$r;X$7$F$$$^$9$+$i!"(B
@kbd{C-y}$B$r7+$jJV$9$H!"(B
$BD>A0$K<h$j9~$s$@$b$N$HF1$8%-%kFbMF$N%3%T!<$r%d%s%/$G$-$^$9!#(B

@c   If you know how many @kbd{M-y} commands it would take to find the text
@c you want, you can yank that text in one step using @kbd{C-y} with a
@c numeric argument.  @kbd{C-y} with an argument restores the text the
@c specified number of entries back in the kill ring.  Thus, @kbd{C-u 2
@c C-y} gets the next-to-the-last block of killed text.  It is equivalent
@c to @kbd{C-y M-y}.  @kbd{C-y} with a numeric argument starts counting
@c from the ``last yank'' pointer, and sets the ``last yank'' pointer to
@c the entry that it yanks.
$BL\E*$N%F%-%9%H$r0z$-=P$9$N$K(B
@kbd{M-y}$B%3%^%s%I$r2?2s;H$($P$h$$$N$+$o$+$C$F$$$k>l9g$K$O!"(B
$B?t0z?t$r;XDj$7$F(B@kbd{C-y}$B$r;H$($P!"(B
$B0lH/$GL\E*$N%F%-%9%H$r%d%s%/$G$-$^$9!#(B
@kbd{C-y}$B$K?t0z?t$r;XDj$9$k$H!"(B
$B%-%k%j%s%0Fb$G$=$N8D?tJ,$@$1AL$C$?9`L\$N%F%-%9%H$r<h$j9~$_$^$9!#(B
$B$?$H$($P!"(B@kbd{C-u 2 C-y}$B$O:G8e$+$i(B2$BHVL\$K%-%k$7$?%F%-%9%H$r<h$j9~$_$^$9!#(B
$B$D$^$j!"(B@kbd{C-y M-y}$B$H$9$k$N$HEy2A$G$9!#(B
$B?t0z?t$r;XDj$7$?(B@kbd{C-y}$B$O!"!X:G=*%d%s%/!Y%]%$%s%?$N>l=j$+$i(B
$B?t$(;O$a!"%d%s%/$9$k9`L\$K%]%$%s%H$r0\F0$7$^$9!#(B

@vindex kill-ring-max
@c   The length of the kill ring is controlled by the variable
@c @code{kill-ring-max}; no more than that many blocks of killed text are
@c saved.
$B%-%k%j%s%0$ND9$5$O!"JQ?t(B@code{kill-ring-max}$B$G@)8f$7$^$9!#(B
$B$3$N8D?t0J>e$N%-%k%F%-%9%H$OJ]B8$7$^$;$s!#(B

@vindex kill-ring
@c   The actual contents of the kill ring are stored in a variable named
@c @code{kill-ring}; you can view the entire contents of the kill ring with
@c the command @kbd{C-h v kill-ring}.
$B%-%k%j%s%0$N<B:]$NFbMF$O!"(B@code{kill-ring}$B$H$$$&L>A0$NJQ?t$KF~$C$F$$$^$9!#(B
$B%-%k%j%s%0$NA4FbMF$O!"%3%^%s%I(B@kbd{C-h v kill-ring}$B$G8+$k$3$H$,$G$-$^$9!#(B

@node Accumulating Text, Rectangles, Yanking, Top
@c @section Accumulating Text
@section $B%F%-%9%H$NC_@Q(B
@findex append-to-buffer
@findex prepend-to-buffer
@findex copy-to-buffer
@findex append-to-file

@c @cindex accumulating scattered text
@cindex $BJ,;6$7$?%F%-%9%H$NC_@Q(B
@c   Usually we copy or move text by killing it and yanking it, but there
@c are other methods convenient for copying one block of text in many
@c places, or for copying many scattered blocks of text into one place.  To
@c copy one block to many places, store it in a register
@c (@pxref{Registers}).  Here we describe the commands to accumulate
@c scattered pieces of text into a buffer or into a file.
$BDL>o!"%F%-%9%H$r%3%T!<$7$?$j0\F0$7$?$j$9$k$K$O%-%k$H%d%s%/$G9T$$$^$9!#(B
$B$7$+$7!"0l2t$N%F%-%9%H$r2?$+=j$K$b%3%T!<$7$?$j!"(B
$BB?$/$N2U=j$KJ,;6$7$?%F%-%9%H$r(B1$B$+=j$K%3%T!<$7$?$j$9$k$N$K(B
$BJXMx$JJ}K!$,B>$K$b$"$j$^$9!#(B
$B0l2t$N%F%-%9%H$r2?$+=j$K$b%3%T!<$9$k$K$O!"(B
$B$=$N%F%-%9%H$r%l%8%9%?$KJ]B8$7$^$9!J(B@pxref{Registers}$B!K!#(B
$B$3$3$G$O!"2?$+=j$+$KJ,;6$7$?%F%-%9%H$r%P%C%U%!$d%U%!%$%k$K(B
$BC_@Q$9$k$?$a$N%3%^%s%I$r@bL@$7$^$9!#(B

@table @kbd
@item M-x append-to-buffer
@c Append region to contents of specified buffer.
$B%j!<%8%g%s$r;XDj$7$?%P%C%U%!$NFbMF$NKvHx$KIU2C$9$k!#(B
@item M-x prepend-to-buffer
@c Prepend region to contents of specified buffer.
$B%j!<%8%g%s$r;XDj$7$?%P%C%U%!$NFbMF$N@hF,$KIU2C$9$k!#(B
@item M-x copy-to-buffer
@c Copy region into specified buffer, deleting that buffer's old contents.
$B%j!<%8%g%s$r;XDj$7$?%P%C%U%!$K%3%T!<$9$k$,!"(B
$B$=$N%P%C%U%!$N8E$$FbMF$O:o=|$9$k!#(B
@item M-x insert-buffer
@c Insert contents of specified buffer into current buffer at point.
$B;XDj$7$?%P%C%U%!$NFbMF$r%+%l%s%H%P%C%U%!$N%]%$%s%H0LCV$KA^F~$9$k!#(B
@item M-x append-to-file
@c Append region to contents of specified file, at the end.
$B%j!<%8%g%s$r;XDj$7$?%U%!%$%k$NFbMF$NKvHx$KIU2C$9$k!#(B
@end table

@c   To accumulate text into a buffer, use @kbd{M-x append-to-buffer}.
@c This reads a buffer name, then inserts a copy of the region into the
@c buffer specified.  If you specify a nonexistent buffer,
@c @code{append-to-buffer} creates the buffer.  The text is inserted
@c wherever point is in that buffer.  If you have been using the buffer for
@c editing, the copied text goes into the middle of the text of the buffer,
@c wherever point happens to be in it.
$B%F%-%9%H$r%P%C%U%!$KC_@Q$9$k$K$O!"(B@kbd{M-x append-to-buffer}$B$r;H$$$^$9!#(B
$B$3$l$O!"%P%C%U%!L>$rFI$_<h$j!"(B
$B%j!<%8%g%s$N%3%T!<$r;XDj$7$?%P%C%U%!$KA^F~$7$^$9!#(B
$BB8:_$7$J$$%P%C%U%!$r;XDj$7$?>l9g!"(B
@code{append-to-buffer}$B$O%P%C%U%!$r:n@.$7$^$9!#(B
$B%F%-%9%H$O!"$=$N%P%C%U%!Fb$N%]%$%s%H0LCV$KA^F~$5$l$^$9!#(B
$B%P%C%U%!$rJT=8MQ$K;H$C$F$$$k>l9g$K$O!"(B
$B$=$N%P%C%U%!Fb$N%F%-%9%H$N$"$$$@!"(B
$B$=$N;~E@$N%]%$%s%H0LCV$K%3%T!<$7$?%F%-%9%H$rA^F~$7$^$9!#(B

@c   Point in that buffer is left at the end of the copied text, so
@c successive uses of @code{append-to-buffer} accumulate the text in the
@c specified buffer in the same order as they were copied.  Strictly
@c speaking, @code{append-to-buffer} does not always append to the text
@c already in the buffer---it appends only if point in that buffer is at the end.
@c However, if @code{append-to-buffer} is the only command you use to alter
@c a buffer, then point is always at the end.
$B%3%T!<@h$N%P%C%U%!Fb$G$O!"%]%$%s%H$O%3%T!<$5$l$?%F%-%9%H$NKvHx$KCV$+$l$^$9!#(B
$B$7$?$,$C$F!"O"B3$7$F(B@code{append-to-buffer}$B$r;H$&$H!"(B
$B%3%T!<$7$?=g=x$G%P%C%U%!$K%F%-%9%H$,C_@Q$5$l$^$9!#(B
$B87L)$K$O!"(B@code{append-to-buffer}$B$O!"(B
$B%P%C%U%!Fb$N4{B8$N%F%-%9%H$KDI2C$9$k$H$O8B$j$^$;$s!#(B
$B$=$N%P%C%U%!$NKvHx$K%]%$%s%H$,$"$k>l9g$K8B$j!"DI2C$7$^$9!#(B
$B$7$+$7!"%P%C%U%!$rJQ99$9$k%3%^%s%I$,(B@code{append-to-buffer}$B$@$1$J$i$P!"(B
$B%]%$%s%H$O$D$M$KKvHx$KCV$+$l$F$$$^$9!#(B

@c   @kbd{M-x prepend-to-buffer} is just like @code{append-to-buffer}
@c except that point in the other buffer is left before the copied text, so
@c successive prependings add text in reverse order.  @kbd{M-x
@c copy-to-buffer} is similar except that any existing text in the other
@c buffer is deleted, so the buffer is left containing just the text newly
@c copied into it.
@kbd{M-x prepend-to-buffer}$B$O(B@code{append-to-buffer}$B$K$H$F$b$h$/;w$F$$$^$9$,!"(B
$B%3%T!<@h$N%P%C%U%!Fb$N%]%$%s%H$O!"(B
$B%3%T!<$7$?%F%-%9%H$ND>A0$KCV$+$l$kE@$,0[$J$j$^$9!#(B
$B$D$^$j!"B3$1$F$3$N%3%^%s%I$r;H$&$H!"(B
$B%F%-%9%H$O5U=g$KDI2C$5$l$F$$$-$^$9!#(B
@kbd{M-x copy-to-buffer}$B$bF1MM$G$9$,!"(B
$B;XDj$7$?%P%C%U%!Fb$N4{B8$N%F%-%9%H$r:o=|$7$^$9!#(B
$B$7$?$,$C$F!"%P%C%U%!$K$O?7$?$K%3%T!<$7$?%F%-%9%H$@$1$,;D$j$^$9!#(B

@c   To retrieve the accumulated text from another buffer, use the command
@c @kbd{M-x insert-buffer}; this too takes @var{buffername} as an argument.
@c It inserts a copy of the text in buffer @var{buffername} into the
@c selected buffer.  You can alternatively select the other buffer for
@c editing, then optionally move text from it by killing.  @xref{Buffers},
@c for background information on buffers.
$BJL$N%P%C%U%!$KC_@Q$7$?%F%-%9%H$r<h$j=P$9$K$O!"(B
$B%3%^%s%I(B@kbd{M-x insert-buffer}$B$r;H$$$^$9!#(B
$B$3$N%3%^%s%I$b0z?t$H$7$F(B@var{buffername}$B$rI,MW$H$7$^$9!#(B
$B%P%C%U%!(B@var{buffername}$BFb$N%F%-%9%H$N%3%T!<$r(B
$BA*Br$7$F$$$k%P%C%U%!$KA^F~$7$^$9!#(B
$B$"$k$$$O!"$=$N%P%C%U%!$rA*Br$7$FJT=8$7!"(B
$B>l9g$K$h$C$F$O%-%k$7$F$=$N%P%C%U%!$+$i%F%-%9%H$r0\F0$9$k$3$H$b$G$-$^$9!#(B
$B%P%C%U%!$K4X$9$kGX7J>pJs$O!"(B@xref{Buffers}$B!#(B

@c   Instead of accumulating text within Emacs, in a buffer, you can append
@c text directly into a file with @kbd{M-x append-to-file}, which takes
@c @var{filename} as an argument.  It adds the text of the region to the end
@c of the specified file.  The file is changed immediately on disk.
$B%F%-%9%H$r(BEmacs$B$N%P%C%U%!$KC_@Q$9$k$+$o$j$K!"(B
@kbd{M-x append-to-file}$B$r;H$C$F!"%F%-%9%H$rD>@\%U%!%$%k$KDI2C$G$-$^$9!#(B
$B$3$N%3%^%s%I$O0z?t$H$7$F(B@var{filename}$B$rI,MW$H$7$^$9!#(B
$B%j!<%8%g%s$N%F%-%9%H$r;XDj$7$?%U%!%$%k$NKvHx$KDI2C$7$^$9!#(B
$B%U%!%$%k$O%G%#%9%/>e$G$?$@$A$K99?7$5$l$^$9!#(B

@c   You should use @code{append-to-file} only with files that are
@c @emph{not} being visited in Emacs.  Using it on a file that you are
@c editing in Emacs would change the file behind Emacs's back, which
@c can lead to losing some of your editing.
$B$3$N%3%^%s%I$K;XDj$9$k%U%!%$%k$O!"(B
Emacs$B$GK,Ld$7$F(B@emph{$B$$$J$$(B}$B%U%!%$%k$@$1$K8B$k$Y$-$G$9!#(B
Emacs$B$GJT=8Cf$N%U%!%$%k$r;XDj$9$k$H!"(B
Emacs$B$K1#$l$F%U%!%$%k$rJQ99$9$k$3$H$K$J$j!"(B
$BJT=8FbMF$N0lIt$r<:$&$3$H$K$b$J$j$+$M$^$;$s!#(B

@node Rectangles, Registers, Accumulating Text, Top
@c @section Rectangles
@section $B6k7ANN0h(B
@c @cindex rectangle
@c @cindex columns (and rectangles)
@c @cindex killing rectangular areas of text
@cindex $B6k7ANN0h(B
@cindex $B7e!J$H6k7ANN0h!K(B
@cindex $B%F%-%9%H$N6k7ANN0h$N%-%k(B

@c   The rectangle commands operate on rectangular areas of the text: all
@c the characters between a certain pair of columns, in a certain range of
@c lines.  Commands are provided to kill rectangles, yank killed rectangles,
@c clear them out, fill them with blanks or text, or delete them.  Rectangle
@c commands are useful with text in multicolumn formats, and for changing
@c text into or out of such formats.
$B6k7ANN0h%3%^%s%I$O%F%-%9%H$N6k7ANN0h$rA`:n$7$^$9!#(B
$B6k7ANN0h$N%F%-%9%H$H$O!"(B
2$B$D$N9T$NHO0OFb$K$"$k(B2$B$D$N7e0LCV$N$"$$$@$K$"$kJ8;z$9$Y$F$r;X$7$^$9!#(B
$B6k7ANN0h$r%-%k$9$k!"%-%k$7$?6k7ANN0h$r%d%s%/$9$k!"(B
$B6k7ANN0h$r%/%j%"$9$k!"6k7ANN0h$r6uGr$d%F%-%9%H$G=<E6$9$k!"(B
$B6k7ANN0h$r:o=|$9$k!"$H$$$C$?%3%^%s%I$,$"$j$^$9!#(B
$B6k7ANN0h%3%^%s%I$O!"J#?tCJ$KAH$s$@%F%-%9%H$rA`:n$7$?$j!"(B
$B%F%-%9%H$r$=$N$h$&$KAH$s$@$jLa$7$?$j$9$k>l9g$KJXMx$G$9!#(B

@c   When you must specify a rectangle for a command to work on, you do it
@c by putting the mark at one corner and point at the opposite corner.  The
@c rectangle thus specified is called the @dfn{region-rectangle} because
@c you control it in about the same way the region is controlled.  But
@c remember that a given combination of point and mark values can be
@c interpreted either as a region or as a rectangle, depending on the
@c command that uses them.
$B%3%^%s%I$GA`:n$9$k6k7ANN0h$r;XDj$9$k$K$O!"(B
$B0lJ}$N6y$K%^!<%/$r@_Dj$7!"$=$NBP3Q$K%]%$%s%H$rCV$-$^$9!#(B
$B$3$N$h$&$K@_Dj$7$?6k7ANN0h$r(B@dfn{$B6k7A%j!<%8%g%s(B}
$B!J(Bregion-rectangle$B!K$H8F$S$^$9!#(B
$B$H$$$&$N$b!"%j!<%8%g%s$N@)8f$H;w$?J}K!$G6k7ANN0h$r@)8f$G$-$k$+$i$G$9!#(B
$B$7$+$7!"%]%$%s%H$H%^!<%/$NAH$O!"$=$l$r;H$&%3%^%s%I$K0MB8$7$F!"(B
$B%j!<%8%g%s$H$7$F2r<a$5$l$k!"$"$k$$$O!"(B
$B6k7ANN0h$H$7$F2r<a$5$l$k$3$H$KCm0U$7$F$/$@$5$$!#(B

@c   If point and the mark are in the same column, the rectangle they
@c delimit is empty.  If they are in the same line, the rectangle is one
@c line high.  This asymmetry between lines and columns comes about
@c because point (and likewise the mark) is between two columns, but within
@c a line.
$B%]%$%s%H$H%^!<%/$,F1$87e0LCV$K$"$k>l9g!"(B
$B$=$l$i$,@Z$jJ,$1$k6k7ANN0h$O6u$G$9!#(B
$BF1$89T>e$K$"$k>l9g$O!"6k7ANN0h$N9b$5$O(B1$B9T$G$9!#(B
$B7e$H9T$N07$$J}$,HsBP>N$G$"$k$N$O!"(B
$B%]%$%s%H!JF1MM$K%^!<%/!K$O(B2$B$D$N7e$N$"$$$@$K$"$k$N$KBP$7!"(B
$B9T$G$O$=$NCf$K$"$k$+$i$G$9!#(B

@table @kbd
@item C-x r k
@c Kill the text of the region-rectangle, saving its contents as the 
@c ``last killed rectangle'' (@code{kill-rectangle}).
$B6k7A%j!<%8%g%s$N%F%-%9%H$r%-%k$7!"(B
$B$=$NFbMF$r!X:G8e$K%-%k$7$?6k7ANN0h!Y$H$7$FJ]B8$9$k!J(B@code{kill-rectangle}$B!K!#(B
@item C-x r d
@c Delete the text of the region-rectangle (@code{delete-rectangle}).
$B6k7A%j!<%8%g%s$N%F%-%9%H$r:o=|$9$k!J(B@code{delete-rectangle}$B!K!#(B
@item C-x r y
@c Yank the last killed rectangle with its upper left corner at point
@c (@code{yank-rectangle}).
$B:G8e$K%-%k$7$?6k7ANN0h$r%]%$%s%H0LCV$r:8>e6y$H$7$F%d%s%/$9$k(B
$B!J(B@code{yank-rectangle}$B!K!#(B
@item C-x r o
@c Insert blank space to fill the space of the region-rectangle
@c (@code{open-rectangle}).  This pushes the previous contents of the
@c region-rectangle rightward.
$B6uGr$GKd$a$?6k7A%j!<%8%g%s$rA^F~$9$k!J(B@code{open-rectangle}$B!K!#(B
$B6k7A%j!<%8%g%s$ND>A0$NFbMF$O1&$K2!$7$d$i$l$k!#(B
@item M-x clear-rectangle
@c Clear the region-rectangle by replacing its contents with spaces.
$B6k7A%j!<%8%g%s$N$9$Y$F$N%F%-%9%H$r6uGr$GCV$-49$($F!"(B
$BFbMF$r%/%j%"$9$k!#(B
@item M-x delete-whitespace-rectangle
@c Delete whitespace in each of the lines on the specified rectangle,
@c starting from the left edge column of the rectangle.
$B;XDj$7$?6k7ANN0h$N3F9T$K$*$$$F!"(B
$B6k7ANN0h$N:8C<$+$iGrJ8;z$r:o=|$9$k!#(B
@item C-x r t @key{RET} @var{string} @key{RET}
@c Insert @var{string} on each line of the region-rectangle
@c (@code{string-rectangle}).
$B;XDj$7$?6k7ANN0h$N3F9T$K(B@var{string}$B$rA^F~$9$k(B
$B!J(B@code{string-rectangle}$B!K!#(B
@end table

@c   The rectangle operations fall into two classes: commands deleting and
@c inserting rectangles, and commands for blank rectangles.
$B6k7AA`:n$O(B2$B<oN`$KJ,N`$G$-$^$9!#(B
$B6k7ANN0h$r:o=|$7$?$jA^F~$7$?$j$9$k%3%^%s%I$H!"(B
$B6uGr$N6k7ANN0h$r07$&%3%^%s%I$G$9!#(B

@kindex C-x r k
@kindex C-x r d
@findex kill-rectangle
@findex delete-rectangle
@c   There are two ways to get rid of the text in a rectangle: you can
@c discard the text (delete it) or save it as the ``last killed''
@c rectangle.  The commands for these two ways are @kbd{C-x r d}
@c (@code{delete-rectangle}) and @kbd{C-x r k} (@code{kill-rectangle}).  In
@c either case, the portion of each line that falls inside the rectangle's
@c boundaries is deleted, causing following text (if any) on the line to
@c move left into the gap.
$B6k7ANN0hFb$N%F%-%9%H$r>C$9$K$O!"(B2$B$D$NJ}K!$,$"$j$^$9!#(B
$B%F%-%9%H$r<N$F$k!J:o=|$9$k!K$+!"(B
$B!X:G8e$K%-%k$7$?!Y6k7ANN0h$H$7$FJ]B8$9$k$+$G$9!#(B
$B$3$l$i$N5!G=$r<B8=$9$k%3%^%s%I$O!"(B@kbd{C-x r d}$B!J(B@code{delete-rectangle}$B!K$H(B
@kbd{C-x r k}$B!J(B@code{kill-rectangle}$B!K$G$9!#(B
$B$I$A$i$b!"6k7ANN0h$NFbB&$K$"$k3F9T$NItJ,$r:o=|$7!"(B
$B$=$l$h$j1&B&$K%F%-%9%H$,$"$l$P!"(B
$B7d4V$rKd$a$k$h$&$K$=$l$i$r:8$X0\F0$7$^$9!#(B

@c   Note that ``killing'' a rectangle is not killing in the usual sense; the
@c rectangle is not stored in the kill ring, but in a special place that
@c can only record the most recent rectangle killed.  This is because yanking
@c a rectangle is so different from yanking linear text that different yank
@c commands have to be used and yank-popping is hard to make sense of.
$B6k7ANN0h$N!X%-%k!Y$OIaDL$N0UL#$G$N%-%k$G$O$J$$!"(B
$B$H$$$&$3$H$KCm0U$7$F$/$@$5$$!#(B
$B6k7ANN0h$O%-%k%j%s%0$K$OJ]B8$5$l$^$;$s$,!"(B
$B:G8e$K%-%k$7$?6k7ANN0h$r(B1$B$D$@$15-O?$G$-$kFCJL$J>l=j$KJ]B8$5$l$^$9!#(B
$B$H$$$&$N$O!"6k7ANN0h$r%d%s%/$9$k$3$H$O!"(B
$B@~7A$N%F%-%9%H$N%d%s%/$H$OBg$-$/0[$J$j!"(B
$BFCJL$J%d%s%/%3%^%s%I$,I,MW$@$C$?$j!"(B
$B%d%s%/$7$?%F%-%9%H$NF~$l49$(A`:n$,0UL#$r$J$5$J$+$C$?$j$9$k$+$i$G$9!#(B

@kindex C-x r y
@findex yank-rectangle
@c   To yank the last killed rectangle, type @kbd{C-x r y}
@c (@code{yank-rectangle}).  Yanking a rectangle is the opposite of killing
@c one.  Point specifies where to put the rectangle's upper left corner.
@c The rectangle's first line is inserted there, the rectangle's second
@c line is inserted at a position one line vertically down, and so on.  The
@c number of lines affected is determined by the height of the saved
@c rectangle.
$B:G8e$K%-%k$7$?6k7ANN0h$r%d%s%/$9$k$K$O!"(B
@kbd{C-x r y}$B!J(B@code{yank-rectangle}$B!K$HBG$A$^$9!#(B
$B6k7ANN0h$N%d%s%/$O6k7ANN0h$N%-%k$N5U$G$9!#(B
$B%]%$%s%H$O6k7ANN0h$N:8>e6y$N0LCV$r;XDj$7$^$9!#(B
$B$=$N>l=j$K$O6k7ANN0h$N(B1$B9TL\$,A^F~$5$l!"(B
$B6k7ANN0h$N(B2$B9TL\$O$=$N$D$.$N9T$K$H$$$&$h$&$KA^F~$5$l$^$9!#(B
$B1F6A$5$l$k9T?t$O!"J]B8$5$l$F$$$k6k7ANN0h$N9b$5$G7h$^$j$^$9!#(B

@c   You can convert single-column lists into double-column lists using
@c rectangle killing and yanking; kill the second half of the list as a
@c rectangle and then yank it beside the first line of the list.
@c @xref{Two-Column}, for another way to edit multi-column text.
$B6k7ANN0h$N%-%k$H%d%s%/$r;H$&$H!"(B1$BCJAH$_$N0lMwI=$r(B2$BCJAH$N0lMwI=$KJQ49$G$-$^$9!#(B
$B0lMwI=$N8eH>$r6k7ANN0h$H$7$F%-%k$7$F!"(B
$B0lMwI=$NBh(B1$B9T$NNY$K%d%s%/$9$l$P$h$$$N$G$9!#(B

@c   You can also copy rectangles into and out of registers with @kbd{C-x r
@c r @var{r}} and @kbd{C-x r i @var{r}}.  @xref{RegRect,,Rectangle
@c Registers}.
$B$^$?!"(B@kbd{C-x r r @var{r}}$B$d(B@kbd{C-x r i @var{r}}$B$r;H$($P!"(B
$B6k7ANN0h$r%l%8%9%?$K%3%T!<$7$?$j!"%l%8%9%?$+$i6k7ANN0h$r%3%T!<$7$?$j$G$-$^$9!#(B
@xref{RegRect,,Rectangle Registers}$B!#(B

@kindex C-x r o
@findex open-rectangle
@findex clear-rectangle
@c   There are two commands you can use for making blank rectangles:
@c @kbd{M-x clear-rectangle} which blanks out existing text, and @kbd{C-x r
@c o} (@code{open-rectangle}) which inserts a blank rectangle.  Clearing a
@c rectangle is equivalent to deleting it and then inserting a blank
@c rectangle of the same size.
$B6uGr$N6k7ANN0h$r:n$k%3%^%s%I$O(B2$B$D$"$j$^$9!#(B
@kbd{M-x clear-rectangle}$B$O4{B8$N%F%-%9%H$r6uGr$GCV$-49$(!"(B
@kbd{C-x r o}$B!J(B@code{open-rectangle}$B!K$O6uGr$N6k7ANN0h$rA^F~$7$^$9!#(B
$B6k7ANN0h$r%/%j%"$9$k$3$H$O!"(B
$B6k7ANN0h$r:o=|$7$F$+$iF1$8Bg$-$5$N6uGr$N6k7ANN0h$rA^F~$9$k$N$HF1$8$3$H$G$9!#(B

@findex delete-whitespace-rectangle
@c   The command @kbd{M-x delete-whitespace-rectangle} deletes horizontal
@c whitespace starting from a particular column.  This applies to each of
@c the lines in the rectangle, and the column is specified by the left
@c edge of the rectangle.  The right edge of the rectangle does not make
@c any difference to this command.
$B%3%^%s%I(B@kbd{M-x delete-whitespace-rectangle}$B$O!"(B
$BFCDj$N7e0LCV$+$i;O$^$k2#$KJB$s$@GrJ8;z$r:o=|$7$^$9!#(B
$B6k7ANN0hFb$N3F9T$K:nMQ$7!"7e0LCV$O6k7ANN0h$N:8C<$G$9!#(B
$B6k7ANN0h$N1&C<$O$3$N%3%^%s%I$K$O4X78$"$j$^$;$s!#(B

@kindex C-x r t
@findex string-rectangle
@c   The command @kbd{C-x r t} (@code{M-x string-rectangle}) replaces the
@c rectangle with a specified string (inserted once on each line).  The
@c string's width need not be the same as the width of the rectangle.  If
@c the string's width is less, the text after the rectangle shifts left; if
@c the string is wider than the rectangle, the text after the rectangle
@c shifts right.
$B%3%^%s%I(B@kbd{C-x r t}$B!J(B@kbd{M-x string-rectangle}$B!K$O!"(B
$B6k7ANN0h$r;XDj$7$?J8;zNs$GCV$-49$($^$9!#(B
$BJ8;zNs$NI}$O!"6k7ANN0h$NI}$HF1$8$G$"$kI,MW$O$"$j$^$;$s!#(B
$BJ8;zNs$NI}$,B-$j$J$1$l$P!"6k7ANN0h$N1&B&$K$"$k%F%-%9%H$O:8$X0\F0$7$^$9!#(B
$BJ8;zNs$NI}$,9-$1$l$P!"6k7ANN0h$N1&B&$K$"$k%F%-%9%H$O1&$X0\F0$7$^$9!#(B