Use @kbd instead of @key for mouse commands throughout.
[bpt/emacs.git] / doc / emacs / frames.texi
CommitLineData
8cf51b2c
GM
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
3f548a7c 3@c 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8cf51b2c
GM
4@c See file emacs.texi for copying conditions.
5@node Frames, International, Windows, Top
6@chapter Frames and Graphical Displays
7@cindex frames
8
2aee6012
CY
9 When using a graphical display, you can create multiple system-level
10``windows'' in a single Emacs session. We refer to these system-level
11windows as @dfn{frames}. A frame initially contains a single Emacs
12window; however, you can subdivide this Emacs window into smaller
13windows, all fitting into the same frame. Each frame normally
14contains its own echo area and minibuffer.
8cf51b2c
GM
15
16 To avoid confusion, we reserve the word ``window'' for the
17subdivisions that Emacs implements, and never use it to refer to a
18frame.
19
2aee6012
CY
20 Any editing you do in one frame affects the other frames. For
21instance, if you put text in the kill ring in one frame, you can yank
22it in another frame. If you exit Emacs through @kbd{C-x C-c} in one
23frame, it terminates all the frames. To delete just one frame, use
24@kbd{C-x 5 0} (that is zero, not @kbd{o}).
8cf51b2c
GM
25
26 Emacs compiled for MS-DOS emulates some windowing functionality,
27so that you can use many of the features described in this chapter.
28@iftex
29@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}.
30@end iftex
31@ifnottex
32@xref{MS-DOS Mouse}.
33@end ifnottex
34
35@menu
36* Cut and Paste:: Mouse commands for cut and paste.
37* Mouse References:: Using the mouse to select an item from a list.
38* Menu Mouse Clicks:: Mouse clicks that bring up menus.
39* Mode Line Mouse:: Mouse clicks on the mode line.
40* Creating Frames:: Creating additional Emacs frames with various contents.
41* Frame Commands:: Iconifying, deleting, and switching frames.
42* Speedbar:: How to make and use a speedbar frame.
43* Multiple Displays:: How one Emacs job can talk to several displays.
44* Special Buffer Frames:: You can make certain buffers have their own frames.
45* Frame Parameters:: Changing the colors and other modes of frames.
46* Scroll Bars:: How to enable and disable scroll bars; how to use them.
47* Wheeled Mice:: Using mouse wheels for scrolling.
48* Drag and Drop:: Using drag and drop to open files and insert text.
49* Menu Bars:: Enabling and disabling the menu bar.
50* Tool Bars:: Enabling and disabling the tool bar.
51* Dialog Boxes:: Controlling use of dialog boxes.
52* Tooltips:: Displaying information at the current mouse position.
53* Mouse Avoidance:: Moving the mouse pointer out of the way.
54* Non-Window Terminals:: Multiple frames on terminals that show only one.
55* Text-Only Mouse:: Using the mouse in text-only terminals.
56@end menu
57
58@node Cut and Paste
59@section Killing and Yanking on Graphical Displays
60
2aee6012
CY
61 This section describes commands for selecting a region, killing, and
62yanking using the mouse.
8cf51b2c
GM
63
64@menu
65* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
8cf51b2c 66* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
2aee6012 67* Cut/Paste Other App:: Transfering text between Emacs and other apps.
8cf51b2c
GM
68* Secondary Selection:: Cutting without altering point and mark.
69* Clipboard:: Using the clipboard for selections.
70@end menu
71
72@node Mouse Commands
73@subsection Mouse Commands for Editing
74@cindex mouse buttons (what they do)
75
8cf51b2c
GM
76@kindex Mouse-1
77@kindex Mouse-2
78@kindex Mouse-3
dc103cdc 79@table @kbd
8cf51b2c
GM
80@item Mouse-1
81Move point to where you click (@code{mouse-set-point}).
2aee6012
CY
82
83@item Drag-Mouse-1
84Activate the region around the text selected by dragging, and copy it
85to the kill ring (@code{mouse-set-region}).
86
87@item Mouse-2
88Yank the last killed text at the click position
89(@code{mouse-yank-at-click}).
90
91@item Mouse-3
92If the region is active, move the nearer end of the region to the
93click position; otherwise, set mark at the current value of point and
94point at the click position. Save the resulting region in the kill
95ring; on a second click, kill it (@code{mouse-save-then-kill}).
96@end table
97
98@findex mouse-set-point
99 The most basic mouse command is @code{mouse-set-point}, which is
dc103cdc 100called by clicking with the left mouse button, @kbd{Mouse-1}, in the
2aee6012
CY
101text area of a window. This moves point to the position where you
102clicked.
8cf51b2c
GM
103
104@vindex x-mouse-click-focus-ignore-position
2aee6012
CY
105 Normally, Emacs does not distinguish between ordinary mouse clicks
106and clicks that select a frame. When you click on a frame to select
107it, that also changes the selected window and cursor position
108according to the mouse click position. On the X window system, you
109can change this behavior by setting the variable
8cf51b2c
GM
110@code{x-mouse-click-focus-ignore-position} to @code{t}. Then the
111first click selects the frame, but does not affect the selected window
2aee6012
CY
112or cursor position. If you click again in the same place, that click
113will be in the selected frame, so it will change the window or cursor
114position.
8cf51b2c 115
2aee6012
CY
116@findex mouse-set-region
117@vindex mouse-drag-copy-region
dc103cdc 118 Holding down @kbd{Mouse-1} and ``dragging'' the mouse over a stretch
2aee6012
CY
119of text activates the region around that text
120(@code{mouse-set-region}). @xref{Mark}. Emacs places the mark where
121you started holding down the mouse button, and point where you release
122it. In addition, the region is copied into the kill ring (@pxref{Kill
123Ring}). If you don't want Emacs to copy the region, change the
124variable @code{mouse-drag-copy-region} to @code{nil}.
8cf51b2c
GM
125
126@vindex mouse-scroll-min-lines
2aee6012 127 If you move the mouse off the top or bottom of the window while
8cf51b2c
GM
128dragging, the window scrolls at a steady rate until you move the mouse
129back into the window. This way, you can select regions that don't fit
130entirely on the screen. The number of lines scrolled per step depends
131on how far away from the window edge the mouse has gone; the variable
132@code{mouse-scroll-min-lines} specifies a minimum step size.
133
2aee6012 134@findex mouse-yank-at-click
8cf51b2c 135@vindex mouse-yank-at-point
dc103cdc 136 Clicking with the middle mouse button, @kbd{Mouse-2}, moves point to
2aee6012
CY
137the position where you clicked and performs a yank
138(@code{mouse-yank-at-click}). @xref{Yanking}. If you change the
139variable @code{mouse-yank-at-point} to a non-@code{nil} value,
140@kbd{Mouse-2} does not move point. Then it does not matter where you
141click, or even which of the frame's windows you click on; the yank
142occurs at the existing point. This variable also affects yanking the
143primary and secondary selections (@pxref{Cut/Paste Other App}).
144
145@findex mouse-save-then-kill
dc103cdc 146 Clicking with the right mouse button, @kbd{Mouse-3}, runs the
2aee6012
CY
147command @code{mouse-save-then-kill}. This performs several actions
148depending on where you click and the status of the region:
149
150@itemize @bullet
151@item
dc103cdc 152If no region is active, clicking @kbd{Mouse-3} activates the region,
2aee6012
CY
153placing the mark where point was and point at the clicked position.
154In addition, the text in the region is copied to the kill ring.
155
156@item
dc103cdc 157If a region is active, clicking @kbd{Mouse-3} adjusts the nearer end
2aee6012
CY
158of the region by moving it to the clicked position. The adjusted
159region's text is copied to the kill ring; if the text in the original
160region was already on the kill ring, it replaces it there.
161
162@item
163If you originally specified the region using a double or triple
dc103cdc
CY
164@kbd{Mouse-1}, so that the region is defined to consist of entire
165words or lines, then adjusting the region with @kbd{Mouse-3} also
2aee6012
CY
166proceeds by entire words or lines.
167
168@item
dc103cdc 169If you use @kbd{Mouse-3} a second time consecutively, at the same
2aee6012 170place, that kills the region already selected. Thus, the simplest way
dc103cdc
CY
171to kill text with the mouse is to click @kbd{Mouse-1} at one end, then
172click @kbd{Mouse-3} twice at the other end. To copy the text into the
173kill ring without deleting it from the buffer, press @kbd{Mouse-3}
174just once---or just drag across the text with @kbd{Mouse-1}. Then you
2aee6012
CY
175can copy it elsewhere by yanking it.
176@end itemize
177
178 Whenever you set the region using any of the mouse commands
179described above, the mark will be deactivated by any subsequent
180unshifted cursor motion command, in addition to the usual ways of
181deactivating the mark. @xref{Shift Selection}. While the region
182remains active, typing @key{Backspace} or @key{Delete} deletes the
183text in that region and deactivates the mark; this behavior follows a
184convention established by other graphical programs, and it does
185@emph{not} apply when you set the region any other way, including
186shift-selection (@pxref{Shift Selection}).
8cf51b2c
GM
187
188@cindex Delete Selection mode
189@cindex mode, Delete Selection
190@findex delete-selection-mode
2aee6012
CY
191 Many graphical applications also follow the convention that
192insertion while text is selected deletes the selected text. You can
193make Emacs behave this way by typing @kbd{M-x delete-selection-mode}.
194This enables a minor mode named Delete Selection mode. Another effect
195of this mode is that some keys, such as @key{DEL} and @kbd{C-d},
196always kill the region if one exists.
8cf51b2c
GM
197
198@node Word and Line Mouse
199@subsection Mouse Commands for Words and Lines
200
2aee6012
CY
201 These variants of @kbd{Mouse-1} select entire words or lines at a
202time. Emacs activates the region around the selected text, which is
203also copied to the kill ring.
8cf51b2c 204
dc103cdc 205@table @kbd
8cf51b2c 206@item Double-Mouse-1
2aee6012 207Select the text around the word which you click on.
8cf51b2c 208
2aee6012
CY
209Double-clicking on a character with ``symbol'' syntax (such as
210underscore, in C mode) selects the symbol surrounding that character.
211Double-clicking on a character with open- or close-parenthesis syntax
212selects the parenthetical grouping which that character starts or
213ends. Double-clicking on a character with string-delimiter syntax
214(such as a singlequote or doublequote in C) selects the string
215constant (Emacs uses heuristics to figure out whether that character
216is the beginning or the end of it).
8cf51b2c
GM
217
218@item Double-Drag-Mouse-1
2aee6012 219Select the text you drag across, in the form of whole words.
8cf51b2c
GM
220
221@item Triple-Mouse-1
2aee6012 222Select the line you click on.
8cf51b2c
GM
223
224@item Triple-Drag-Mouse-1
2aee6012 225Select the text you drag across, in the form of whole lines.
8cf51b2c
GM
226@end table
227
2aee6012
CY
228@node Cut/Paste Other App
229@subsection Cut and Paste with Other Window Applications
230
231@cindex X cutting and pasting
232@cindex X selection
233@cindex primary selection
234@cindex selection, primary
e9f5524e
CY
235 When running Emacs under the X window system, you can easily
236transfer text between Emacs and other X applications using the
237@dfn{primary selection} (also called the @dfn{X selection}). This is
238@emph{not} the same thing as the @dfn{clipboard}, which is a separate
239facility used on desktop environments such as Gnome, and on operating
240systems such as Microsoft Windows (@pxref{Clipboard}).
2aee6012
CY
241
242 Under X, whenever you select some text in Emacs by dragging or
243clicking the mouse (@pxref{Mouse Commands}), it is also saved in the
244primary selection. You can then @dfn{paste} that text into any other
dc103cdc 245X application, usually by clicking @kbd{Mouse-2} in that application.
2aee6012
CY
246Unlike the Emacs kill ring (@pxref{Kill Ring}), the primary selection
247has no ``memory'': each time you save something in the primary
248selection, either in Emacs or in another X application, the previous
249contents of the primary selection are lost.
250
251 Whenever you kill some text using a command such as @kbd{C-w}
252(@code{kill-region}), or copy it into the kill ring using a command
253such as @kbd{M-w} (@code{kill-ring-save}), that text is also saved in
254the primary selection. @xref{Killing}.
255
e9f5524e
CY
256@vindex select-active-regions
257@vindex yank-pop-change-selection
2aee6012 258 If you set the region using the keyboard, the text within the region
e9f5524e
CY
259is not normally saved to the primary selection. However, if you
260change the variable @code{select-active-regions} to @code{t}, the
261region is saved to the primary selection each time you activate the
262mark (the primary selection is @emph{not} updated if you subsequently
263change the region by moving point). If you change the variable
264@code{yank-pop-change-selection} to @code{t}, rotating the kill ring
265with @kbd{M-y} (@code{yank-pop}) also saves the new yank to the
266primary selection (@pxref{Yanking}).
2aee6012
CY
267
268@cindex cut buffer
269@vindex x-cut-buffer-max
270 Whenever Emacs saves some text to the primary selection, it may also
271save it to the @dfn{cut buffer}. The cut buffer is an obsolete
272predecessor to the primary selection; most modern applications do not
273make use of it. Because saving text to the cut buffer is slow and
274inefficient, Emacs only does it if the text is shorter than the value
275of @code{x-cut-buffer-max} (the default is 20000 characters).
276
277 You can yank the primary selection into Emacs using the usual yank
dc103cdc 278commands, such as @kbd{C-y} (@code{yank}) and @kbd{Mouse-2}
2aee6012
CY
279(@code{mouse-yank-at-click}). These commands actually check the
280primary selection before referring to the kill ring; if no primary
281selection is available, the kill ring contents are used. To prevent
282yank commands from accessing the primary selection, set the variable
283@code{x-select-enable-primary} to @code{nil}.
284
285 The standard coding system for the primary selection is
286@code{compound-text-with-extensions}. You may find that the pasted
287text is not what you expected. In such a case, you can specify
288another coding system for the selection by typing @kbd{C-x @key{RET}
289x} or @kbd{C-x @key{RET} X}. Alternatively, you can request a
290different data type by modifying the variable
291@code{x-select-request-type}. @xref{Communication Coding}.
292
8cf51b2c
GM
293@node Secondary Selection
294@subsection Secondary Selection
295@cindex secondary selection
296
e9f5524e
CY
297 In addition to the primary selection, the X Window System provides a
298second similar facility known as the @dfn{secondary selection}.
299Nowadays, few X applications make use of the secondary selection, but
300you can access it using the following Emacs commands:
8cf51b2c 301
dc103cdc 302@table @kbd
8cf51b2c
GM
303@findex mouse-set-secondary
304@kindex M-Drag-Mouse-1
4fc2e5bf 305@item M-Drag-Mouse-1
8cf51b2c
GM
306Set the secondary selection, with one end at the place where you press
307down the button, and the other end at the place where you release it
e9f5524e
CY
308(@code{mouse-set-secondary}). The selected text is highlighted, using
309the @code{secondary-selection} face, as you drag. The window scrolls
310automatically if you drag the mouse off the top or bottom of the
311window, just like @code{mouse-set-region} (@pxref{Mouse Commands}).
8cf51b2c 312
e9f5524e 313This command does not alter the kill ring.
8cf51b2c
GM
314
315@findex mouse-start-secondary
316@kindex M-Mouse-1
4fc2e5bf 317@item M-Mouse-1
8cf51b2c
GM
318Set one endpoint for the @dfn{secondary selection}
319(@code{mouse-start-secondary}).
320
321@findex mouse-secondary-save-then-kill
322@kindex M-Mouse-3
4fc2e5bf 323@item M-Mouse-3
e9f5524e
CY
324Set the secondary selection, with one end at the position clicked and
325the other at the position specified with @kbd{M-Mouse-1}
326(@code{mouse-secondary-save-then-kill}). This also puts the selected
dc103cdc
CY
327text in the kill ring. A second @kbd{M-Mouse-3} at the same place
328kills the secondary selection just made.
8cf51b2c
GM
329
330@findex mouse-yank-secondary
331@kindex M-Mouse-2
4fc2e5bf 332@item M-Mouse-2
e9f5524e
CY
333Insert the secondary selection where you click, placing point at the
334end of the yanked text (@code{mouse-yank-secondary}).
8cf51b2c
GM
335@end table
336
dc103cdc
CY
337Double or triple clicking of @kbd{M-Mouse-1} operates on words and
338lines, much like @kbd{Mouse-1}.
8cf51b2c 339
dc103cdc 340If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks
4fc2e5bf
CY
341at point. Then it does not matter precisely where you click, or even
342which of the frame's windows you click on. @xref{Mouse Commands}.
8cf51b2c
GM
343
344@node Clipboard
345@subsection Using the Clipboard
346@cindex clipboard
8cf51b2c 347
e9f5524e
CY
348 In desktop environments such as Gnome, and operating systems such as
349Microsoft Windows and Mac OS X, you can transfer data (usually text)
350between different applications using the @dfn{clipboard}. The
351clipboard is distinct from the primary selection and secondary
352selection discussed earlier. You can access the clipboard through the
353@samp{Edit} menu of the menu bar (@pxref{Menu Bar}).
8cf51b2c 354
e9f5524e
CY
355@cindex cut
356@findex clipboard-kill-region
357 The command @code{clipboard-kill-region}, which is bound to the
358@code{Cut} menu item, kills the region and saves it in the clipboard.
8cf51b2c 359
e9f5524e
CY
360@cindex copy
361@findex clipboard-kill-ring-save
362 The command @code{clipboard-kill-ring-save}, which is bound to the
363@code{Copy} menu item, copies the region to the kill ring and saves it
364in the clipboard.
365
366@cindex paste
367 The @code{Paste} menu item in the Edit menu yanks the contents of
368the clipboard at point.
369
370@vindex x-select-enable-clipboard
371 You can customize the variable @code{x-select-enable-clipboard} to
372make the Emacs yank functions consult the clipboard before the primary
8cf51b2c 373selection, and to make the kill functions to store in the clipboard as
e9f5524e
CY
374well as the primary selection. Otherwise, these commands do not
375access the clipboard at all. Using the clipboard is the default on
376MS-Windows and Mac OS, but not on other systems.
8cf51b2c
GM
377
378@node Mouse References
379@section Following References with the Mouse
380@kindex Mouse-1 @r{(selection)}
381@kindex Mouse-2 @r{(selection)}
382
4fc2e5bf 383@vindex mouse-highlight
713c75b0
CY
384 Some Emacs buffers include @dfn{buttons}. A button is a piece of
385text that performs some action when you activate it, such as following
386a reference. Usually, a button's text is visually highlighted: it is
387underlined, or a box is drawn around it. If you move the mouse over a
388button, the shape of the mouse cursor changes and the button lights up
389(if you change the variable @code{mouse-highlight} to @code{nil},
390Emacs disables this highlighting).
4fc2e5bf
CY
391
392 You can activate a button by moving point to it and typing
393@key{RET}, or by clicking either @kbd{Mouse-1} or @kbd{Mouse-2} on the
394button. For example, typing @key{RET} or clicking on a file name in a
395Dired buffer visits that file (@pxref{Dired}). Doing it on an error
396message in the @samp{*Compilation*} buffer goes to the source code for
397that error message (@pxref{Compilation}). Doing it on a completion in
398the @samp{*Completions*} buffer chooses that completion
399(@pxref{Completion}).
400
dc103cdc 401 Although clicking @kbd{Mouse-1} on a button usually activates that
4fc2e5bf
CY
402button, if you hold the mouse button down for a short period of time
403before releasing it (specifically, for more than 450 milliseconds),
404then Emacs moves point where you clicked instead. This behavior
405allows you to use the mouse to move point over a button without
713c75b0
CY
406following it. Dragging---moving the mouse while it is held down---has
407its usual behavior of setting the region, even if you drag from or
408onto a button.
8cf51b2c
GM
409
410@vindex mouse-1-click-in-non-selected-windows
dc103cdc 411 Normally, clicking @kbd{Mouse-1} on a button activates the button
713c75b0 412even if it is in a nonselected window. If you change the variable
4fc2e5bf 413@code{mouse-1-click-in-non-selected-windows} to @code{nil}, clicking
dc103cdc 414@kbd{Mouse-1} on a button in an un-selected window moves point to the
4fc2e5bf
CY
415clicked position and selects that window, without activating the
416button.
8cf51b2c
GM
417
418@vindex mouse-1-click-follows-link
4fc2e5bf
CY
419 In Emacs versions before 22, only @kbd{Mouse-2} activates buttons
420and @kbd{Mouse-1} always sets point. If you prefer this older
421behavior, set the variable @code{mouse-1-click-follows-link} to
422@code{nil}. This variable also lets you choose various other
423alternatives for following links with the mouse. Type @kbd{C-h v
8cf51b2c
GM
424mouse-1-click-follows-link @key{RET}} for more details.
425
426@node Menu Mouse Clicks
427@section Mouse Clicks for Menus
428
429 Several mouse clicks with the @key{CTRL} and @key{SHIFT} modifiers
430bring up menus.
431
dc103cdc 432@table @kbd
8cf51b2c
GM
433@item C-Mouse-1
434@kindex C-Mouse-1
435This menu is for selecting a buffer.
436
437The MSB (``mouse select buffer'') global minor mode makes this
438menu smarter and more customizable. @xref{Buffer Menus}.
439
440@item C-Mouse-2
441@kindex C-Mouse-2
442This menu is for specifying faces and other text properties
443for editing formatted text. @xref{Formatted Text}.
444
445@item C-Mouse-3
446@kindex C-Mouse-3
447This menu is mode-specific. For most modes if Menu-bar mode is on,
448this menu has the same items as all the mode-specific menu-bar menus
449put together. Some modes may specify a different menu for this
450button.@footnote{Some systems use @kbd{Mouse-3} for a mode-specific
451menu. We took a survey of users, and found they preferred to keep
452@kbd{Mouse-3} for selecting and killing regions. Hence the decision
453to use @kbd{C-Mouse-3} for this menu. To use @kbd{Mouse-3} instead,
454do @code{(global-set-key [mouse-3] 'mouse-popup-menubar-stuff)}.} If
455Menu-bar mode is off, this menu contains all the items which would be
456present in the menu bar---not just the mode-specific ones---so that
457you can access them without having to display the menu bar.
458
459@item S-Mouse-1
4fc2e5bf
CY
460This menu is for changing the default face within the window's buffer.
461@xref{Temporary Face Changes}.
8cf51b2c
GM
462@end table
463
464@node Mode Line Mouse
465@section Mode Line Mouse Commands
466@cindex mode line, mouse
467@cindex mouse on mode line
468
469 You can use mouse clicks on window mode lines to select and manipulate
470windows.
471
7b6be833
GM
472 Some areas of the mode line, such as the buffer name, and major and minor
473mode names, have their own special mouse bindings. These areas are
8cf51b2c
GM
474highlighted when you hold the mouse over them, and information about
475the special bindings will be displayed (@pxref{Tooltips}). This
476section's commands do not apply in those areas.
477
478@table @kbd
479@item Mouse-1
480@kindex Mouse-1 @r{(mode line)}
481@kbd{Mouse-1} on a mode line selects the window it belongs to. By
482dragging @kbd{Mouse-1} on the mode line, you can move it, thus
483changing the height of the windows above and below. Changing heights
484with the mouse in this way never deletes windows, it just refuses to
485make any window smaller than the minimum height.
486
487@item Mouse-2
488@kindex Mouse-2 @r{(mode line)}
489@kbd{Mouse-2} on a mode line expands that window to fill its frame.
490
491@item Mouse-3
492@kindex Mouse-3 @r{(mode line)}
493@kbd{Mouse-3} on a mode line deletes the window it belongs to. If the
494frame has only one window, it buries the current buffer instead, and
495switches to another buffer.
496
497@item C-Mouse-2
498@kindex C-mouse-2 @r{(mode line)}
499@kbd{C-Mouse-2} on a mode line splits the window above
500horizontally, above the place in the mode line where you click.
501@end table
502
503@kindex C-Mouse-2 @r{(scroll bar)}
504@kindex Mouse-1 @r{(scroll bar)}
505 Using @kbd{Mouse-1} on the divider between two side-by-side mode
506lines, you can move the vertical boundary left or right. Using
507@kbd{C-Mouse-2} on a scroll bar splits the corresponding window
508vertically. @xref{Split Window}.
509
510@node Creating Frames
511@section Creating Frames
512@cindex creating frames
513
514@kindex C-x 5
515 The prefix key @kbd{C-x 5} is analogous to @kbd{C-x 4}, with parallel
516subcommands. The difference is that @kbd{C-x 5} commands create a new
517frame rather than just a new window in the selected frame (@pxref{Pop
518Up Window}). If an existing visible or iconified frame already displays
519the requested material, these commands use the existing frame, after
520raising or deiconifying as necessary.
521
522 The various @kbd{C-x 5} commands differ in how they find or create the
523buffer to select:
524
525@table @kbd
526@item C-x 5 2
527@kindex C-x 5 2
528@findex make-frame-command
529Create a new frame (@code{make-frame-command}).
530@item C-x 5 b @var{bufname} @key{RET}
531Select buffer @var{bufname} in another frame. This runs
532@code{switch-to-buffer-other-frame}.
533@item C-x 5 f @var{filename} @key{RET}
534Visit file @var{filename} and select its buffer in another frame. This
535runs @code{find-file-other-frame}. @xref{Visiting}.
536@item C-x 5 d @var{directory} @key{RET}
537Select a Dired buffer for directory @var{directory} in another frame.
538This runs @code{dired-other-frame}. @xref{Dired}.
539@item C-x 5 m
540Start composing a mail message in another frame. This runs
541@code{mail-other-frame}. It is the other-frame variant of @kbd{C-x m}.
542@xref{Sending Mail}.
543@item C-x 5 .
544Find a tag in the current tag table in another frame. This runs
545@code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}.
546@xref{Tags}.
547@item C-x 5 r @var{filename} @key{RET}
548@kindex C-x 5 r
549@findex find-file-read-only-other-frame
550Visit file @var{filename} read-only, and select its buffer in another
551frame. This runs @code{find-file-read-only-other-frame}.
552@xref{Visiting}.
553@end table
554
555@cindex default-frame-alist
556@cindex initial-frame-alist
4fc2e5bf
CY
557@cindex face customization, in init file
558@cindex color customization, in init file
8cf51b2c
GM
559 You can control the appearance of new frames you create by setting the
560frame parameters in @code{default-frame-alist}. You can use the
561variable @code{initial-frame-alist} to specify parameters that affect
562only the initial frame. @xref{Initial Parameters,,, elisp, The Emacs
563Lisp Reference Manual}, for more information.
564
565@cindex font (default)
4fc2e5bf
CY
566 For instance, one way to specify the principal font for all your
567Emacs frames is to modify @code{default-frame-alist} to specify the
568@code{font} parameter (@pxref{Font X}):
8cf51b2c
GM
569
570@example
571(add-to-list 'default-frame-alist '(font . "10x20"))
572@end example
573
574@noindent
575Here's a similar example for specifying a foreground color:
576
577@example
578(add-to-list 'default-frame-alist '(foreground-color . "blue"))
579@end example
580
581@noindent
4fc2e5bf
CY
582By putting such customizations in your init file, you can control the
583appearance of all the frames Emacs creates, including the initial one.
584@xref{Init File}.
8cf51b2c
GM
585
586@node Frame Commands
587@section Frame Commands
588
589 The following commands let you create, delete and operate on frames:
590
591@table @kbd
592@item C-z
593@kindex C-z @r{(X windows)}
594@findex iconify-or-deiconify-frame
595Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}).
596When typed on an Emacs frame's icon, deiconify instead.
4fc2e5bf 597@xref{Exiting}.
8cf51b2c
GM
598
599@item C-x 5 0
600@kindex C-x 5 0
601@findex delete-frame
4fc2e5bf
CY
602Delete the selected frame (@code{delete-frame}). This is not allowed
603if there is only one frame.
8cf51b2c
GM
604
605@item C-x 5 o
606@kindex C-x 5 o
607@findex other-frame
4fc2e5bf
CY
608Select another frame, raise it, and warp the mouse to it. If you
609repeat this command, it cycles through all the frames on your
610terminal.
8cf51b2c
GM
611
612@item C-x 5 1
613@kindex C-x 5 1
614@findex delete-other-frames
615Delete all frames except the selected one.
616@end table
617
618@vindex focus-follows-mouse
4fc2e5bf
CY
619 To make the command @kbd{C-x 5 o} work properly, you should tell
620Emacs how the system (or the window manager) handles focus-switching
621between windows. There are two possibilities: either simply moving
622the mouse onto a window selects it (gives it focus), or you have to
623click on it to do so. On X, this focus policy also affects whether
624the focus is given to a frame that Emacs raises. Unfortunately there
625is no way Emacs can find out automatically which way the system
626handles this, so you have to explicitly say, by setting the variable
627@code{focus-follows-mouse}. If just moving the mouse onto a window
628selects it, that variable should be @code{t}; if a click is necessary,
629the variable should be @code{nil}. The default is @code{t}.
630
631 The window manager that is part of MS-Windows always gives focus to
632a frame that raises, so this variable has no effect in the native
8cf51b2c
GM
633MS-Windows build of Emacs.
634
635@node Speedbar
636@section Speedbar Frames
637@cindex speedbar
638
639@cindex attached frame (of speedbar)
640 The @dfn{speedbar} is a special frame for conveniently navigating in
641or operating on another frame. The speedbar, when it exists, is
642always associated with a specific frame, called its @dfn{attached
643frame}; all speedbar operations act on that frame.
644
645 Type @kbd{M-x speedbar} to create the speedbar and associate it with
646the current frame. To dismiss the speedbar, type @kbd{M-x speedbar}
647again, or select the speedbar and type @kbd{q}. (You can also delete
648the speedbar frame like any other Emacs frame.) If you wish to
649associate the speedbar with a different frame, dismiss it and call
650@kbd{M-x speedbar} from that frame.
651
652 The speedbar can operate in various modes. Its default mode is
653@dfn{File Display} mode, which shows the files in the current
654directory of the selected window of the attached frame, one file per
655line. Clicking on a file name visits that file in the selected window
656of the attached frame, and clicking on a directory name shows that
657directory in the speedbar (@pxref{Mouse References}). Each line also
658has a box, @samp{[+]} or @samp{<+>}, that you can click on to
659@dfn{expand} the contents of that item. Expanding a directory adds
660the contents of that directory to the speedbar display, underneath the
661directory's own line. Expanding an ordinary file adds a list of the
662tags in that file to the speedbar display; you can click on a tag name
663to jump to that tag in the selected window of the attached frame.
664When a file or directory is expanded, the @samp{[+]} changes to
665@samp{[-]}; you can click on that box to @dfn{contract} the item,
666hiding its contents.
667
668 You navigate through the speedbar using the keyboard, too. Typing
669@kbd{RET} while point is on a line in the speedbar is equivalent to
670clicking the item on the current line, and @kbd{SPC} expands or
671contracts the item. @kbd{U} displays the parent directory of the
672current directory. To copy, delete, or rename the file on the current
673line, type @kbd{C}, @kbd{D}, and @kbd{R} respectively. To create a
674new directory, type @kbd{M}.
675
676 Another general-purpose speedbar mode is @dfn{Buffer Display} mode;
677in this mode, the speedbar displays a list of Emacs buffers. To
678switch to this mode, type @kbd{b} in the speedbar. To return to File
679Display mode, type @kbd{f}. You can also change the display mode by
680clicking @kbd{mouse-3} anywhere in the speedbar window (or
681@kbd{mouse-1} on the mode-line) and selecting @samp{Displays} in the
682pop-up menu.
683
684 Some major modes, including Rmail mode, Info, and GUD, have
685specialized ways of putting useful items into the speedbar for you to
686select. For example, in Rmail mode, the speedbar shows a list of Rmail
687files, and lets you move the current message to another Rmail file by
688clicking on its @samp{<M>} box.
689
690 For more details on using and programming the speedbar, @xref{Top,
691Speedbar,,speedbar, Speedbar Manual}.
692
693@node Multiple Displays
694@section Multiple Displays
695@cindex multiple displays
696
697 A single Emacs can talk to more than one X display. Initially, Emacs
698uses just one display---the one specified with the @env{DISPLAY}
699environment variable or with the @samp{--display} option (@pxref{Initial
700Options}). To connect to another display, use the command
701@code{make-frame-on-display}:
702
703@findex make-frame-on-display
704@table @kbd
705@item M-x make-frame-on-display @key{RET} @var{display} @key{RET}
706Create a new frame on display @var{display}.
707@end table
708
709 A single X server can handle more than one screen. When you open
710frames on two screens belonging to one server, Emacs knows they share a
711single keyboard, and it treats all the commands arriving from these
712screens as a single stream of input.
713
714 When you open frames on different X servers, Emacs makes a separate
4fc2e5bf
CY
715input stream for each server. Each server also has its own selected
716frame. The commands you enter with a particular X server apply to
717that server's selected frame.
8cf51b2c 718
4fc2e5bf
CY
719 It is even possible to use this feature to let two or more users
720type simultaneously on the two displays, within the same Emacs job.
721In practice, however, the different users can easily interfere with
722each others' edits if they are not careful.
8cf51b2c
GM
723
724@node Special Buffer Frames
725@section Special Buffer Frames
726
727@vindex special-display-buffer-names
728 You can make certain chosen buffers, which Emacs normally displays
729in ``another window,'' appear in special frames of their own. To do
730this, set the variable @code{special-display-buffer-names} to a list
731of buffer names; any buffer whose name is in that list automatically
732gets a special frame, when an Emacs command wants to display it ``in
733another window.''
734
735 For example, if you set the variable this way,
736
737@example
738(setq special-display-buffer-names
739 '("*Completions*" "*grep*" "*tex-shell*"))
740@end example
741
742@noindent
743then completion lists, @code{grep} output and the @TeX{} mode shell
744buffer get individual frames of their own. These frames, and the
745windows in them, are never automatically split or reused for any other
746buffers. They continue to show the buffers they were created for,
747unless you alter them by hand. Killing the special buffer deletes its
748frame automatically.
749
750@vindex special-display-regexps
751 More generally, you can set @code{special-display-regexps} to a list
752of regular expressions; then a buffer gets its own frame if its name
753matches any of those regular expressions. (Once again, this applies only
754to buffers that normally get displayed for you in ``another window.'')
755
756@vindex special-display-frame-alist
757 The variable @code{special-display-frame-alist} specifies the frame
758parameters for these frames. It has a default value, so you don't need
759to set it.
760
761 For those who know Lisp, an element of
762@code{special-display-buffer-names} or @code{special-display-regexps}
763can also be a list. Then the first element is the buffer name or
764regular expression; the rest of the list specifies how to create the
765frame. It can be an association list specifying frame parameter
766values; these values take precedence over parameter values specified
767in @code{special-display-frame-alist}. If you specify the symbol
768@code{same-window} as a ``frame parameter'' in this list, with a
769non-@code{nil} value, that means to use the selected window if
770possible. If you use the symbol @code{same-frame} as a ``frame
771parameter'' in this list, with a non-@code{nil} value, that means to
772use the selected frame if possible.
773
774 Alternatively, the value can have this form:
775
776@example
777(@var{function} @var{args}...)
778@end example
779
780@noindent
781where @var{function} is a symbol. Then the frame is constructed by
782calling @var{function}; its first argument is the buffer, and its
783remaining arguments are @var{args}.
784
785 An analogous feature lets you specify buffers which should be
786displayed in the selected window. @xref{Force Same Window}. The
787same-window feature takes precedence over the special-frame feature;
788therefore, if you add a buffer name to
789@code{special-display-buffer-names} and it has no effect, check to see
790whether that feature is also in use for the same buffer name.
791
792@node Frame Parameters
793@section Setting Frame Parameters
794@cindex Auto-Raise mode
795@cindex Auto-Lower mode
796
8cf51b2c 797 These commands are available for controlling the window management
4fc2e5bf 798behavior of the selected frame:
8cf51b2c
GM
799
800@table @kbd
801@findex auto-raise-mode
802@item M-x auto-raise-mode
803Toggle whether or not the selected frame should auto-raise. Auto-raise
804means that every time you move the mouse onto the frame, it raises the
805frame.
806
807Some window managers also implement auto-raise. If you enable
808auto-raise for Emacs frames in your window manager, it will work, but
809it is beyond Emacs' control, so @code{auto-raise-mode} has no effect
810on it.
811
812@findex auto-lower-mode
813@item M-x auto-lower-mode
814Toggle whether or not the selected frame should auto-lower.
815Auto-lower means that every time you move the mouse off the frame,
816the frame moves to the bottom of the stack on the screen.
817
818The command @code{auto-lower-mode} has no effect on auto-lower
819implemented by the window manager. To control that, you must use the
820appropriate window manager features.
821@end table
822
823 In Emacs versions that use an X toolkit, the color-setting and
824font-setting functions don't affect menus and the menu bar, since they
825are displayed by their own widget classes. To change the appearance of
826the menus and menu bar, you must use X resources (@pxref{Resources}).
827@xref{Colors}, regarding colors. @xref{Font X}, regarding choice of
828font.
829
830 Colors, fonts, and other attributes of the frame's display can also
831be customized by setting frame parameters in the variable
832@code{default-frame-alist} (@pxref{Creating Frames}). For a detailed
833description of frame parameters and customization, see @ref{Frame
834Parameters,,, elisp, The Emacs Lisp Reference Manual}.
835
836@node Scroll Bars
837@section Scroll Bars
838@cindex Scroll Bar mode
839@cindex mode, Scroll Bar
840
841 On graphical displays, Emacs normally makes a @dfn{scroll bar} at
c5c040a7 842the left of each Emacs window, running the height of the
4fc2e5bf
CY
843window.@footnote{Placing it at the left is usually more useful with
844overlapping frames with text starting at the left margin.}
845
c5c040a7 846 When Emacs is compiled with GTK+ support on the X window system, or
4fc2e5bf
CY
847in operating systems such as Microsoft Windows or Mac OS, you can use
848the scroll bar as you do in other graphical applications. If you
dc103cdc
CY
849click @kbd{Mouse-1} on the scroll bar's up and down buttons, that
850scrolls the window by one line at a time. Clicking @kbd{Mouse-1}
4fc2e5bf
CY
851above or below the scroll bar's inner box scrolls the window by nearly
852the entire height of the window, like @kbd{M-v} and @kbd{C-v}
853respectively (@pxref{Moving Point}). Dragging the inner box with
dc103cdc 854@kbd{Mouse-1} scrolls the window continuously.
4fc2e5bf 855
c5c040a7
CY
856 If Emacs is compiled without GTK+ support on the X window system,
857the scroll bar behaves differently. The scroll bar's inner box is
858drawn to represent the portion of the buffer currently displayed, with
859the entire height of the scroll bar representing the entire length of
dc103cdc
CY
860the buffer. @kbd{Mouse-1} anywhere on the scroll bar scrolls forward
861like @kbd{C-v}, and @kbd{Mouse-3} scrolls backward like @kbd{M-v}.
862Clicking @kbd{Mouse-2} in the scroll bar lets you move or drag the
4fc2e5bf 863inner box up and down.
8cf51b2c
GM
864
865 You can also click @kbd{C-Mouse-2} in the scroll bar to split a
866window vertically. The split occurs on the line where you click.
867
868@findex scroll-bar-mode
869@vindex scroll-bar-mode
4fc2e5bf
CY
870 You can toggle the use of the scroll bar with the command @kbd{M-x
871scroll-bar-mode}. With a prefix argument, this command turns use of
872scroll bars on if and only if the argument is positive. This command
873applies to all frames, including frames yet to be created. Customize
874the variable @code{scroll-bar-mode} to control the use of scroll bars
875at startup. You can use it to specify that they are placed at the
876right of windows if you prefer that. You have to set this variable
877through the @samp{Customize} interface (@pxref{Easy Customization}),
878or it will not work properly. You can also use the X resource
879@samp{verticalScrollBars} to control the initial setting of Scroll Bar
880mode. @xref{Resources}.
8cf51b2c
GM
881
882@findex toggle-scroll-bar
883 To enable or disable scroll bars for just the selected frame, use the
884command @kbd{M-x toggle-scroll-bar}.
885
886@vindex scroll-bar-width
887@cindex width of the scroll bar
888 You can control the scroll bar width by changing the value of the
889@code{scroll-bar-width} frame parameter.
890
891@node Wheeled Mice
892@section Scrolling With ``Wheeled'' Mice
893
894@cindex mouse wheel
895@cindex wheel, mouse
896@findex mouse-wheel-mode
897@cindex Mouse Wheel minor mode
898@cindex mode, Mouse Wheel
899 Some mice have a ``wheel'' instead of a third button. You can
900usually click the wheel to act as either @kbd{Mouse-2} or
901@kbd{Mouse-3}, depending on the setup. You can also use the wheel to
902scroll windows instead of using the scroll bar or keyboard commands.
903Mouse wheel support only works if the system generates appropriate
904events; whenever possible, it is turned on by default. To toggle this
905feature, use @kbd{M-x mouse-wheel-mode}.
906
907@vindex mouse-wheel-follow-mouse
908@vindex mouse-wheel-scroll-amount
909@vindex mouse-wheel-progressive-speed
910 The two variables @code{mouse-wheel-follow-mouse} and
911@code{mouse-wheel-scroll-amount} determine where and by how much
912buffers are scrolled. The variable
913@code{mouse-wheel-progressive-speed} determines whether the scroll
914speed is linked to how fast you move the wheel.
915
916@node Drag and Drop
917@section Drag and Drop
918@cindex drag and drop
919
920 Emacs supports @dfn{drag and drop} using the mouse. For instance,
921dropping text onto an Emacs frame inserts the text where it is dropped.
922Dropping a file onto an Emacs frame visits that file. As a special
923case, dropping the file on a Dired buffer moves or copies the file
924(according to the conventions of the application it came from) into the
925directory displayed in that buffer.
926
927@vindex dnd-open-file-other-window
928 Dropping a file normally visits it in the window you drop it on. If
929you prefer to visit the file in a new window in such cases, customize
930the variable @code{dnd-open-file-other-window}.
931
932 The XDND and Motif drag and drop protocols, and the old KDE 1.x
933protocol, are currently supported.
934
935@node Menu Bars
936@section Menu Bars
937@cindex Menu Bar mode
938@cindex mode, Menu Bar
939@findex menu-bar-mode
940@vindex menu-bar-mode
941
942 You can turn display of menu bars on or off with @kbd{M-x
943menu-bar-mode} or by customizing the variable @code{menu-bar-mode}.
944With no argument, this command toggles Menu Bar mode, a
945minor mode. With an argument, the command turns Menu Bar mode on if the
946argument is positive, off if the argument is not positive. You can use
947the X resource @samp{menuBarLines} to control the initial setting of
948Menu Bar mode. @xref{Resources}.
949
950@kindex C-Mouse-3 @r{(when menu bar is disabled)}
951 Expert users often turn off the menu bar, especially on text-only
952terminals, where this makes one additional line available for text.
953If the menu bar is off, you can still pop up a menu of its contents
954with @kbd{C-Mouse-3} on a display which supports pop-up menus.
955@xref{Menu Mouse Clicks}.
956
957 @xref{Menu Bar}, for information on how to invoke commands with the
958menu bar. @xref{X Resources}, for how to customize the menu bar
959menus' visual appearance.
960
961@node Tool Bars
962@section Tool Bars
963@cindex Tool Bar mode
964@cindex mode, Tool Bar
965@cindex icons, toolbar
966
967 The @dfn{tool bar} is a line (or lines) of icons at the top of the
968Emacs window, just below the menu bar. You can click on these icons
969with the mouse to do various jobs.
970
971 The global tool bar contains general commands. Some major modes
972define their own tool bars to replace it. A few ``special'' modes
973that are not designed for ordinary editing remove some items from the
974global tool bar.
975
976 Tool bars work only on a graphical display. The tool bar uses colored
977XPM icons if Emacs was built with XPM support. Otherwise, the tool
978bar uses monochrome icons (PBM or XBM format).
979
980@findex tool-bar-mode
981@vindex tool-bar-mode
982 You can turn display of tool bars on or off with @kbd{M-x
983tool-bar-mode} or by customizing the option @code{tool-bar-mode}.
984
985@node Dialog Boxes
986@section Using Dialog Boxes
987@cindex dialog boxes
988
989@vindex use-dialog-box
990 A dialog box is a special kind of menu for asking you a yes-or-no
991question or some other special question. Many Emacs commands use a
992dialog box to ask a yes-or-no question, if you used the mouse to
c5c040a7 993invoke the command that led to the question.
8cf51b2c 994
c5c040a7
CY
995 To disable the use of dialog boxes, change the variable
996@code{use-dialog-box} to @code{nil}. In that case, Emacs always
997performs yes-or-no prompts using the echo area and keyboard input.
998This variable also controls whether to use file selection windows (but
999those are not supported on all platforms).
8cf51b2c
GM
1000
1001@vindex use-file-dialog
9c5e9396 1002@cindex file selection dialog, how to disable
8cf51b2c
GM
1003 A file selection window is a special kind of dialog box for asking
1004for file names. You can customize the variable @code{use-file-dialog}
1005to suppress the use of file selection windows, even if you still want
1006other kinds of dialogs. This variable has no effect if you have
1007suppressed all dialog boxes with the variable @code{use-dialog-box}.
1008
1009@vindex x-gtk-show-hidden-files
8cf51b2c 1010@vindex x-gtk-file-dialog-help-text
9c5e9396
EZ
1011@cindex hidden files, in GTK+ file chooser
1012@cindex help text, in GTK+ file chooser
c5c040a7
CY
1013 When Emacs is compiled with GTK+ support, it uses the GTK+ ``file
1014chooser'' dialog. Emacs adds an additional toggle button to this
1015dialog, which you can use to enable or disable the display of hidden
1016files (files starting with a dot) in that dialog. If you want this
1017toggle to be activated by default, change the variable
1018@code{x-gtk-show-hidden-files} to @code{t}. In addition, Emacs adds
1019help text to the GTK+ file chooser dialog; to disable this help text,
1020change the variable @code{x-gtk-file-dialog-help-text} to @code{nil}.
1021
9c5e9396 1022@vindex x-gtk-use-old-file-dialog
c5c040a7
CY
1023 In GTK+ versions 2.4 through 2.10, you can choose to use an older
1024version of the GTK+ file dialog by setting the variable
1025@code{x-gtk-use-old-file-dialog} to a non-@code{nil} value. If Emacs
1026is built with a GTK+ version that has only one file dialog, this
1027variable has no effect.
8cf51b2c
GM
1028
1029@node Tooltips
1030@section Tooltips
1031@cindex tooltips
1032
1033 @dfn{Tooltips} are small windows that display text information at the
1034current mouse position. They activate when there is a pause in mouse
1035movement. There are two types of tooltip: help tooltips and GUD
1036tooltips.
1037
1038 @dfn{Help tooltips} typically display over text---including the mode
1039line---but are also available for other parts of the Emacs frame, such
1040as the tool bar and menu items.
1041
1042@findex tooltip-mode
1043 You can toggle display of help tooltips (Tooltip mode) with the
1044command @kbd{M-x tooltip-mode}. When Tooltip mode is disabled, the
1045help text is displayed in the echo area instead.
1046
1047 @dfn{GUD tooltips} show values of variables. They are useful when
1048you are debugging a program. @xref{Debugger Operation}.
1049
1050@vindex tooltip-delay
1051 The variables @code{tooltip-delay} specifies how long Emacs should
1052wait before displaying a tooltip. For additional customization
1053options for displaying tooltips, use @kbd{M-x customize-group
1054@key{RET} tooltip @key{RET}}. @xref{X Resources}, for information on
1055customizing the windows that display tooltips.
1056
1057@node Mouse Avoidance
1058@section Mouse Avoidance
1059@cindex avoiding mouse in the way of your typing
1060@cindex mouse avoidance
1061
1062@vindex mouse-avoidance-mode
1063Mouse Avoidance mode keeps the mouse pointer away from point, to avoid
1064obscuring text you want to edit. Whenever it moves the mouse, it also
1065raises the frame. To use Mouse Avoidance mode, customize the variable
1066@code{mouse-avoidance-mode}. You can set this to various values to
1067move the mouse in several ways:
1068
1069@table @code
1070@item banish
1071Move the mouse to the upper-right corner on any key-press;
1072@item exile
1073Move the mouse to the corner only if the cursor gets too close,
1074and allow it to return once the cursor is out of the way;
1075@item jump
1076If the cursor gets too close to the mouse, displace the mouse
1077a random distance & direction;
1078@item animate
1079As @code{jump}, but shows steps along the way for illusion of motion;
1080@item cat-and-mouse
1081The same as @code{animate};
1082@item proteus
1083As @code{animate}, but changes the shape of the mouse pointer too.
1084@end table
1085
1086@findex mouse-avoidance-mode
1087You can also use the command @kbd{M-x mouse-avoidance-mode} to enable
1088the mode.
1089
1090@node Non-Window Terminals
1091@section Non-Window Terminals
1092@cindex non-window terminals
1093@cindex single-frame terminals
1094
1095 On a text-only terminal, Emacs can display only one Emacs frame at a
1096time. However, you can still create multiple Emacs frames, and switch
1097between them. Switching frames on these terminals is much like
1098switching between different window configurations.
1099
1100 Use @kbd{C-x 5 2} to create a new frame and switch to it; use @kbd{C-x
11015 o} to cycle through the existing frames; use @kbd{C-x 5 0} to delete
1102the current frame.
1103
1104 Each frame has a number to distinguish it. If your terminal can
1105display only one frame at a time, the selected frame's number @var{n}
1106appears near the beginning of the mode line, in the form
1107@samp{F@var{n}}.
1108
1109@findex set-frame-name
1110@findex select-frame-by-name
1111 @samp{F@var{n}} is in fact the frame's initial name. You can give
1112frames more meaningful names if you wish, and you can select a frame
1113by its name. Use the command @kbd{M-x set-frame-name @key{RET}
1114@var{name} @key{RET}} to specify a new name for the selected frame,
1115and use @kbd{M-x select-frame-by-name @key{RET} @var{name} @key{RET}}
1116to select a frame according to its name. The name you specify appears
1117in the mode line when the frame is selected.
1118
1119@node Text-Only Mouse
1120@section Using a Mouse in Terminal Emulators
1121@cindex mouse support
1122@cindex terminal emulators, mouse support
1123
c5c040a7 1124Some text-only terminals support mouse clicks in the terminal window.
8cf51b2c
GM
1125
1126@cindex xterm
1127In a terminal emulator which is compatible with @code{xterm},
1128you can use @kbd{M-x xterm-mouse-mode} to give Emacs control over
1129simple use of the mouse---basically, only non-modified single clicks
1130are supported. The normal @code{xterm} mouse functionality for such
1131clicks is still available by holding down the @kbd{SHIFT} key when you
1132press the mouse button. Xterm Mouse mode is a global minor mode
1133(@pxref{Minor Modes}). Repeating the command turns the mode off
1134again.
1135
c5c040a7
CY
1136In the console on GNU/Linux, you can use @kbd{M-x t-mouse-mode} to
1137enable terminal mouse support. You must have the gpm package
1138installed and running on your system in order for this to work.
8cf51b2c
GM
1139
1140@ignore
1141 arch-tag: 7dcf3a31-a43b-45d4-a900-445b10d77e49
1142@end ignore