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
|
@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.
@node Mark, Killing, Help, Top
@c @chapter The Mark and the Region
@chapter $B%^!<%/$H%j!<%8%g%s(B
@c @cindex mark
@c @cindex setting a mark
@c @cindex region
@cindex $B%^!<%/(B
@cindex $B%^!<%/$N@_Dj(B
@cindex $B%j!<%8%g%s(B
@c Many Emacs commands operate on an arbitrary contiguous part of the
@c current buffer. To specify the text for such a command to operate on,
@c you set @dfn{the mark} at one end of it, and move point to the other
@c end. The text between point and the mark is called @dfn{the region}.
@c Emacs highlights the region whenever there is one, if you enable
@c Transient Mark mode (@pxref{Transient Mark}).
Emacs$B$N?tB?$/$N%3%^%s%I$O!"%+%l%s%H%P%C%U%!$NG$0U$NO"B3NN0h$rA`:n$7$^$9!#(B
$B$3$N$h$&$J%3%^%s%I$KA`:nBP>]$H$J$k%F%-%9%H$r;XDj$9$k$K$O!"(B
$B$=$N0lJ}$NC<$K(B@dfn{$B%^!<%/(B}$B!J(Bmark$B!K$rCV$-!"(B
$B$b$&0lJ}$NC<$K%]%$%s%H$r0\F0$7$^$9!#(B
$B%]%$%s%H$H%^!<%/$K64$^$l$?%F%-%9%H$r(B@dfn{$B%j!<%8%g%s(B}$B!J(Bregion$B!K$H8F$S$^$9!#(B
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$r%*%s$K$9$k$H!"(B
$B%j!<%8%g%s$,B8:_$9$l$P(B
Emacs$B$O$D$M$K$=$N%j!<%8%g%s$r6/D4I=<($7$^$9(B
$B!J(B@pxref{Transient Mark}$B!K!#(B
@c You can move point or the mark to adjust the boundaries of the region.
@c It doesn't matter which one is set first chronologically, or which one
@c comes earlier in the text. Once the mark has been set, it remains where
@c you put it until you set it again at another place. Each Emacs buffer
@c has its own mark, so that when you return to a buffer that had been
@c selected previously, it has the same mark it had before.
$B%j!<%8%g%s$N6-3&$rD4@0$9$k$K$O!"%]%$%s%H$d%^!<%/$r0\F0$7$^$9!#(B
$B;~4VE*$K$I$A$i$r@h$K@_Dj$7$?$H$+!"(B
$B%F%-%9%HFb$G$I$A$i$,@h$K$"$k$+$H$+$O4X78$"$j$^$;$s!#(B
$B$$$C$?$s%^!<%/$r@_Dj$9$k$H!"B>$N2U=j$K:F@_Dj$9$k$^$G!"(B
$B$=$N0LCV>pJs$O$=$N$^$^JQ$o$j$^$;$s!#(B
$B3F(BEmacs$B%P%C%U%!$K$O8DJL$K%^!<%/$,$"$j$^$9$+$i!"(B
$B0JA0$KA*Br$7$?%P%C%U%!$XLa$C$?$H$-$K$O!"(B
$B0JA0$HF1$8$^$^$N%^!<%/$,;D$C$F$$$^$9!#(B
@c Many commands that insert text, such as @kbd{C-y} (@code{yank}) and
@c @kbd{M-x insert-buffer}, position point and the mark at opposite ends of
@c the inserted text, so that the region contains the text just inserted.
@kbd{C-y}$B!J(B@code{yank}$B!K$d(B@kbd{M-x insert-buffer}$B$J$I$N%F%-%9%H$r(B
$BA^F~$9$k%3%^%s%I$NB?$/$O!"A^F~$7$?%F%-%9%H$NN>C<$K%]%$%s%H$H%^!<%/$rCV$$$F!"(B
$BA^F~$7$?%F%-%9%H$,%j!<%8%g%s$K4^$^$l$k$h$&$K$7$^$9!#(B
@c Aside from delimiting the region, the mark is also useful for
@c remembering a spot that you may want to go back to. To make this
@c feature more useful, each buffer remembers 16 previous locations of the
@c mark in the @dfn{mark ring}.
$B%j!<%8%g%s$N6-3&$rDj$a$k$3$H0J30$K!"(B
$B$"$H$GLa$k2DG=@-$N$"$k2U=j$r3P$($F$*$/$?$a$K$b%^!<%/$r;H$($^$9!#(B
$B$3$N5!G=$r$h$j;H$$$d$9$/$9$k$?$a$K!"(B
$B3F%P%C%U%!$G$O!"$=$l$^$G$K@_Dj$7$?(B16$B8D$N%^!<%/0LCV$r(B
@dfn{$B%^!<%/%j%s%0(B}$B!J(Bmark ring$B!K$K5-O?$7$F$$$^$9!#(B
@menu
* Setting Mark:: Commands to set the mark.
* Transient Mark:: How to make Emacs highlight the region--
when there is one.
* Using Region:: Summary of ways to operate on contents of the region.
* Marking Objects:: Commands to put region around textual units.
* Mark Ring:: Previous mark positions saved so you can go back there.
* Global Mark Ring:: Previous mark positions in various buffers.
@end menu
@node Setting Mark
@c @section Setting the Mark
@section $B%^!<%/$r@_Dj$9$k(B
@c Here are some commands for setting the mark:
$B%^!<%/$r@_Dj$9$k%3%^%s%I$O$D$.$N$H$*$j$G$9!#(B
@c WideCommands
@table @kbd
@item C-@key{SPC}
@c Set the mark where point is (@code{set-mark-command}).
$B%]%$%s%H0LCV$K%^!<%/$rCV$/!J(B@code{set-mark-command}$B!K!#(B
@item C-@@
@c The same.
$B>e$HF1MM!#(B
@item C-x C-x
@c Interchange mark and point (@code{exchange-point-and-mark}).
$B%^!<%/$H%]%$%s%H$rF~$l49$($k!J(B@code{exchange-point-and-mark}$B!K!#(B
@item Drag-Mouse-1
@c Set point and the mark around the text you drag across.
$B%I%i%C%0$7$?%F%-%9%H$N<~0O$K%]%$%s%H$H%^!<%/$r@_Dj$9$k!#(B
@item Mouse-3
@c Set the mark where point is, then move point to where you click
@c (@code{mouse-save-then-kill}).
$B%]%$%s%H0LCV$K%^!<%/$r@_Dj$7!"%/%j%C%/$7$?2U=j$K%]%$%s%H$r0\F0$9$k(B
$B!J(B@code{mouse-save-then-kill}$B!K!#(B
@end table
@c For example, suppose you wish to convert part of the buffer to
@c upper case, using the @kbd{C-x C-u} (@code{upcase-region}) command,
@c which operates on the text in the region. You can first go to the
@c beginning of the text to be capitalized, type @kbd{C-@key{SPC}} to put
@c the mark there, move to the end, and then type @kbd{C-x C-u}. Or, you
@c can set the mark at the end of the text, move to the beginning, and then
@c type @kbd{C-x C-u}.
$B$?$H$($P!"%3%^%s%I(B@kbd{C-x C-u}$B!J(B@code{upcase-region}$B!K$r;H$C$F!"(B
$B%P%C%U%!$N$"$kItJ,$r$9$Y$FBgJ8;z$KJQ49$7$?$$$H$7$^$7$g$&!#(B
$B$3$N%3%^%s%I$O!"%j!<%8%g%sCf$N%F%-%9%H$K:nMQ$7$^$9!#(B
$B$^$:!"BgJ8;z$KJQ49$7$?$$%F%-%9%H$N@hF,$K0\F0$7!"(B
@kbd{C-@key{SPC}}$B$HBG$C$F%^!<%/$r@_Dj$7$^$9!#(B
$BB3$$$F%F%-%9%H$N=*C<$K0\F0$7$F(B@kbd{C-x C-u}$B$HBG$A$^$9!#(B
$B$"$k$$$O!"@h$K%F%-%9%H$N=*C<$K%^!<%/$r@_Dj$7$F!"(B
$B%F%-%9%H$N;OE@$K0\F0$7$F$+$i(B@kbd{C-x C-u}$B$HBG$A$^$9!#(B
@kindex C-SPC
@findex set-mark-command
@c The most common way to set the mark is with the @kbd{C-@key{SPC}} command
@c (@code{set-mark-command}). This sets the mark where point is. Then you
@c can move point away, leaving the mark behind.
$B%^!<%/$r@_Dj$9$k$b$C$H$b0lHLE*$JJ}K!$O!"(B
@kbd{C-@key{SPC}}$B%3%^%s%I!J(B@code{set-mark-command}$B!K$r;H$&$3$H$G$9!#(B
$B$3$N%3%^%s%I$O!"%]%$%s%H0LCV$K%^!<%/$r@_Dj$7$^$9!#(B
$B$=$&$9$l$P!"%^!<%/$rCV$$$?$^$^$G!"%]%$%s%H$r0\F0$G$-$^$9!#(B
@c There are two ways to set the mark with the mouse. You can drag mouse
@c button one across a range of text; that puts point where you release the
@c mouse button, and sets the mark at the other end of that range. Or you
@c can click mouse button three, which sets the mark at point (like
@c @kbd{C-@key{SPC}}) and then moves point (like @kbd{Mouse-1}). Both of
@c these methods copy the region into the kill ring in addition to setting
@c the mark; that gives behavior consistent with other window-driven
@c applications, but if you don't want to modify the kill ring, you must
@c use keyboard commands to set the mark. @xref{Mouse Commands}.
$B%^%&%9$r;H$C$?%^!<%/$N@_DjJ}K!$O(B2$B$D$"$j$^$9!#(B
$B%F%-%9%H$N$"$kHO0O$G%^%&%9%\%?%s(B1$B$r%I%i%C%0$7$^$9!#(B
$B%^%&%9%\%?%s$rN%$7$?0LCV$K%]%$%s%H$,CV$+$l!"(B
$B%I%i%C%0$r3+;O$7$?2U=j$K%^!<%/$,@_Dj$5$l$^$9!#(B
$B$"$k$$$O!"%^%&%9%\%?%s(B3$B$r%/%j%C%/$7$^$9!#(B
$B$3$l$O!J(B@kbd{C-@key{SPC}}$B$HF1MM$K!K%]%$%s%H0LCV$K%^!<%/$r@_Dj$7$F$+$i!"(B
$B%]%$%s%H$r!J(B@kbd{Mouse-1}$B$N$h$&$K!K0\F0$7$^$9!#(B
$BN><T$O!"%^!<%/$r@_Dj$9$k$@$1$G$J$/!"%j!<%8%g%s$r%-%k%j%s%0$K%3%T!<$7$^$9!#(B
$B$3$l$O!"B>$N%&%#%s%I%&%"%W%j%1!<%7%g%s$NF0:n$H0l4S@-$r;}$?$;$k$?$a$G$9!#(B
$B%-%k%j%s%0$rJQ99$7$?$/$J$1$l$P!"(B
$B%-!<%\!<%I%3%^%s%I$r;H$C$F%^!<%/$r@_Dj$9$kI,MW$,$"$j$^$9!#(B
@xref{Mouse Commands}$B!#(B
@kindex C-x C-x
@findex exchange-point-and-mark
@c Ordinary terminals have only one cursor, so there is no way for Emacs
@c to show you where the mark is located. You have to remember. The usual
@c solution to this problem is to set the mark and then use it soon, before
@c you forget where it is. Alternatively, you can see where the mark is
@c with the command @kbd{C-x C-x} (@code{exchange-point-and-mark}) which
@c puts the mark where point was and point where the mark was. The extent
@c of the region is unchanged, but the cursor and point are now at the
@c previous position of the mark. In Transient Mark mode, this command
@c reactivates the mark.
$BIaDL$NC<Kv$K$O%+!<%=%k$O(B1$B$D$7$+$"$j$^$;$s$+$i!"(B
Emacs$B$K$O%^!<%/$rCV$$$?0LCV$rI=<($9$k=Q$O$"$j$^$;$s!#(B
$B%f!<%6!<$,$=$N0LCV$r3P$($F$*$/I,MW$,$"$j$^$9!#(B
$B$3$NLdBj$KBP$9$kDL>o$N2r7hJ}K!$O!"%^!<%/$r@_Dj$7$?$i!"(B
$BK:$l$F$7$^$&$^$($K$?$@$A$K$=$l$rMxMQ$9$k$3$H$G$9!#(B
$B$"$k$$$O!"(B@kbd{C-x C-x}$B!J(B@code{exchange-point-and-mark}$B!K%3%^%s%I$r;H$C$F!"(B
$B%^!<%/0LCV$r3NG'$7$^$9!#(B
$B$3$N%3%^%s%I$O!"%]%$%s%H0LCV$K%^!<%/$rCV$-!"(B
$B%^!<%/$N$"$C$?0LCV$K%]%$%s%H$rCV$-$^$9!#(B
$B%j!<%8%g%s$NHO0O$OJQ$o$i$:$K!"(B
$B%+!<%=%k$H%]%$%s%H$O0JA0%^!<%/$N$"$C$?2U=j$K0\F0$7$^$9!#(B
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$G$O!"(B
$B$3$N%3%^%s%I$O%^!<%/$r:FEY3h@-$K$7$^$9!#(B
@c @kbd{C-x C-x} is also useful when you are satisfied with the position
@c of point but want to move the other end of the region (where the mark
@c is); do @kbd{C-x C-x} to put point at that end of the region, and then
@c move it. A second use of @kbd{C-x C-x}, if necessary, puts the mark at
@c the new position with point back at its original position.
$B%]%$%s%H0LCV$rJQ$($:$K!"(B
$B%j!<%8%g%s$N$b$&0lJ}$NC<!J%^!<%/$N0LCV!K$r0\F0$5$;$?$$>l9g$K$b!"(B
@kbd{C-x C-x}$B$OJXMx$JJ}K!$G$9!#(B
$B$^$:!"(B@kbd{C-x C-x}$B$G%]%$%s%H$r%j!<%8%g%s$N0lJ}$NC<$K0\$7$F!"(B
$B$=$NC<$r0\F0$7$^$9!#(B
$BI,MW$J$i$P!"$b$&(B1$BEY(B@kbd{C-x C-x}$B$r;H$C$F?7$7$$0LCV$K%^!<%/$rCV$-!"(B
$B%]%$%s%H$r$b$H$N0LCV$KLa$7$^$9!#(B
@kindex C-@@
@c There is no such character as @kbd{C-@key{SPC}} in ASCII; when you
@c type @key{SPC} while holding down @key{CTRL}, what you get on most
@c ordinary terminals is the character @kbd{C-@@}. This key is actually
@c bound to @code{set-mark-command}. But unless you are unlucky enough to
@c have a terminal where typing @kbd{C-@key{SPC}} does not produce
@c @kbd{C-@@}, you might as well think of this character as
@c @kbd{C-@key{SPC}}. Under X, @kbd{C-@key{SPC}} is actually a distinct
@c character, but its binding is still @code{set-mark-command}.
ASCII$B$K$O!"(B@kbd{C-@key{SPC}}$B$H$$$&J8;z$OB8:_$7$^$;$s!#(B
@key{CTRL}$B$r2!$72<$2$J$,$i(B@key{SPC}$B$rBG$D$H!"(B
$B$[$H$s$I$NIaDL$NC<Kv$G$OJ8;z(B@kbd{C-@@}$B$K$J$j$^$9!#(B
$B$3$N%-!<$O!"<B:]$K(B@code{set-mark-command}$B$K%P%$%s%I$7$F$"$j$^$9!#(B
$B$?$@$7!"9,1?$K$b(B@kbd{C-@key{SPC}}$B$G(B@kbd{C-@@}$B$rAw=P$9$kC<Kv$r(B
$B;H$C$F$$$k$N$G$"$l$P!"(B
@kbd{C-@@}$B$r(B@kbd{C-@key{SPC}}$B$H$_$J$7$F$+$^$$$^$;$s!#(B
X$B%&%#%s%I%&%7%9%F%`$G$O!"(B@kbd{C-@key{SPC}}$B$O<B:]$K$O(B
$BJL$NJ8;z$H$7$FG'<1$5$l$^$9$,!"(B
$B$=$N%P%$%s%I$O$d$O$j(B@code{set-mark-command}$B$G$9!#(B
@node Transient Mark
@c @section Transient Mark Mode
@section $B;CDj%^!<%/%b!<%I!J(Btransient-mark$B%b!<%I!K(B
@c @cindex mode, Transient Mark
@c @cindex Transient Mark mode
@c @cindex highlighting region
@c @cindex region highlighting
@cindex $B%b!<%I!"(BTransient Mark
@cindex $B;CDj%^!<%/%b!<%I!J(BTransient Mark mode$B!K(B
@cindex $B6/D4I=<(!"%j!<%8%g%s(B
@cindex $B%j!<%8%g%s$N6/D4I=<((B
@c Emacs can highlight the current region, using X Windows. But normally
@c it does not. Why not?
X$B%&%#%s%I%&%7%9%F%`$r;H$C$F$$$k$N$G$"$l$P!"(B
Emacs$B$O%+%l%s%H%j!<%8%g%s$r6/D4I=<($G$-$^$9!#(B
$B$?$@$7!"DL>o$O%j!<%8%g%s$r6/D4I=<($7$^$;$s!#(B
$B$J$<$G$7$g$&$+!)(B
@c Highlighting the region doesn't work well ordinarily in Emacs, because
@c once you have set a mark, there is @emph{always} a region (in that
@c buffer). And highlighting the region all the time would be a nuisance.
$B<B$O!"$b$H$b$H$N(BEmacs$B$G$O%j!<%8%g%s$N6/D4I=<($r$&$^$/$G$-$J$$$N$G$9!#(B
$B$$$C$?$s%^!<%/$r@_Dj$7$F$7$^$&$H!"(B
$B$=$N%P%C%U%!Fb$K$O(B@emph{$B$D$M$K(B}$B%j!<%8%g%s$,B8:_$9$k$3$H$K$J$k$+$i$G$9!#(B
$B%j!<%8%g%s$r6/D4I=<($7B3$1$F$bLBOG$J$@$1$G$7$g$&!#(B
@c You can turn on region highlighting by enabling Transient Mark mode.
@c This is a more rigid mode of operation in which the region ``lasts''
@c only temporarily, so you must set up a region for each command that uses
@c one. In Transient Mark mode, most of the time there is no region;
@c therefore, highlighting the region when it exists is convenient.
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$r%*%s$K$9$k$H!"(B
$B%j!<%8%g%s$N6/D4I=<(5!G=$r%*%s$K$G$-$^$9!#(B
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$O!"(B
$B%j!<%8%g%s$,0l;~E*$K$7$+!XB8B3!Y$7$J$$!"(B
$BDL>o$h$j$-$S$7$$A`:n%b!<%I$G$9!#(B
$B%f!<%6!<$O!"%j!<%8%g%s$r;H$&%3%^%s%I$4$H$K%j!<%8%g%s$r@_Dj$9$kI,MW$,$"$j$^$9!#(B
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$G$O!"(B
$B$[$H$s$I$N4|4V!"%j!<%8%g%s$OB8:_$7$^$;$s!#(B
$B$=$l$f$(!"%j!<%8%g%s$,B8:_$9$k$H$-$K%j!<%8%g%s$r6/D4I=<($7$F$b(B
$B<YKb$K$J$j$^$;$s!#(B
@findex transient-mark-mode
@c To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}.
@c This command toggles the mode, so you can repeat the command to turn off
@c the mode.
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$r%*%s$K$9$k$K$O!"(B
@kbd{M-x transient-mark-mode}$B$HBG$A$^$9!#(B
$B$3$N%3%^%s%I$O%b!<%I$N%*%s!?%*%U$r@Z$jBX$($^$9$+$i!"(B
$B%b!<%I$r%*%U$K$7$?$$$H$-$K$O%3%^%s%I$r$b$&(B1$BEY7+$jJV$7$^$9!#(B
@c Here are the details of Transient Mark mode:
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$N>\:Y$r0J2<$K<($7$^$9!#(B
@itemize @bullet
@item
@c To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}).
@c This makes the mark active; as you move point, you will see the region
@c highlighting grow and shrink.
$B%^!<%/$r@_Dj$9$k$K$O!"(B@kbd{C-@key{SPC}}$B!J(B@code{set-mark-command}$B!K$HBG$D!#(B
$B$3$NA`:n$O%^!<%/$r3h@-$K$9$k!#(B
$B%]%$%s%H$r0\F0$9$k$?$S$K!"(B
$B6/D4I=<($5$l$?%j!<%8%g%s$,9-$,$C$?$j69$^$C$?$j$9$k!#(B
@item
@c The mouse commands for specifying the mark also make it active. So do
@c keyboard commands whose purpose is to specify a region, including
@c @kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and
@c @kbd{C-x h}.
$B%^!<%/$r@_Dj$9$k%^%&%9%3%^%s%I$b!"%^!<%/$r3h@-$K$9$k!#(B
@kbd{M-@@}$B!"(B@kbd{C-M-@@}$B!"(B@kbd{M-h}$B!"(B@kbd{C-M-h}$B!"(B
@kbd{C-x C-p}$B!"(B@kbd{C-x h}$B$J$I$N%j!<%8%g%s$r@_Dj$9$k$?$a$N(B
$B%-!<%\!<%I%3%^%s%I$b%^!<%/$r3h@-$K$9$k!#(B
@item
@c When the mark is active, you can execute commands that operate on the
@c region, such as killing, indenting, or writing to a file.
$B%^!<%/$,3h@-$J$i$P!"%-%k!";z2<$2!"%U%!%$%k$X$N=q$-=P$7$J$I$N(B
$B%j!<%8%g%s$rA`:n$9$k%3%^%s%I$r<B9T$G$-$k!#(B
@item
@c Any change to the buffer, such as inserting or deleting a character,
@c deactivates the mark. This means any subsequent command that operates
@c on a region will get an error and refuse to operate. You can make the
@c region active again by typing @kbd{C-x C-x}.
$BJ8;z$NA^F~$d:o=|$H$$$C$?%P%C%U%!$KBP$9$kJQ99$O!"%^!<%/$rIT3h@-$K$9$k!#(B
$B$D$^$j!"$3$l0J9_$K%j!<%8%g%s$rA`:n$9$k%3%^%s%I$r<B9T$9$k$H%(%i!<$H$J$j!"(B
$B<B9T$O5qH]$5$l$k!#(B
$B%j!<%8%g%s$r:FEY3h@-$K$9$k$K$O!"(B@kbd{C-x C-x}$B$HBG$D!#(B
@item
@c Commands like @kbd{M->} and @kbd{C-s} that ``leave the mark behind'' in
@c addition to some other primary purpose do not activate the new mark.
@c You can activate the new region by executing @kbd{C-x C-x}
@c (@code{exchange-point-and-mark}).
@kbd{M->}$B$d(B@kbd{C-s}$B$N$h$&$J!"K\Mh$NL\E*$rC#@.$7$?$"$H$K!X%^!<%/$r;D$9!Y(B
$B<oN`$N%3%^%s%I$O!"?7$7$$%^!<%/$r3h@-$K$7$J$$!#(B
$B$3$N$h$&$J?7$7$$%j!<%8%g%s$r3h@-$K$9$k$K$O!"(B
@kbd{C-x C-x}$B!J(B@code{exchange-point-and-mark}$B!K$r<B9T$9$k!#(B
@item
@c @kbd{C-s} when the mark is active does not alter the mark.
$B%^!<%/$,3h@-$G$"$k$H$-$K$O!"(B@kbd{C-s}$B$O%^!<%/$rJQ99$7$J$$!#(B
@item
@c Quitting with @kbd{C-g} deactivates the mark.
@kbd{C-g}$B$GCfCG$9$k$H!"%^!<%/$rIT3h@-$K$9$k!#(B
@end itemize
@c Highlighting of the region uses the @code{region} face; you can
@c customize how the region is highlighted by changing this face.
@c @xref{Face Customization}.
$B%j!<%8%g%s$N6/D4I=<($K$O!"(B@code{region}$B%U%'%$%9$r;H$$$^$9!#(B
$B$3$N%U%'%$%9$rJQ99$9$l$P!"%j!<%8%g%s$N6/D4I=<(J}K!$r%+%9%?%^%$%:$G$-$^$9!#(B
@vindex highlight-nonselected-windows
@c When multiple windows show the same buffer, they can have different
@c regions, because they can have different values of point (though they
@c all share one common mark position). Ordinarily, only the selected
@c window highlights its region (@pxref{Windows}). However, if the
@c variable @code{highlight-nonselected-windows} is non-@code{nil}, then
@c each window highlights its own region (provided that Transient Mark mode
@c is enabled and the window's buffer's mark is active).
$BJ#?t$N%&%#%s%I%&$GF1$8%P%C%U%!$rI=<($7$F$$$k$H$-$K$O!"(B
$B$=$l$>$l$N%&%#%s%I%&$GJL$NItJ,$rI=<($G$-$^$9!#(B
$B$H$$$&$N$O!"!J%^!<%/0LCV$O6&M-$5$l$k$,!K(B
$B3F%&%#%s%I%&$4$H$KJL!9$K%]%$%s%H$NCM$,$"$k$+$i$G$9!#(B
$BDL>o!"A*Br$5$l$?%&%#%s%I%&$G$N$_!"(B
$B%j!<%8%g%s$r6/D4I=<($7$^$9!J(B@pxref{Windows}$B!K!#(B
$B$7$+$7!"JQ?t(B@code{highlight-nonselected-windows}$B$K(B@code{nil}$B0J30$r@_Dj$9$k$H!"(B
$B!J;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$,%*%s$G$"$j!"$+$D!"(B
$B%&%#%s%I%&$N%P%C%U%!$N%^!<%/$,3h@-$G$"$k>l9g$K8B$j!K(B
$B3F%&%#%s%I%&$G$=$l$>$l$N%j!<%8%g%s$r6/D4I=<($7$^$9!#(B
@c When Transient Mark mode is not enabled, every command that sets the
@c mark also activates it, and nothing ever deactivates it.
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$,%*%U$G$"$k$H!"(B
$B%^!<%/$r@_Dj$9$k$9$Y$F$N%3%^%s%I$O%^!<%/$r3h@-$K$7!"(B
$B%^!<%/$rIT3h@-$K$9$k$b$N$O2?$b$"$j$^$;$s!#(B
@vindex mark-even-if-inactive
@c If the variable @code{mark-even-if-inactive} is non-@code{nil} in
@c Transient Mark mode, then commands can use the mark and the region
@c even when it is inactive. Region highlighting appears and disappears
@c just as it normally does in Transient Mark mode, but the mark doesn't
@c really go away when the highlighting disappears.
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$K$*$$$F!"(B
$BJQ?t(B@code{mark-even-if-inactive}$B$,(B@code{nil}$B0J30$G$"$k$H!"(B
$B%^!<%/$,IT3h@-$G$"$C$F$b%3%^%s%I$O%^!<%/$d%j!<%8%g%s$rMxMQ$G$-$^$9!#(B
$BDL>o$N;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$HF1MM$K!"(B
$B%j!<%8%g%s$,6/D4I=<($5$l$?$j$5$l$J$+$C$?$j$7$^$9$,!"(B
$B6/D4I=<($5$l$F$$$J$/$F$b%^!<%/$,K\Ev$K$J$/$J$k$3$H$O$"$j$^$;$s!#(B
@c @cindex Zmacs mode
@cindex zmacs$B%b!<%I(B
@c Transient Mark mode is also sometimes known as ``Zmacs mode''
@c because the Zmacs editor on the MIT Lisp Machine handled the mark in a
@c similar way.
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$O!X(Bzmacs$B%b!<%I!Y$H$7$F$bCN$i$l$F$$$^$9!#(B
$B$H$$$&$N$b!"(BMIT$B$N(BLisp$B%^%7%s>e$GF0:n$7$F$$$?(BZmacs$B%(%G%#%?$,(B
$BF1$8$h$&$K%^!<%/$r07$C$F$$$?$+$i$G$9!#(B
@node Using Region
@c @section Operating on the Region
@section $B%j!<%8%g%s$KBP$9$kA`:n(B
@c @cindex operations on a marked region
@cindex $B%^!<%/IU$1$7$?%j!<%8%g%s$KBP$9$kA`:n(B
@c Once you have a region and the mark is active, here are some of the
@c ways you can operate on the region:
$B$$$C$?$s%j!<%8%g%s$r@_Dj$7%^!<%/$r3h@-$K$9$l$P!"(B
$B0J2<$N$h$&$K%j!<%8%g%s$rA`:n$G$-$^$9!#(B
@itemize @bullet
@item
@c Kill it with @kbd{C-w} (@pxref{Killing}).
@kbd{C-w}$B%3%^%s%I$G%-%k$9$k!J(B@pxref{Killing}$B!K!#(B
@item
@c Save it in a register with @kbd{C-x r s} (@pxref{Registers}).
@kbd{C-x r s}$B$G%l%8%9%?$KJ]B8$9$k!J(B@pxref{Registers}$B!K!#(B
@item
@c Save it in a buffer or a file (@pxref{Accumulating Text}).
$B%P%C%U%!$d%U%!%$%k$KJ]B8$9$k!J(B@pxref{Accumulating Text}$B!K!#(B
@item
@c Convert case with @kbd{C-x C-l} or @kbd{C-x C-u} (@pxref{Case}).
@kbd{C-x C-l}$B$d(B@kbd{C-x C-u}$B$GBgJ8;z>.J8;z$rJQ49$9$k!J(B@pxref{Case}$B!K!#(B
@item
@c Indent it with @kbd{C-x @key{TAB}} or @kbd{C-M-\} (@pxref{Indentation}).
@kbd{C-x @key{TAB}}$B$d(B@kbd{C-M-\}$B$G;z2<$2$9$k!J(B@pxref{Indentation}$B!K!#(B
@item
@c Fill it as text with @kbd{M-x fill-region} (@pxref{Filling}).
@kbd{M-x fill-region}$B$G%F%-%9%H$r5M$a9~$`!J(B@pxref{Filling}$B!K!#(B
@item
@c Print hardcopy with @kbd{M-x print-region} (@pxref{Hardcopy}).
@kbd{M-x print-region}$B$G%O!<%I%3%T!<$r0u:~$9$k!J(B@pxref{Hardcopy}$B!K!#(B
@item
@c Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}).
@kbd{M-x eval-region}$B$G(BLisp$B%3!<%I$H$7$FI>2A$9$k!J(B@pxref{Lisp Eval}$B!K!#(B
@end itemize
@c Most commands that operate on the text in the
@c region have the word @code{region} in their names.
$B%j!<%8%g%sFb$N%F%-%9%H$rA`:n$9$k%3%^%s%I$NB?$/$O!"(B
$B$=$NL>A0$K(B@code{region}$B$H$$$&C18l$r4^$_$^$9!#(B
@node Marking Objects
@c @section Commands to Mark Textual Objects
@section $B%F%-%9%H%*%V%8%'%/%H$r%^!<%/$9$k%3%^%s%I(B
@c @cindex marking sections of text
@cindex $B%F%-%9%H$N0lIt$r%^!<%/IU$1$9$k(B
@c Here are the commands for placing point and the mark around a textual
@c object such as a word, list, paragraph or page.
$BC18l!"%j%9%H!"CJMn!"%Z!<%8$H$$$C$?%F%-%9%H$N$^$H$^$j$K(B
$B%]%$%s%H$d%^!<%/$rCV$/%3%^%s%I$,$"$j$^$9!#(B
@table @kbd
@item M-@@
@c Set mark after end of next word (@code{mark-word}). This command and
@c the following one do not move point.
$B$D$.$N8l$NKvHx$K%^!<%/$r@_Dj$9$k!J(B@code{mark-word}$B!K!#(B
$B$3$N%3%^%s%I$H$D$.$N%3%^%s%I$O%]%$%s%H$r0\F0$7$J$$!#(B
@item C-M-@@
@c Set mark after end of next Lisp expression (@code{mark-sexp}).
$B$D$.$N(BLisp$B<0$NKvHx$K%^!<%/$r@_Dj$9$k!J(B@code{mark-sexp}$B!K!#(B
@item M-h
@c Put region around current paragraph (@code{mark-paragraph}).
$B8=:_$NCJMn$r0O$`%j!<%8%g%s$r@_Dj$9$k!J(B@code{mark-paragraph}$B!K!#(B
@item C-M-h
@c Put region around current Lisp defun (@code{mark-defun}).
$B8=:_$N(BLisp$B4X?tDj5A!J(Bdefun$B!K$r0O$`%j!<%8%g%s$r@_Dj$9$k!J(B@code{mark-defun}$B!K!#(B
@item C-x h
@c Put region around entire buffer (@code{mark-whole-buffer}).
$B%P%C%U%!A4BN$r%j!<%8%g%s$H$9$k!J(B@code{mark-whole-buffer}$B!K!#(B
@item C-x C-p
@c Put region around current page (@code{mark-page}).
$B8=:_$N%Z!<%8$r0O$`%j!<%8%g%s$r@_Dj$9$k!J(B@code{mark-page}$B!K!#(B
@end table
@c @kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next word,
@c while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the next Lisp
@c expression. These commands handle arguments just like @kbd{M-f} and
@c @kbd{C-M-f}.
@kbd{M-@@}$B!J(B@code{mark-word}$B!K$,$D$.$N8l$NKvHx$K%^!<%/$r@_Dj$9$k$N$KBP$7!"(B
@kbd{C-M-@@}$B!J(B@code{mark-sexp}$B!K$O$D$.$N(BLisp$B<0$NKvHx$K%^!<%/$r@_Dj$7$^$9!#(B
$B$3$l$i$N%3%^%s%I$O!"(B@kbd{M-f}$B$d(B@kbd{C-M-f}$B$HF1MM$K0z?t$r07$$$^$9!#(B
@kindex C-x h
@findex mark-whole-buffer
@c Other commands set both point and mark, to delimit an object in the
@c buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to
@c the beginning of the paragraph that surrounds or follows point, and puts
@c the mark at the end of that paragraph (@pxref{Paragraphs}). It prepares
@c the region so you can indent, case-convert, or kill a whole paragraph.
$B$=$NB>$N%3%^%s%I$O!"%]%$%s%H$H%^!<%/$NN>J}$r@_Dj$7$F!"(B
$B%P%C%U%!Fb$GBP>]J*$r6h@Z$j$^$9!#(B
$B$?$H$($P!"(B@kbd{M-h}$B!J(B@code{mark-paragraph}$B!K$O!"(B
$B%]%$%s%H$r0O$`$"$k$$$O%]%$%s%H$KB3$/CJMn$N@hF,$K%]%$%s%H$r0\F0$7!"(B
$B$=$NCJMn$NKvHx$K%^!<%/$rCV$-$^$9!J(B@pxref{Paragraphs}$B!K!#(B
$B$3$N$h$&$K%j!<%8%g%s$r@_Dj$9$k$N$G!"(B
$BCJMnA4BN$r;z2<$2$7$?$j!"BgJ8;z>.J8;z$rJQ49$7$?$j!"%-%k$7$?$j$G$-$^$9!#(B
@c @kbd{C-M-h} (@code{mark-defun}) similarly puts point before and the
@c mark after the current or following defun (@pxref{Defuns}). @kbd{C-x
@c C-p} (@code{mark-page}) puts point before the current page, and mark at
@c the end (@pxref{Pages}). The mark goes after the terminating page
@c delimiter (to include it), while point goes after the preceding page
@c delimiter (to exclude it). A numeric argument specifies a later page
@c (if positive) or an earlier page (if negative) instead of the current
@c page.
@kbd{C-M-h}$B!J(B@code{mark-defun}$B!K$bF1MM$K!"(B
$B8=:_$N4X?tDj5A$d8eB3$N4X?tDj5A$N@hF,$K%]%$%s%H$rCV$-!"(B
$B$=$NKvHx$K%^!<%/$rCV$-$^$9!J(B@pxref{Defuns}$B!K!#(B
@kbd{C-x C-p}$B!J(B@code{mark-page}$B!K$O!"(B
$B8=:_$N%Z!<%8$N@hF,$K%]%$%s%H$rCV$-!"(B
$B$=$NKvHx$K%^!<%/$rCV$-$^$9!J(B@code{mark-page}$B!K!#(B
$B%^!<%/$O%Z!<%86h@Z$j$ND>8e$K@_Dj$5$l!J%j!<%8%g%s$K4^$^$l$k!K!"(B
$B0lJ}!"%]%$%s%H$O%Z!<%86h@Z$j$ND>8e$KCV$+$l$^$9!J%j!<%8%g%s$K4^$^$l$J$$!K!#(B
$B?t0z?t$G!"8=:_$N%Z!<%8$N$+$o$j$K!J@5$J$i$P!K8eB3$N%Z!<%8$d!"(B
$B!JIi$J$i$P!K@h9T$9$k%Z!<%8$r;XDj$G$-$^$9!#(B
@c Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire
@c buffer as the region, by putting point at the beginning and the mark at
@c the end.
$B:G8e$K>R2p$9$k(B@kbd{C-x h}$B!J(B@code{mark-whole-buffer}$B!K$O!"(B
$B%P%C%U%!A4BN$K%j!<%8%g%s$r@_Dj$7$^$9!#(B
$B$D$^$j!"%]%$%s%H$r%P%C%U%!$N@hF,$KCV$-!"(B
$B%^!<%/$r%P%C%U%!$NKvHx$KCV$-$^$9!#(B
@c In Transient Mark mode, all of these commands activate the mark.
$B;CDj%^!<%/!J(Btransient-mark$B!K%b!<%I$G$O!"(B
$B$3$l$i$N%3%^%s%I$O$9$Y$F!"%^!<%/$r3h@-$K$7$^$9!#(B
@node Mark Ring
@c @section The Mark Ring
@section $B%^!<%/%j%s%0(B
@kindex C-u C-SPC
@c @cindex mark ring
@cindex $B%^!<%/%j%s%0(B
@kindex C-u C-@@
@c Aside from delimiting the region, the mark is also useful for
@c remembering a spot that you may want to go back to. To make this
@c feature more useful, each buffer remembers 16 previous locations of the
@c mark, in the @dfn{mark ring}. Commands that set the mark also push the
@c old mark onto this ring. To return to a marked location, use @kbd{C-u
@c C-@key{SPC}} (or @kbd{C-u C-@@}); this is the command
@c @code{set-mark-command} given a numeric argument. It moves point to
@c where the mark was, and restores the mark from the ring of former
@c marks. Thus, repeated use of this command moves point to all of the old
@c marks on the ring, one by one. The mark positions you move through in
@c this way are not lost; they go to the end of the ring.
$B%^!<%/$K$O!"%j!<%8%g%s$r6h@Z$k0J30$K$b!"(B
$B$"$H$GLa$k2DG=@-$N$"$k2U=j$r5-O?$9$k$H$$$&JXMx$J;H$$J}$,$"$j$^$9!#(B
$B$3$N5!G=$r$h$jJXMx$K$9$k$?$a$K!"(B
$B3F%P%C%U%!$G$O0JA0$N(B16$B2U=j$N%^!<%/0LCV$r(B
@dfn{$B%^!<%/%j%s%0(B}$B!J(Bmark ring$B!K$K5-O?$7$F$$$^$9!#(B
$B%^!<%/$r@_Dj$9$k%3%^%s%I$O!"8E$$%^!<%/$r$3$N%^!<%/%j%s%0$KF~$l$^$9!#(B
$B%^!<%/$r@_Dj$7$F$$$?2U=j$KLa$k$K$O!"(B
@kbd{C-u C-@key{SPC}}$B!J$^$?$O(B@kbd{C-u C-@@}$B!K$r;H$$$^$9!#(B
$B$3$l$O!"(B@code{set-mark-command}$B%3%^%s%I$K?t0z?t$r;XDj$7$?$b$N$G$9!#(B
$B$3$N%3%^%s%I$O!"%^!<%/$,$"$C$?2U=j$K%]%$%s%H$r0\F0$7!"(B
$B$=$l0JA0$N%^!<%/$r<}$a$?%^!<%/%j%s%0$+$i%^!<%/$rI|85$7$^$9!#(B
$B$7$?$,$C$F!"$3$N%3%^%s%I$r7+$jJV$9$H!"(B
$B%^!<%/%j%s%0>e$K$"$k2a5n$N%^!<%/$N$9$Y$F$r(B1$B$D(B1$B$DAL$C$F0\F0$G$-$^$9!#(B
$B$3$N$h$&$KC)$C$?%^!<%/0LCV$O!"%^!<%/%j%s%0$N$&$7$m$KIU$12C$($i$l$k$N$G!"(B
$B$J$/$J$C$F$7$^$&$3$H$O$"$j$^$;$s!#(B
@c Each buffer has its own mark ring. All editing commands use the current
@c buffer's mark ring. In particular, @kbd{C-u C-@key{SPC}} always stays in
@c the same buffer.
$B3F%P%C%U%!$K$OFH<+$N%^!<%/%j%s%0$,$"$j$^$9!#(B
$B$9$Y$F$NJT=8%3%^%s%I$O!"%+%l%s%H%P%C%U%!$N%^!<%/%j%s%0$r;H$$$^$9!#(B
$BFC$K!"(B@kbd{C-u C-@key{SPC}}$B$O!"$D$M$KF1$8%P%C%U%!$KN1$^$j$^$9!#(B
@c Many commands that can move long distances, such as @kbd{M-<}
@c (@code{beginning-of-buffer}), start by setting the mark and saving the
@c old mark on the mark ring. This is to make it easier for you to move
@c back later. Searches set the mark if they move point. You can tell
@c when a command sets the mark because it displays @samp{Mark Set} in the
@c echo area.
@kbd{M-<}$B!J(B@code{beginning-of-buffer}$B!K$N$h$&$JD95wN%$r(B
$B0\F0$9$k%3%^%s%I$NB?$/$O!"$^$:%^!<%/$r@_Dj$7$F!"(B
$B8E$$%^!<%/$r%^!<%/%j%s%0$KJ]B8$7$F$+$iF0:n$r3+;O$7$^$9!#(B
$B$3$N$h$&$K$7$F!"$"$H$G4JC1$KLa$l$k$h$&$K$7$F$*$-$^$9!#(B
$BC5:w%3%^%s%I$O!"%]%$%s%H$r0\F0$9$k$H$-$K$O%^!<%/$r@_Dj$7$^$9!#(B
$B%3%^%s%I$,%^!<%/$r@_Dj$7$?$+$I$&$+$O!"(B
$B%(%3!<NN0h$K(B@samp{Mark Set}$B$HI=<($5$l$k$N$G$o$+$j$^$9!#(B
@c If you want to move back to the same place over and over, the mark
@c ring may not be convenient enough. If so, you can record the position
@c in a register for later retrieval (@pxref{RegPos}).
$B2?EY$bF1$8>l=j$KLa$j$?$$>l9g$K$O!"%^!<%/%j%s%0$G$OIT==J,$G$7$g$&!#(B
$B$3$N$h$&$J>l9g$K$O!"$"$H$G;H$&$?$a$K0LCV>pJs$r%l%8%9%?$K5-O?$G$-$^$9(B
$B!J(B@pxref{RegPos}$B!K!#(B
@vindex mark-ring-max
@c The variable @code{mark-ring-max} specifies the maximum number of
@c entries to keep in the mark ring. If that many entries exist and
@c another one is pushed, the last one in the list is discarded. Repeating
@c @kbd{C-u C-@key{SPC}} cycles through the positions currently in the
@c ring.
$BJQ?t(B@code{mark-ring-max}$B$O!"%^!<%/%j%s%0$KJ]B8$9$k:GBg9`L\?t$r;XDj$7$^$9!#(B
$B$9$G$KB?$/$N9`L\$,B8:_$7$F$$$F!"$5$i$K$b$&(B1$B$D2!$79~$`$H$-$K$O!"(B
$B%j%9%HFb$N:G8E$N9`L\$r<N$F$^$9!#(B
@kbd{C-u C-@key{SPC}}$B$r7+$jJV$7<B9T$9$k$H!"(B
$B$$$^%^!<%/%j%s%0$KF~$C$F$$$k0LCV$r=d2s$9$k$3$H$K$J$j$^$9!#(B
@vindex mark-ring
@c The variable @code{mark-ring} holds the mark ring itself, as a list of
@c marker objects, with the most recent first. This variable is local in
@c every buffer.
$BJQ?t(B@code{mark-ring}$B$O!":G?7$N%^!<%+%*%V%8%'%/%H$r@hF,$K$7$F!"(B
$B%^!<%+%*%V%8%'%/%H$N%j%9%H$H$7$F%^!<%/%j%s%0$rJ];}$7$^$9!#(B
$B$3$NJQ?t$O3F%P%C%U%!$K%m!<%+%k$G$9!#(B
@node Global Mark Ring
@c @section The Global Mark Ring
@section $B%0%m!<%P%k%^!<%/%j%s%0(B
@c @cindex global mark ring
@cindex $B%0%m!<%P%k%^!<%/%j%s%0(B
@c In addition to the ordinary mark ring that belongs to each buffer,
@c Emacs has a single @dfn{global mark ring}. It records a sequence of
@c buffers in which you have recently set the mark, so you can go back
@c to those buffers.
$B8D!9$N%P%C%U%!$4$H$NIaDL$N%^!<%/%j%s%0$K2C$($F!"(B
Emacs$B$K$O(B@dfn{$B%0%m!<%P%k%^!<%/%j%s%0(B}$B!J(Bglobal mark ring$B!K$,(B1$B$D$"$j$^$9!#(B
$B%0%m!<%P%k%^!<%/%j%s%0$O!":G6a%^!<%/$r@_Dj$7$?%P%C%U%!$N7ONs$r5-O?$7$^$9$+$i!"(B
$B$=$l$i$N%P%C%U%!$KLa$k$3$H$,$G$-$^$9!#(B
@c Setting the mark always makes an entry on the current buffer's mark
@c ring. If you have switched buffers since the previous mark setting, the
@c new mark position makes an entry on the global mark ring also. The
@c result is that the global mark ring records a sequence of buffers that
@c you have been in, and, for each buffer, a place where you set the mark.
$B%^!<%/$r@_Dj$9$k$H!"$D$M$K%+%l%s%H%P%C%U%!$N%^!<%/%j%s%0$K9`L\$r:n$j$^$9!#(B
$B%^!<%/$r@_Dj$7$?0J9_$K%P%C%U%!$r@Z$jBX$($F$$$k$H!"(B
$B?7$7$/%^!<%/$r@_Dj$9$k$H%0%m!<%P%k%^!<%/%j%s%0$K$b9`L\$r:n@.$7$^$9!#(B
$B$=$N7k2L!"%0%m!<%P%k%^!<%/%j%s%0$K$OK,$l$F$$$?%P%C%U%!$N7ONs$,5-O?$5$l!"(B
$B3F%P%C%U%!$G$O%^!<%/$r@_Dj$7$?2U=j$,5-O?$5$l$^$9!#(B
@kindex C-x C-@key{SPC}
@findex pop-global-mark
@c The command @kbd{C-x C-@key{SPC}} (@code{pop-global-mark}) jumps to
@c the buffer and position of the latest entry in the global ring. It also
@c rotates the ring, so that successive uses of @kbd{C-x C-@key{SPC}} take
@c you to earlier and earlier buffers.
$B%3%^%s%I(B@kbd{C-x C-@key{SPC}}$B!J(B@code{pop-global-mark}$B!K$O!"(B
$B%0%m!<%P%k%^!<%/%j%s%0$N:G?7$N9`L\$,<($9%P%C%U%!$N0LCV$K0\F0$7$^$9!#(B
$B%0%m!<%P%k%^!<%/%j%s%0$b=d2s$5$l$k$N$G!"(B
@kbd{C-x C-@key{SPC}}$B$r7+$jJV$7;HMQ$9$k$H!"(B
1$B$D$:$D$^$($N%P%C%U%!$K0\F0$G$-$^$9!#(B
|