Mercurial > emacs
annotate man/mark.texi @ 83462:75949877b3ed
Fix compilation error on older GCCs (reported by "mace").
* src/callproc.c (getenv_internal): Fix C99ism.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-502
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 30 Jan 2006 20:00:11 +0000 |
parents | f54ada46e59e |
children | 7d8049c045c4 |
rev | line source |
---|---|
25829 | 1 @c This is part of the Emacs manual. |
64890
3723093a21fd
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
63005
diff
changeset
|
2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2001, 2002, |
3723093a21fd
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
63005
diff
changeset
|
3 @c 2003, 2004, 2005 Free Software Foundation, Inc. |
25829 | 4 @c See file emacs.texi for copying conditions. |
5 @node Mark, Killing, Help, Top | |
6 @chapter The Mark and the Region | |
7 @cindex mark | |
8 @cindex setting a mark | |
9 @cindex region | |
10 | |
11 Many Emacs commands operate on an arbitrary contiguous part of the | |
12 current buffer. To specify the text for such a command to operate on, | |
13 you set @dfn{the mark} at one end of it, and move point to the other | |
14 end. The text between point and the mark is called @dfn{the region}. | |
15 Emacs highlights the region whenever there is one, if you enable | |
16 Transient Mark mode (@pxref{Transient Mark}). | |
17 | |
38411
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
18 Certain Emacs commands set the mark; other editing commands do not |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
19 affect it, so the mark remains where you set it last. Each Emacs |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
20 buffer has its own mark, and setting the mark in one buffer has no |
38786 | 21 effect on other buffers' marks. When you return to a buffer that was |
22 current earlier, its mark is at the same place as before. | |
38411
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
23 |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
24 The ends of the region are always point and the mark. It doesn't |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
25 matter which of them was put in its current place first, or which one |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
26 comes earlier in the text---the region starts from point or the mark |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
27 (whichever comes first), and ends at point or the mark (whichever |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
28 comes last). Every time you move point, or set the mark in a new |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
29 place, the region changes. |
25829 | 30 |
31 Many commands that insert text, such as @kbd{C-y} (@code{yank}) and | |
38411
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
32 @kbd{M-x insert-buffer}, position point and the mark at opposite ends |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
33 of the inserted text, so that the region consists of the text just |
2fc02d49a9a4
Clarify initial discussion.
Richard M. Stallman <rms@gnu.org>
parents:
38208
diff
changeset
|
34 inserted. |
25829 | 35 |
36 Aside from delimiting the region, the mark is also useful for | |
37 remembering a spot that you may want to go back to. To make this | |
38 feature more useful, each buffer remembers 16 previous locations of the | |
39 mark in the @dfn{mark ring}. | |
40 | |
41 @menu | |
42 * Setting Mark:: Commands to set the mark. | |
43 * Transient Mark:: How to make Emacs highlight the region-- | |
44 when there is one. | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
45 * Momentary Mark:: Enabling Transient Mark mode momentarily. |
25829 | 46 * Using Region:: Summary of ways to operate on contents of the region. |
68457
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
47 * Selective Undo:: Undoing within a given region. |
25829 | 48 * Marking Objects:: Commands to put region around textual units. |
49 * Mark Ring:: Previous mark positions saved so you can go back there. | |
50 * Global Mark Ring:: Previous mark positions in various buffers. | |
51 @end menu | |
52 | |
53 @node Setting Mark | |
54 @section Setting the Mark | |
55 | |
56 Here are some commands for setting the mark: | |
57 | |
58 @table @kbd | |
59 @item C-@key{SPC} | |
60 Set the mark where point is (@code{set-mark-command}). | |
61 @item C-@@ | |
62 The same. | |
63 @item C-x C-x | |
64 Interchange mark and point (@code{exchange-point-and-mark}). | |
65 @item Drag-Mouse-1 | |
66 Set point and the mark around the text you drag across. | |
67 @item Mouse-3 | |
68 Set the mark where point is, then move point to where you click | |
69 (@code{mouse-save-then-kill}). | |
70 @end table | |
71 | |
72 For example, suppose you wish to convert part of the buffer to | |
73 upper case, using the @kbd{C-x C-u} (@code{upcase-region}) command, | |
74 which operates on the text in the region. You can first go to the | |
75 beginning of the text to be capitalized, type @kbd{C-@key{SPC}} to put | |
76 the mark there, move to the end, and then type @kbd{C-x C-u}. Or, you | |
77 can set the mark at the end of the text, move to the beginning, and then | |
78 type @kbd{C-x C-u}. | |
79 | |
80 @kindex C-SPC | |
81 @findex set-mark-command | |
82 The most common way to set the mark is with the @kbd{C-@key{SPC}} command | |
83 (@code{set-mark-command}). This sets the mark where point is. Then you | |
84 can move point away, leaving the mark behind. | |
85 | |
86 There are two ways to set the mark with the mouse. You can drag mouse | |
87 button one across a range of text; that puts point where you release the | |
88 mouse button, and sets the mark at the other end of that range. Or you | |
89 can click mouse button three, which sets the mark at point (like | |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
90 @kbd{C-@key{SPC}}) and then moves point where you clicked (like |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
91 @kbd{Mouse-1}). Both of these methods copy the region into the kill |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
92 ring in addition to setting the mark; that gives behavior consistent |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
93 with other window-driven applications, but if you don't want to modify |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
94 the kill ring, you must use keyboard commands to set the mark. |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
95 @xref{Mouse Commands}. |
25829 | 96 |
97 @kindex C-x C-x | |
98 @findex exchange-point-and-mark | |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
99 When Emacs was developed, terminals had only one cursor, so Emacs |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
100 does not show where the mark is located--you have to remember. If you |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
101 enable Transient Mark mode (see below), then the region is highlighted |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
102 when it is active; you can tell mark is at the other end of the |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
103 highlighted region. But this only applies when the mark is active. |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
104 |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
105 The usual solution to this problem is to set the mark and then use |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
106 it soon, before you forget where it is. Alternatively, you can see |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
107 where the mark is with the command @kbd{C-x C-x} |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
108 (@code{exchange-point-and-mark}) which puts the mark where point was |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
109 and point where the mark was. The extent of the region is unchanged, |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
110 but the cursor and point are now at the previous position of the mark. |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
111 In Transient Mark mode, this command also reactivates the mark. |
25829 | 112 |
113 @kbd{C-x C-x} is also useful when you are satisfied with the position | |
114 of point but want to move the other end of the region (where the mark | |
115 is); do @kbd{C-x C-x} to put point at that end of the region, and then | |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
116 move it. Using @kbd{C-x C-x} a second time, if necessary, puts the mark at |
25829 | 117 the new position with point back at its original position. |
118 | |
36359
33c7ddaf02c6
(Setting Mark): Add a cross-reference to the section which describes
Eli Zaretskii <eliz@gnu.org>
parents:
36165
diff
changeset
|
119 For more facilities that allow you to go to previously set marks, see |
33c7ddaf02c6
(Setting Mark): Add a cross-reference to the section which describes
Eli Zaretskii <eliz@gnu.org>
parents:
36165
diff
changeset
|
120 @ref{Mark Ring}. |
33c7ddaf02c6
(Setting Mark): Add a cross-reference to the section which describes
Eli Zaretskii <eliz@gnu.org>
parents:
36165
diff
changeset
|
121 |
25829 | 122 @kindex C-@@ |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
123 There is no such character as @kbd{C-@key{SPC}} in @acronym{ASCII}; |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
124 when you type @key{SPC} while holding down @key{CTRL} on a text |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
125 terminal, what you get is the character @kbd{C-@@}. This key is also |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
126 bound to @code{set-mark-command}--so unless you are unlucky enough to |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
127 have a text terminal where typing @kbd{C-@key{SPC}} does not produce |
25829 | 128 @kbd{C-@@}, you might as well think of this character as |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
129 @kbd{C-@key{SPC}}. |
25829 | 130 |
131 @node Transient Mark | |
132 @section Transient Mark Mode | |
133 @cindex mode, Transient Mark | |
134 @cindex Transient Mark mode | |
135 @cindex highlighting region | |
136 @cindex region highlighting | |
137 | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
138 On a terminal that supports colors, Emacs has the ability to |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
139 highlight the current region. But normally it does not. Why not? |
25829 | 140 |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
141 Once you have set the mark in a buffer, there is @emph{always} a |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
142 region in that buffer. This is because every command that sets the |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
143 mark also activates it, and nothing ever deactivates it. Highlighting |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
144 the region all the time would be a nuisance. So normally Emacs |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
145 highlights the region only immediately after you have selected one |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
146 with the mouse. |
25829 | 147 |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
148 If you want region highlighting, you can use Transient Mark mode. |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
149 This is a more rigid mode of operation in which the region always |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
150 ``lasts'' only until you use it; you explicitly must set up a region |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
151 for each command that uses one. In Transient Mark mode, most of the |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
152 time there is no region; therefore, highlighting the region when it |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
153 exists is useful and not annoying. When Transient Mark mode is |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
154 enabled, Emacs always highlights the region whenever there is a |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
155 region. |
25829 | 156 |
157 @findex transient-mark-mode | |
158 To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}. | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
159 This command toggles the mode; you can use the same command to turn |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
160 the mode off again. |
25829 | 161 |
162 Here are the details of Transient Mark mode: | |
163 | |
164 @itemize @bullet | |
165 @item | |
166 To set the mark, type @kbd{C-@key{SPC}} (@code{set-mark-command}). | |
38786 | 167 This makes the mark active and thus begins highlighting of the region. |
168 As you move point, you will see the highlighted region grow and | |
169 shrink. | |
25829 | 170 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46237
diff
changeset
|
171 @item |
25829 | 172 The mouse commands for specifying the mark also make it active. So do |
173 keyboard commands whose purpose is to specify a region, including | |
174 @kbd{M-@@}, @kbd{C-M-@@}, @kbd{M-h}, @kbd{C-M-h}, @kbd{C-x C-p}, and | |
175 @kbd{C-x h}. | |
176 | |
177 @item | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
178 You can tell that the mark is active because the region is highlighted. |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
179 |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
180 @item |
25829 | 181 When the mark is active, you can execute commands that operate on the |
182 region, such as killing, indenting, or writing to a file. | |
183 | |
184 @item | |
185 Any change to the buffer, such as inserting or deleting a character, | |
186 deactivates the mark. This means any subsequent command that operates | |
187 on a region will get an error and refuse to operate. You can make the | |
188 region active again by typing @kbd{C-x C-x}. | |
189 | |
190 @item | |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
191 If Delete Selection mode is also enabled, some commands delete the |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
192 region when used while the mark is active. @xref{Graphical Kill}. |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
193 |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
194 @item |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
195 Quitting with @kbd{C-g} deactivates the mark. |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
196 |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
197 @item |
38786 | 198 Commands like @kbd{M->} and @kbd{C-s}, that ``leave the mark behind'' in |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
199 addition to some other primary purpose, do not activate the new mark. |
25829 | 200 You can activate the new region by executing @kbd{C-x C-x} |
201 (@code{exchange-point-and-mark}). | |
202 | |
203 @item | |
58974
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
204 Commands that normally set the mark before moving long distances (like |
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
205 @kbd{M-<} and @kbd{C-s}) do not alter the mark in Transient Mark mode |
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
206 when the mark is active. |
25829 | 207 |
208 @item | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
209 Some commands operate on the region if a region is active. For |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
210 instance, @kbd{C-x u} in Transient Mark mode operates on the region, |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
211 when there is a region. (Outside Transient Mark mode, you must type |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
212 @kbd{C-u C-x u} if you want it to operate on the region.) |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
213 @xref{Undo}. Other commands that act this way are identified in their |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
214 own documentation. |
25829 | 215 @end itemize |
216 | |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
217 The highlighting of the region uses the @code{region} face; you can |
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
218 customize the appearance of the highlighted region by changing this |
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
219 face. @xref{Face Customization}. |
25829 | 220 |
221 @vindex highlight-nonselected-windows | |
222 When multiple windows show the same buffer, they can have different | |
223 regions, because they can have different values of point (though they | |
224 all share one common mark position). Ordinarily, only the selected | |
225 window highlights its region (@pxref{Windows}). However, if the | |
226 variable @code{highlight-nonselected-windows} is non-@code{nil}, then | |
227 each window highlights its own region (provided that Transient Mark mode | |
38786 | 228 is enabled and the mark in the window's buffer is active). |
25829 | 229 |
230 @vindex mark-even-if-inactive | |
231 If the variable @code{mark-even-if-inactive} is non-@code{nil} in | |
232 Transient Mark mode, then commands can use the mark and the region | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
233 even when it is inactive. Region highlighting appears and disappears |
25829 | 234 just as it normally does in Transient Mark mode, but the mark doesn't |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
235 really go away when the highlighting disappears, so you can still use |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
236 region commands. |
25829 | 237 |
238 @cindex Zmacs mode | |
239 Transient Mark mode is also sometimes known as ``Zmacs mode'' | |
240 because the Zmacs editor on the MIT Lisp Machine handled the mark in a | |
241 similar way. | |
242 | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
243 @node Momentary Mark |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
244 @section Using Transient Mark Mode Momentarily |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
245 |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
246 If you don't like Transient Mark mode in general, you might still |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
247 want to use it once in a while. To do this, type @kbd{C-@key{SPC} |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
248 C-@key{SPC}} or @kbd{C-u C-x C-x}. These commands set or activate the |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
249 mark, and enable Transient Mark mode only until the mark is |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
250 deactivated. |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
251 |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
252 @table @kbd |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
253 @item C-@key{SPC} C-@key{SPC} |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
254 @kindex C-@key{SPC} C-@key{SPC} |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
255 Set the mark at point (like plain @kbd{C-@key{SPC}}), and enable |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
256 Transient Mark mode just once until the mark is deactivated. (This is |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
257 not really a separate command; you are using the @kbd{C-@key{SPC}} |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
258 command twice.) |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
259 |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
260 @item C-u C-x C-x |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
261 @kindex C-u C-x C-x |
56691
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
262 Activate the mark without changing it; enable Transient Mark mode just |
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
263 once, until the mark is deactivated. (This is the @kbd{C-x C-x} |
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
264 command, @code{exchange-point-and-mark}, with a prefix argument.) |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
265 @end table |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
266 |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
267 One of the secondary features of Transient Mark mode is that certain |
56691
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
268 commands operate only on the region, when there is an active region. |
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
269 If you don't use Transient Mark mode, the region once set never |
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
270 becomes inactive, so there is no way for these commands to make such a |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
271 distinction. Enabling Transient Mark mode momentarily gives you a way |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
272 to use these commands on the region. |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
273 |
56691
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
274 Momentary use of Transient Mark mode is also a way to highlight the |
378fee0ad45e
(Momentary Mark): Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
275 region for the time being. |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
276 |
25829 | 277 @node Using Region |
278 @section Operating on the Region | |
279 | |
280 @cindex operations on a marked region | |
281 Once you have a region and the mark is active, here are some of the | |
282 ways you can operate on the region: | |
283 | |
284 @itemize @bullet | |
285 @item | |
286 Kill it with @kbd{C-w} (@pxref{Killing}). | |
287 @item | |
288 Save it in a register with @kbd{C-x r s} (@pxref{Registers}). | |
289 @item | |
290 Save it in a buffer or a file (@pxref{Accumulating Text}). | |
291 @item | |
292 Convert case with @kbd{C-x C-l} or @kbd{C-x C-u} (@pxref{Case}). | |
293 @item | |
294 Indent it with @kbd{C-x @key{TAB}} or @kbd{C-M-\} (@pxref{Indentation}). | |
295 @item | |
296 Fill it as text with @kbd{M-x fill-region} (@pxref{Filling}). | |
297 @item | |
63005
e4c68c19a6bc
(Using Region): Change Hardcopy xref to Printing.
Eli Zaretskii <eliz@gnu.org>
parents:
60244
diff
changeset
|
298 Print hardcopy with @kbd{M-x print-region} (@pxref{Printing}). |
25829 | 299 @item |
300 Evaluate it as Lisp code with @kbd{M-x eval-region} (@pxref{Lisp Eval}). | |
68457
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
301 @item |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
302 Undo changes within it using @kbd{C-u C-x u} (@pxref{Selective Undo}). |
25829 | 303 @end itemize |
304 | |
38482
c8c4805bde95
Minor changes from Richard Stallman.
Eli Zaretskii <eliz@gnu.org>
parents:
38461
diff
changeset
|
305 Most commands that operate on the text in the region have the word |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
306 @code{region} in their names. |
25829 | 307 |
68457
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
308 @node Selective Undo |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
309 @section Selective Undo |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
310 |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
311 @cindex selective undo |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
312 @kindex C-u C-x u |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
313 Ordinary undo applies to all changes made in the current buffer. You |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
314 can also perform @dfn{selective undo}, limited to the current region |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
315 (@pxref{Mark}). |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
316 |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
317 To do this, specify the region you want, then run the @code{undo} |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
318 command with a prefix argument (the value does not matter): @kbd{C-u |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
319 C-x u} or @kbd{C-u C-_}. This undoes the most recent change in the |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
320 region. To undo further changes in the same region, repeat the |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
321 @code{undo} command (no prefix argument is needed). In Transient Mark |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
322 mode (@pxref{Transient Mark}), any use of @code{undo} when there is an |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
323 active region performs selective undo; you do not need a prefix |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
324 argument. |
f54ada46e59e
(Selective Undo): New node, text moved from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents:
66688
diff
changeset
|
325 |
25829 | 326 @node Marking Objects |
327 @section Commands to Mark Textual Objects | |
328 | |
329 @cindex marking sections of text | |
330 Here are the commands for placing point and the mark around a textual | |
331 object such as a word, list, paragraph or page. | |
332 | |
333 @table @kbd | |
334 @item M-@@ | |
38786 | 335 Set mark after end of next word (@code{mark-word}). This command and |
25829 | 336 the following one do not move point. |
337 @item C-M-@@ | |
38786 | 338 Set mark after end of following balanced expression (@code{mark-sexp}). |
25829 | 339 @item M-h |
38786 | 340 Put region around current paragraph (@code{mark-paragraph}). |
25829 | 341 @item C-M-h |
38786 | 342 Put region around current defun (@code{mark-defun}). |
25829 | 343 @item C-x h |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
344 Put region around the entire buffer (@code{mark-whole-buffer}). |
25829 | 345 @item C-x C-p |
38786 | 346 Put region around current page (@code{mark-page}). |
25829 | 347 @end table |
348 | |
38207
e24d77a5adf1
Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents:
37316
diff
changeset
|
349 @kbd{M-@@} (@code{mark-word}) puts the mark at the end of the next |
e24d77a5adf1
Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents:
37316
diff
changeset
|
350 word, while @kbd{C-M-@@} (@code{mark-sexp}) puts it at the end of the |
e24d77a5adf1
Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents:
37316
diff
changeset
|
351 next balanced expression (@pxref{Expressions}). These commands handle |
43301
898b4b31410f
* lisp/simple.el (mark-word): Mark more if repeated.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
41795
diff
changeset
|
352 arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
353 commands, that extends the region. For example, you can type either |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
354 @kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. This |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
355 command also extends the region when the mark is active in Transient |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
356 Mark mode, regardless of the last command. |
25829 | 357 |
358 @kindex C-x h | |
359 @findex mark-whole-buffer | |
360 Other commands set both point and mark, to delimit an object in the | |
361 buffer. For example, @kbd{M-h} (@code{mark-paragraph}) moves point to | |
41748
0302528bddbc
Fix wording of the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
41743
diff
changeset
|
362 the beginning of the paragraph that surrounds or follows point, and |
0302528bddbc
Fix wording of the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
41743
diff
changeset
|
363 puts the mark at the end of that paragraph (@pxref{Paragraphs}). It |
0302528bddbc
Fix wording of the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
41743
diff
changeset
|
364 prepares the region so you can indent, case-convert, or kill a whole |
0302528bddbc
Fix wording of the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
41743
diff
changeset
|
365 paragraph. With prefix argument, if the argument's value is positive, |
41795
48c74a2caa77
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
41748
diff
changeset
|
366 @kbd{M-h} marks that many paragraphs starting with the one surrounding |
48c74a2caa77
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
41748
diff
changeset
|
367 point. If the prefix argument is @minus{}@var{n}, @kbd{M-h} also |
48c74a2caa77
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
41748
diff
changeset
|
368 marks @var{n} paragraphs, running back form the one surrounding point. |
48c74a2caa77
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
41748
diff
changeset
|
369 In that last case, point moves forward to the end of that paragraph, |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
370 and the mark goes at the start of the region. Repeating the @kbd{M-h} |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
371 command extends the region, just as with @kbd{M-@@} and @kbd{C-M-@@}. |
25829 | 372 |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
373 @kbd{C-M-h} (@code{mark-defun}) similarly puts point before, and the |
38786 | 374 mark after, the current (or following) major top-level definition, or |
60244
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
375 defun (@pxref{Moving by Defuns}). Repeating @kbd{C-M-h} also extends |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
376 the region. |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
377 |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
378 @kbd{C-x C-p} (@code{mark-page}) puts point before the current page, |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
379 and mark at the end (@pxref{Pages}). The mark goes after the |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
380 terminating page delimiter (to include it in the region), while point |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
381 goes after the preceding page delimiter (to exclude it). A numeric |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
382 argument specifies a later page (if positive) or an earlier page (if |
1f085a397379
(Setting Mark): Clarify info about displaying mark.
Richard M. Stallman <rms@gnu.org>
parents:
58974
diff
changeset
|
383 negative) instead of the current page. |
25829 | 384 |
385 Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire | |
386 buffer as the region, by putting point at the beginning and the mark at | |
387 the end. | |
388 | |
389 In Transient Mark mode, all of these commands activate the mark. | |
390 | |
391 @node Mark Ring | |
392 @section The Mark Ring | |
393 | |
394 @kindex C-u C-SPC | |
395 @cindex mark ring | |
396 @kindex C-u C-@@ | |
397 Aside from delimiting the region, the mark is also useful for | |
398 remembering a spot that you may want to go back to. To make this | |
399 feature more useful, each buffer remembers 16 previous locations of the | |
400 mark, in the @dfn{mark ring}. Commands that set the mark also push the | |
401 old mark onto this ring. To return to a marked location, use @kbd{C-u | |
38490 | 402 C-@key{SPC}} (or @kbd{C-u C-@@}); this is the command |
25829 | 403 @code{set-mark-command} given a numeric argument. It moves point to |
404 where the mark was, and restores the mark from the ring of former | |
46237
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
405 marks. |
46b0c6f318b5
New node Momentary Mark.
Richard M. Stallman <rms@gnu.org>
parents:
43301
diff
changeset
|
406 |
66672
9c71dbde648a
(Mark Ring): Mention set-mark-command-repeat-pop.
Richard M. Stallman <rms@gnu.org>
parents:
64890
diff
changeset
|
407 @vindex set-mark-command-repeat-pop |
9c71dbde648a
(Mark Ring): Mention set-mark-command-repeat-pop.
Richard M. Stallman <rms@gnu.org>
parents:
64890
diff
changeset
|
408 If you set @code{set-mark-command-repeat-pop} to non-@code{nil}, |
66688
4f7af488adb0
(Mark Ring): Fix typo.
Romain Francoise <romain@orebokech.com>
parents:
66672
diff
changeset
|
409 then when you repeat the character @kbd{C-@key{SPC}} after typing |
66672
9c71dbde648a
(Mark Ring): Mention set-mark-command-repeat-pop.
Richard M. Stallman <rms@gnu.org>
parents:
64890
diff
changeset
|
410 @kbd{C-u C-@key{SPC}}, each repetition moves point to a previous mark |
9c71dbde648a
(Mark Ring): Mention set-mark-command-repeat-pop.
Richard M. Stallman <rms@gnu.org>
parents:
64890
diff
changeset
|
411 position from the ring. The mark positions you move through in this |
9c71dbde648a
(Mark Ring): Mention set-mark-command-repeat-pop.
Richard M. Stallman <rms@gnu.org>
parents:
64890
diff
changeset
|
412 way are not lost; they go to the end of the ring. |
25829 | 413 |
414 Each buffer has its own mark ring. All editing commands use the current | |
415 buffer's mark ring. In particular, @kbd{C-u C-@key{SPC}} always stays in | |
416 the same buffer. | |
417 | |
418 Many commands that can move long distances, such as @kbd{M-<} | |
419 (@code{beginning-of-buffer}), start by setting the mark and saving the | |
420 old mark on the mark ring. This is to make it easier for you to move | |
58974
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
421 back later. Searches set the mark if they move point. However, in |
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
422 Transient Mark mode, these commands do not set the mark when the mark |
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
423 is already active. You can tell when a command sets the mark because |
f23a14da8463
(Transient Mark, Mark Ring): M-< and other
Juri Linkov <juri@jurta.org>
parents:
58920
diff
changeset
|
424 it displays @samp{Mark set} in the echo area. |
25829 | 425 |
426 If you want to move back to the same place over and over, the mark | |
427 ring may not be convenient enough. If so, you can record the position | |
37316
171ad460e884
Correct case of "Mark set" message.
Richard M. Stallman <rms@gnu.org>
parents:
36359
diff
changeset
|
428 in a register for later retrieval (@pxref{RegPos,, Saving Positions in |
171ad460e884
Correct case of "Mark set" message.
Richard M. Stallman <rms@gnu.org>
parents:
36359
diff
changeset
|
429 Registers}). |
25829 | 430 |
431 @vindex mark-ring-max | |
432 The variable @code{mark-ring-max} specifies the maximum number of | |
433 entries to keep in the mark ring. If that many entries exist and | |
38461
23f63206a867
Proofreading fixes from Chris Green <chris_e_green@yahoo.com>.
Eli Zaretskii <eliz@gnu.org>
parents:
38411
diff
changeset
|
434 another one is pushed, the earliest one in the list is discarded. Repeating |
25829 | 435 @kbd{C-u C-@key{SPC}} cycles through the positions currently in the |
436 ring. | |
437 | |
438 @vindex mark-ring | |
439 The variable @code{mark-ring} holds the mark ring itself, as a list of | |
440 marker objects, with the most recent first. This variable is local in | |
441 every buffer. | |
442 | |
443 @node Global Mark Ring | |
444 @section The Global Mark Ring | |
445 @cindex global mark ring | |
446 | |
447 In addition to the ordinary mark ring that belongs to each buffer, | |
448 Emacs has a single @dfn{global mark ring}. It records a sequence of | |
449 buffers in which you have recently set the mark, so you can go back | |
450 to those buffers. | |
451 | |
452 Setting the mark always makes an entry on the current buffer's mark | |
453 ring. If you have switched buffers since the previous mark setting, the | |
454 new mark position makes an entry on the global mark ring also. The | |
455 result is that the global mark ring records a sequence of buffers that | |
456 you have been in, and, for each buffer, a place where you set the mark. | |
457 | |
458 @kindex C-x C-@key{SPC} | |
459 @findex pop-global-mark | |
460 The command @kbd{C-x C-@key{SPC}} (@code{pop-global-mark}) jumps to | |
461 the buffer and position of the latest entry in the global ring. It also | |
462 rotates the ring, so that successive uses of @kbd{C-x C-@key{SPC}} take | |
463 you to earlier and earlier buffers. | |
464 | |
52401 | 465 @ignore |
466 arch-tag: f35e4d82-911b-4cfc-a3d7-3c87b2abba20 | |
467 @end ignore |