Bump version to 24.3.92
[bpt/emacs.git] / doc / emacs / frames.texi
CommitLineData
8cf51b2c 1@c This is part of the Emacs manual.
ba318903 2@c Copyright (C) 1985-1987, 1993-1995, 1997, 1999-2014 Free Software
ab422c4d 3@c Foundation, Inc.
8cf51b2c 4@c See file emacs.texi for copying conditions.
abb9615e 5@node Frames
8cf51b2c
GM
6@chapter Frames and Graphical Displays
7@cindex frames
8
1df7defd 9 When Emacs is started on a graphical display, e.g., on the X Window
4ad3bc2a 10System, it occupies a graphical system-level ``window''. In this
b63a8e8e 11manual, we call this a @dfn{frame}, reserving the word ``window'' for
4ad3bc2a
CY
12the part of the frame used for displaying a buffer. A frame initially
13contains one window, but it can be subdivided into multiple windows
14(@pxref{Windows}). A frame normally also contains a menu bar, tool
15bar, and echo area.
16
17 You can also create additional frames (@pxref{Creating Frames}).
18All frames created in the same Emacs session have access to the same
19underlying buffers and other data. For instance, if a buffer is being
20shown in more than one frame, any changes made to it in one frame show
21up immediately in the other frames too.
22
23 Typing @kbd{C-x C-c} closes all the frames on the current display,
24and ends the Emacs session if it has no frames open on any other
25displays (@pxref{Exiting}). To close just the selected frame, type
2aee6012 26@kbd{C-x 5 0} (that is zero, not @kbd{o}).
8cf51b2c 27
4ad3bc2a
CY
28 This chapter describes Emacs features specific to graphical displays
29(particularly mouse commands), and features for managing multiple
0be641c0
CY
30frames. On text terminals, many of these features are unavailable.
31However, it is still possible to create multiple ``frames'' on text
32terminals; such frames are displayed one at a time, filling the entire
33terminal screen (@pxref{Non-Window Terminals}). It is also possible
34to use the mouse on some text terminals (@pxref{Text-Only Mouse}, for
35doing so on GNU and Unix systems; and
8cf51b2c 36@iftex
4ad3bc2a 37@pxref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features},
8cf51b2c
GM
38@end iftex
39@ifnottex
4ad3bc2a 40@pxref{MS-DOS Mouse},
8cf51b2c 41@end ifnottex
4b65d539 42for doing so on MS-DOS). Menus are supported on all text terminals.
8cf51b2c
GM
43
44@menu
4d45a8b7
CY
45* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
46* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
8cf51b2c
GM
47* Mouse References:: Using the mouse to select an item from a list.
48* Menu Mouse Clicks:: Mouse clicks that bring up menus.
49* Mode Line Mouse:: Mouse clicks on the mode line.
50* Creating Frames:: Creating additional Emacs frames with various contents.
51* Frame Commands:: Iconifying, deleting, and switching frames.
d68eb23c 52* Fonts:: Changing the frame font.
8cf51b2c 53* Speedbar:: How to make and use a speedbar frame.
2d2f6581 54* Multiple Displays:: How one Emacs instance can talk to several displays.
8cf51b2c 55* Frame Parameters:: Changing the colors and other modes of frames.
8838673e 56* Scroll Bars:: How to enable and disable scroll bars; how to use them.
8cf51b2c 57* Drag and Drop:: Using drag and drop to open files and insert text.
8838673e 58* Menu Bars:: Enabling and disabling the menu bar.
8cf51b2c
GM
59* Tool Bars:: Enabling and disabling the tool bar.
60* Dialog Boxes:: Controlling use of dialog boxes.
61* Tooltips:: Displaying information at the current mouse position.
b4a1a8b2 62* Mouse Avoidance:: Preventing the mouse pointer from obscuring text.
8cf51b2c 63* Non-Window Terminals:: Multiple frames on terminals that show only one.
0be641c0 64* Text-Only Mouse:: Using the mouse in text terminals.
8cf51b2c
GM
65@end menu
66
8cf51b2c 67@node Mouse Commands
4d45a8b7 68@section Mouse Commands for Editing
8cf51b2c 69@cindex mouse buttons (what they do)
ed39e4e2 70@cindex mouse, selecting text using
8cf51b2c 71
8cf51b2c
GM
72@kindex Mouse-1
73@kindex Mouse-2
74@kindex Mouse-3
dc103cdc 75@table @kbd
8cf51b2c
GM
76@item Mouse-1
77Move point to where you click (@code{mouse-set-point}).
2aee6012
CY
78
79@item Drag-Mouse-1
1b947faa
CY
80Activate the region around the text selected by dragging, and put the
81text in the primary selection (@code{mouse-set-region}).
2aee6012
CY
82
83@item Mouse-2
3dfa7993
EZ
84Move point to where you click, and insert the contents of the primary
85selection there (@code{mouse-yank-primary}).
2aee6012
CY
86
87@item Mouse-3
88If the region is active, move the nearer end of the region to the
89click position; otherwise, set mark at the current value of point and
90point at the click position. Save the resulting region in the kill
91ring; on a second click, kill it (@code{mouse-save-then-kill}).
92@end table
93
94@findex mouse-set-point
95 The most basic mouse command is @code{mouse-set-point}, which is
b63a8e8e 96invoked by clicking with the left mouse button, @kbd{Mouse-1}, in the
2aee6012 97text area of a window. This moves point to the position where you
4ad3bc2a
CY
98clicked. If that window was not the selected window, it becomes the
99selected window.
8cf51b2c
GM
100
101@vindex x-mouse-click-focus-ignore-position
4ad3bc2a
CY
102 Normally, if the frame you clicked in was not the selected frame, it
103is made the selected frame, in addition to selecting the window and
104setting the cursor. On the X Window System, you can change this by
105setting the variable @code{x-mouse-click-focus-ignore-position} to
106@code{t}. In that case, the initial click on an unselected frame just
107selects the frame, without doing anything else; clicking again selects
108the window and sets the cursor position.
8cf51b2c 109
ed39e4e2 110@cindex mouse, dragging
2aee6012 111@findex mouse-set-region
dc103cdc 112 Holding down @kbd{Mouse-1} and ``dragging'' the mouse over a stretch
2aee6012 113of text activates the region around that text
4ad3bc2a
CY
114(@code{mouse-set-region}), placing the mark where you started holding
115down the mouse button, and point where you release it (@pxref{Mark}).
116In addition, the text in the region becomes the primary selection
117(@pxref{Primary Selection}).
118
119@vindex mouse-drag-copy-region
120 If you change the variable @code{mouse-drag-copy-region} to a
121non-@code{nil} value, dragging the mouse over a stretch of text also
122adds the text to the kill ring. The default is @code{nil}.
8cf51b2c
GM
123
124@vindex mouse-scroll-min-lines
2aee6012 125 If you move the mouse off the top or bottom of the window while
8cf51b2c
GM
126dragging, the window scrolls at a steady rate until you move the mouse
127back into the window. This way, you can select regions that don't fit
128entirely on the screen. The number of lines scrolled per step depends
129on how far away from the window edge the mouse has gone; the variable
130@code{mouse-scroll-min-lines} specifies a minimum step size.
131
963578d3 132@findex mouse-yank-primary
2aee6012 133@findex mouse-yank-at-click
dc103cdc 134 Clicking with the middle mouse button, @kbd{Mouse-2}, moves point to
963578d3
CY
135the position where you clicked and inserts the contents of the primary
136selection (@code{mouse-yank-primary}). @xref{Primary Selection}.
4ad3bc2a 137This behavior is consistent with other X applications. Alternatively,
963578d3 138you can rebind @kbd{Mouse-2} to @code{mouse-yank-at-click}, which
20bc9ac5 139performs a yank at the position you click.
963578d3
CY
140
141@vindex mouse-yank-at-point
142 If you change the variable @code{mouse-yank-at-point} to a
143non-@code{nil} value, @kbd{Mouse-2} does not move point; it inserts
144the text at point, regardless of where you clicked or even which of
145the frame's windows you clicked on. This variable affects both
146@code{mouse-yank-primary} and @code{mouse-yank-at-click}.
2aee6012
CY
147
148@findex mouse-save-then-kill
dc103cdc 149 Clicking with the right mouse button, @kbd{Mouse-3}, runs the
2aee6012
CY
150command @code{mouse-save-then-kill}. This performs several actions
151depending on where you click and the status of the region:
152
153@itemize @bullet
154@item
dc103cdc 155If no region is active, clicking @kbd{Mouse-3} activates the region,
2aee6012 156placing the mark where point was and point at the clicked position.
2aee6012
CY
157
158@item
dc103cdc 159If a region is active, clicking @kbd{Mouse-3} adjusts the nearer end
2aee6012
CY
160of the region by moving it to the clicked position. The adjusted
161region's text is copied to the kill ring; if the text in the original
162region was already on the kill ring, it replaces it there.
163
164@item
165If you originally specified the region using a double or triple
dc103cdc 166@kbd{Mouse-1}, so that the region is defined to consist of entire
4ad3bc2a
CY
167words or lines (@pxref{Word and Line Mouse}), then adjusting the
168region with @kbd{Mouse-3} also proceeds by entire words or lines.
2aee6012
CY
169
170@item
dc103cdc 171If you use @kbd{Mouse-3} a second time consecutively, at the same
2aee6012 172place, that kills the region already selected. Thus, the simplest way
dc103cdc
CY
173to kill text with the mouse is to click @kbd{Mouse-1} at one end, then
174click @kbd{Mouse-3} twice at the other end. To copy the text into the
175kill ring without deleting it from the buffer, press @kbd{Mouse-3}
176just once---or just drag across the text with @kbd{Mouse-1}. Then you
2aee6012
CY
177can copy it elsewhere by yanking it.
178@end itemize
179
4ad3bc2a
CY
180 The @code{mouse-save-then-kill} command also obeys the variable
181@code{mouse-drag-copy-region} (described above). If the value is
182non-@code{nil}, then whenever the command sets or adjusts the active
183region, the text in the region is also added to the kill ring. If the
184latest kill ring entry had been added the same way, that entry is
185replaced rather than making a new entry.
186
2aee6012
CY
187 Whenever you set the region using any of the mouse commands
188described above, the mark will be deactivated by any subsequent
189unshifted cursor motion command, in addition to the usual ways of
4ad3bc2a 190deactivating the mark. @xref{Shift Selection}.
8cf51b2c 191
b63a8e8e
CY
192@cindex mouse wheel
193@findex mouse-wheel-mode
194@cindex Mouse Wheel minor mode
195@cindex mode, Mouse Wheel
196@vindex mouse-wheel-follow-mouse
197@vindex mouse-wheel-scroll-amount
198@vindex mouse-wheel-progressive-speed
199 Some mice have a ``wheel'' which can be used for scrolling. Emacs
200supports scrolling windows with the mouse wheel, by default, on most
201graphical displays. To toggle this feature, use @kbd{M-x
202mouse-wheel-mode}. The variables @code{mouse-wheel-follow-mouse} and
203@code{mouse-wheel-scroll-amount} determine where and by how much
204buffers are scrolled. The variable
205@code{mouse-wheel-progressive-speed} determines whether the scroll
206speed is linked to how fast you move the wheel.
207
8cf51b2c 208@node Word and Line Mouse
4d45a8b7 209@section Mouse Commands for Words and Lines
8cf51b2c 210
2aee6012
CY
211 These variants of @kbd{Mouse-1} select entire words or lines at a
212time. Emacs activates the region around the selected text, which is
213also copied to the kill ring.
8cf51b2c 214
dc103cdc 215@table @kbd
8cf51b2c 216@item Double-Mouse-1
2aee6012 217Select the text around the word which you click on.
8cf51b2c 218
2aee6012
CY
219Double-clicking on a character with ``symbol'' syntax (such as
220underscore, in C mode) selects the symbol surrounding that character.
221Double-clicking on a character with open- or close-parenthesis syntax
222selects the parenthetical grouping which that character starts or
223ends. Double-clicking on a character with string-delimiter syntax
4ad3bc2a 224(such as a single-quote or double-quote in C) selects the string
2aee6012
CY
225constant (Emacs uses heuristics to figure out whether that character
226is the beginning or the end of it).
8cf51b2c
GM
227
228@item Double-Drag-Mouse-1
2aee6012 229Select the text you drag across, in the form of whole words.
8cf51b2c
GM
230
231@item Triple-Mouse-1
2aee6012 232Select the line you click on.
8cf51b2c
GM
233
234@item Triple-Drag-Mouse-1
2aee6012 235Select the text you drag across, in the form of whole lines.
8cf51b2c
GM
236@end table
237
8cf51b2c
GM
238@node Mouse References
239@section Following References with the Mouse
ed39e4e2
CY
240@kindex Mouse-1 @r{(on buttons)}
241@kindex Mouse-2 @r{(on buttons)}
4ad3bc2a
CY
242@cindex hyperlinks
243@cindex links
244@cindex text buttons
245@cindex buttons
8cf51b2c 246
4fc2e5bf 247@vindex mouse-highlight
4ad3bc2a 248 Some Emacs buffers include @dfn{buttons}, or @dfn{hyperlinks}:
1df7defd
PE
249pieces of text that perform some action (e.g., following a reference)
250when activated (e.g., by clicking on them). Usually, a button's text
4ad3bc2a
CY
251is visually highlighted: it is underlined, or a box is drawn around
252it. If you move the mouse over a button, the shape of the mouse
253cursor changes and the button lights up. If you change the variable
254@code{mouse-highlight} to @code{nil}, Emacs disables this
255highlighting.
4fc2e5bf
CY
256
257 You can activate a button by moving point to it and typing
258@key{RET}, or by clicking either @kbd{Mouse-1} or @kbd{Mouse-2} on the
4ad3bc2a
CY
259button. For example, in a Dired buffer, each file name is a button;
260activating it causes Emacs to visit that file (@pxref{Dired}). In a
1c64e6ed 261@file{*Compilation*} buffer, each error message is a button, and
4ad3bc2a
CY
262activating it visits the source code for that error
263(@pxref{Compilation}).
264
265 Although clicking @kbd{Mouse-1} on a button usually activates the
266button, if you hold the mouse button down for a period of time before
267releasing it (specifically, for more than 450 milliseconds), then
268Emacs moves point where you clicked, without activating the button.
269In this way, you can use the mouse to move point over a button without
270activating it. Dragging the mouse over or onto a button has its usual
271behavior of setting the region, and does not activate the button.
272
273 You can change how @kbd{Mouse-1} applies to buttons by customizing
274the variable @code{mouse-1-click-follows-link}. If the value is a
275positive integer, that determines how long you need to hold the mouse
276button down for, in milliseconds, to cancel button activation; the
277default is 450, as described in the previous paragraph. If the value
278is @code{nil}, @kbd{Mouse-1} just sets point where you clicked, and
279does not activate buttons. If the value is @code{double}, double
280clicks activate buttons but single clicks just set point.
8cf51b2c
GM
281
282@vindex mouse-1-click-in-non-selected-windows
4ad3bc2a
CY
283 Normally, @kbd{Mouse-1} on a button activates the button even if it
284is in a non-selected window. If you change the variable
285@code{mouse-1-click-in-non-selected-windows} to @code{nil},
286@kbd{Mouse-1} on a button in an unselected window moves point to the
4fc2e5bf
CY
287clicked position and selects that window, without activating the
288button.
8cf51b2c 289
8cf51b2c
GM
290@node Menu Mouse Clicks
291@section Mouse Clicks for Menus
292
293 Several mouse clicks with the @key{CTRL} and @key{SHIFT} modifiers
294bring up menus.
295
dc103cdc 296@table @kbd
8cf51b2c
GM
297@item C-Mouse-1
298@kindex C-Mouse-1
299This menu is for selecting a buffer.
300
301The MSB (``mouse select buffer'') global minor mode makes this
302menu smarter and more customizable. @xref{Buffer Menus}.
303
304@item C-Mouse-2
305@kindex C-Mouse-2
8863a584
CY
306This menu contains entries for examining faces and other text
307properties, and well as for setting them (the latter is mainly useful
308when editing enriched text; @pxref{Enriched Text}).
8cf51b2c
GM
309
310@item C-Mouse-3
311@kindex C-Mouse-3
312This menu is mode-specific. For most modes if Menu-bar mode is on,
313this menu has the same items as all the mode-specific menu-bar menus
314put together. Some modes may specify a different menu for this
4ad3bc2a
CY
315button. If Menu Bar mode is off, this menu contains all the items
316which would be present in the menu bar---not just the mode-specific
317ones---so that you can access them without having to display the menu
318bar.
8cf51b2c
GM
319
320@item S-Mouse-1
4fc2e5bf 321This menu is for changing the default face within the window's buffer.
d366bd53 322@xref{Text Scale}.
8cf51b2c
GM
323@end table
324
4ad3bc2a
CY
325 Some graphical applications use @kbd{Mouse-3} for a mode-specific
326menu. If you prefer @kbd{Mouse-3} in Emacs to bring up such a menu
327instead of running the @code{mouse-save-then-kill} command, rebind
328@kbd{Mouse-3} by adding the following line to your init file
329(@pxref{Init Rebinding}):
330
331@smallexample
332(global-set-key [mouse-3] 'mouse-popup-menubar-stuff)
333@end smallexample
334
8cf51b2c
GM
335@node Mode Line Mouse
336@section Mode Line Mouse Commands
337@cindex mode line, mouse
338@cindex mouse on mode line
339
340 You can use mouse clicks on window mode lines to select and manipulate
341windows.
342
7b6be833
GM
343 Some areas of the mode line, such as the buffer name, and major and minor
344mode names, have their own special mouse bindings. These areas are
8cf51b2c
GM
345highlighted when you hold the mouse over them, and information about
346the special bindings will be displayed (@pxref{Tooltips}). This
347section's commands do not apply in those areas.
348
349@table @kbd
350@item Mouse-1
351@kindex Mouse-1 @r{(mode line)}
352@kbd{Mouse-1} on a mode line selects the window it belongs to. By
353dragging @kbd{Mouse-1} on the mode line, you can move it, thus
354changing the height of the windows above and below. Changing heights
355with the mouse in this way never deletes windows, it just refuses to
356make any window smaller than the minimum height.
357
358@item Mouse-2
359@kindex Mouse-2 @r{(mode line)}
360@kbd{Mouse-2} on a mode line expands that window to fill its frame.
361
362@item Mouse-3
363@kindex Mouse-3 @r{(mode line)}
364@kbd{Mouse-3} on a mode line deletes the window it belongs to. If the
4ad3bc2a 365frame has only one window, it does nothing.
8cf51b2c
GM
366
367@item C-Mouse-2
368@kindex C-mouse-2 @r{(mode line)}
4ad3bc2a
CY
369@kbd{C-Mouse-2} on a mode line splits that window, producing two
370side-by-side windows with the boundary running through the click
371position (@pxref{Split Window}).
8cf51b2c
GM
372@end table
373
8cf51b2c 374@kindex Mouse-1 @r{(scroll bar)}
4ad3bc2a
CY
375 Furthermore, by clicking and dragging @kbd{Mouse-1} on the divider
376between two side-by-side mode lines, you can move the vertical
377boundary to the left or right.
8cf51b2c
GM
378
379@node Creating Frames
380@section Creating Frames
381@cindex creating frames
382
383@kindex C-x 5
b63a8e8e
CY
384 The prefix key @kbd{C-x 5} is analogous to @kbd{C-x 4}. Whereas
385each @kbd{C-x 4} command pops up a buffer in a different window in the
386selected frame (@pxref{Pop Up Window}), the @kbd{C-x 5} commands use a
387different frame. If an existing visible or iconified (``minimized'')
388frame already displays the requested buffer, that frame is raised and
389deiconified (``un-minimized''); otherwise, a new frame is created on
390the current display terminal.
8cf51b2c
GM
391
392 The various @kbd{C-x 5} commands differ in how they find or create the
393buffer to select:
394
395@table @kbd
396@item C-x 5 2
397@kindex C-x 5 2
398@findex make-frame-command
399Create a new frame (@code{make-frame-command}).
400@item C-x 5 b @var{bufname} @key{RET}
401Select buffer @var{bufname} in another frame. This runs
402@code{switch-to-buffer-other-frame}.
403@item C-x 5 f @var{filename} @key{RET}
404Visit file @var{filename} and select its buffer in another frame. This
405runs @code{find-file-other-frame}. @xref{Visiting}.
406@item C-x 5 d @var{directory} @key{RET}
407Select a Dired buffer for directory @var{directory} in another frame.
408This runs @code{dired-other-frame}. @xref{Dired}.
409@item C-x 5 m
410Start composing a mail message in another frame. This runs
411@code{mail-other-frame}. It is the other-frame variant of @kbd{C-x m}.
412@xref{Sending Mail}.
413@item C-x 5 .
414Find a tag in the current tag table in another frame. This runs
415@code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}.
416@xref{Tags}.
417@item C-x 5 r @var{filename} @key{RET}
418@kindex C-x 5 r
419@findex find-file-read-only-other-frame
420Visit file @var{filename} read-only, and select its buffer in another
421frame. This runs @code{find-file-read-only-other-frame}.
422@xref{Visiting}.
423@end table
424
b63a8e8e
CY
425 You can control the appearance and behavior of the newly-created
426frames by specifying @dfn{frame parameters}. @xref{Frame Parameters}.
8cf51b2c
GM
427
428@node Frame Commands
429@section Frame Commands
430
b63a8e8e 431 The following commands are used to delete and operate on frames:
8cf51b2c
GM
432
433@table @kbd
b63a8e8e
CY
434@item C-x 5 0
435@kindex C-x 5 0
436@findex delete-frame
437Delete the selected frame (@code{delete-frame}). This signals an
438error if there is only one frame.
439
8cf51b2c
GM
440@item C-z
441@kindex C-z @r{(X windows)}
8ba46c89
CY
442@findex suspend-frame
443Minimize (or ``iconify) the selected Emacs frame
444(@code{suspend-frame}). @xref{Exiting}.
8cf51b2c 445
8cf51b2c
GM
446@item C-x 5 o
447@kindex C-x 5 o
448@findex other-frame
b63a8e8e
CY
449Select another frame, and raise it. If you repeat this command, it
450cycles through all the frames on your terminal.
8cf51b2c
GM
451
452@item C-x 5 1
453@kindex C-x 5 1
454@findex delete-other-frames
16254627 455Delete all frames on the current terminal, except the selected one.
7b4ec549
TH
456
457@item M-<F10>
458@kindex M-<F10>
459@findex toggle-frame-maximized
881aae56
GM
460Toggle the maximization state of the current frame. When a frame is
461maximized, it fills the screen.
7b4ec549
TH
462
463@item <F11>
464@kindex <F11>
465@findex toggle-frame-fullscreen
881aae56
GM
466Toggle fullscreen mode for the current frame. (The difference
467between ``fullscreen'' and ``maximized'' is normally that the former
468hides window manager decorations, giving slightly more screen space to
469Emacs itself.)
8cf51b2c
GM
470@end table
471
b63a8e8e
CY
472 The @kbd{C-x 5 0} (@code{delete-frame}) command deletes the selected
473frame. However, it will refuse to delete the last frame in an Emacs
474session, to prevent you from losing the ability to interact with the
475Emacs session. Note that when Emacs is run as a daemon (@pxref{Emacs
476Server}), there is always a ``virtual frame'' that remains after all
477the ordinary, interactive frames are deleted. In this case, @kbd{C-x
4785 0} can delete the last interactive frame; you can use
479@command{emacsclient} to reconnect to the Emacs session.
480
481 The @kbd{C-x 5 1} (@code{delete-other-frames}) command deletes all
482other frames on the current terminal (this terminal refers to either a
0be641c0
CY
483graphical display, or a text terminal; @pxref{Non-Window Terminals}).
484If the Emacs session has frames open on other graphical displays or
485text terminals, those are not deleted.
16254627 486
8cf51b2c 487@vindex focus-follows-mouse
b63a8e8e
CY
488 The @kbd{C-x 5 o} (@code{other-frame}) command selects the next
489frame on the current terminal. If you are using Emacs on the X Window
490System with a window manager that selects (or @dfn{gives focus to})
491whatever frame the mouse cursor is over, you have to change the
492variable @code{focus-follows-mouse} to @code{t} in order for this
493command to work properly. Then invoking @kbd{C-x 5 o} will also warp
494the mouse cursor to the chosen frame.
8cf51b2c 495
d68eb23c
CY
496@node Fonts
497@section Fonts
498@cindex fonts
499
b63a8e8e 500 By default, Emacs displays text on graphical displays using a
13a83f05 50110-point monospace font. There are several different ways to specify
b63a8e8e 502a different font:
d68eb23c
CY
503
504@itemize
505@item
13a83f05
EZ
506Click on @samp{Set Default Font} in the @samp{Options} menu. This
507makes the selected font the default on all existing graphical frames.
508To save this for future sessions, click on @samp{Save Options} in the
d68eb23c
CY
509@samp{Options} menu.
510
511@item
fe762311
GM
512Add a line to your init file, modifying the variable
513@code{default-frame-alist} to specify the @code{font} parameter
514(@pxref{Frame Parameters}), like this:
d68eb23c 515
fe762311 516@example
166bc0c8
CY
517(add-to-list 'default-frame-alist
518 '(font . "DejaVu Sans Mono-10"))
fe762311 519@end example
d68eb23c 520
13a83f05
EZ
521@noindent
522This makes the font the default on all graphical frames created after
523restarting Emacs with that init file.
524
d68eb23c
CY
525@cindex X defaults file
526@cindex X resources file
527@item
528Add an @samp{emacs.font} X resource setting to your X resource file,
529like this:
530
fe762311 531@example
d68eb23c 532emacs.font: DejaVu Sans Mono-12
fe762311 533@end example
d68eb23c
CY
534
535@noindent
536You must restart X, or use the @command{xrdb} command, for the X
fe762311
GM
537resources file to take effect. @xref{Resources}. Do not quote
538font names in X resource files.
d68eb23c
CY
539
540@item
541If you are running Emacs on the GNOME desktop, you can tell Emacs to
542use the default system font by setting the variable
543@code{font-use-system-font} to @code{t} (the default is @code{nil}).
b63a8e8e 544For this to work, Emacs must have been compiled with Gconf support.
d68eb23c
CY
545
546@item
547Use the command line option @samp{-fn} (or @samp{--font}). @xref{Font
548X}.
549@end itemize
550
b63a8e8e
CY
551 To check what font you're currently using, the @kbd{C-u C-x =}
552command can be helpful. It describes the character at point, and
553names the font that it's rendered in.
6e560c71 554
d68eb23c
CY
555@cindex fontconfig
556 On X, there are four different ways to express a ``font name''. The
557first is to use a @dfn{Fontconfig pattern}. Fontconfig patterns have
558the following form:
559
fe762311 560@example
d68eb23c 561@var{fontname}[-@var{fontsize}][:@var{name1}=@var{values1}][:@var{name2}=@var{values2}]...
fe762311 562@end example
d68eb23c
CY
563
564@noindent
565Within this format, any of the elements in braces may be omitted.
566Here, @var{fontname} is the @dfn{family name} of the font, such as
b63a8e8e 567@samp{Monospace} or @samp{DejaVu Sans Mono}; @var{fontsize} is the
d68eb23c
CY
568@dfn{point size} of the font (one @dfn{printer's point} is about 1/72
569of an inch); and the @samp{@var{name}=@var{values}} entries specify
570settings such as the slant and weight of the font. Each @var{values}
571may be a single value, or a list of values separated by commas. In
572addition, some property values are valid with only one kind of
573property name, in which case the @samp{@var{name}=} part may be
574omitted.
575
576Here is a list of common font properties:
577
578@table @samp
579@item slant
b63a8e8e 580One of @samp{italic}, @samp{oblique}, or @samp{roman}.
d68eb23c
CY
581
582@item weight
583One of @samp{light}, @samp{medium}, @samp{demibold}, @samp{bold} or
584@samp{black}.
585
586@item style
587Some fonts define special styles which are a combination of slant and
588weight. For instance, @samp{Dejavu Sans} defines the @samp{book}
589style, which overrides the slant and weight properties.
590
591@item width
592One of @samp{condensed}, @samp{normal}, or @samp{expanded}.
593
594@item spacing
595One of @samp{monospace}, @samp{proportional}, @samp{dual-width}, or
596@samp{charcell}.
597@end table
598
599@noindent
600Here are some examples of Fontconfig patterns:
601
fe762311 602@example
d68eb23c
CY
603Monospace
604Monospace-12
605Monospace-12:bold
606DejaVu Sans Mono:bold:italic
607Monospace-12:weight=bold:slant=italic
fe762311 608@end example
d68eb23c 609
ae742cb5
CY
610For a more detailed description of Fontconfig patterns, see the
611Fontconfig manual, which is distributed with Fontconfig and available
612online at @url{http://fontconfig.org/fontconfig-user.html}.
d68eb23c 613
b63a8e8e
CY
614@cindex GTK font pattern
615 The second way to specify a font is to use a @dfn{GTK font pattern}.
616These have the syntax
d68eb23c 617
fe762311 618@example
d68eb23c 619@var{fontname} [@var{properties}] [@var{fontsize}]
fe762311 620@end example
d68eb23c
CY
621
622@noindent
623where @var{fontname} is the family name, @var{properties} is a list of
624property values separated by spaces, and @var{fontsize} is the point
b63a8e8e
CY
625size. The properties that you may specify for GTK font patterns are
626as follows:
d68eb23c 627
b63a8e8e
CY
628@itemize
629@item
630Slant properties: @samp{Italic} or @samp{Oblique}. If omitted, the
631default (roman) slant is implied.
632@item
633Weight properties: @samp{Bold}, @samp{Book}, @samp{Light},
634@samp{Medium}, @samp{Semi-bold}, or @samp{Ultra-light}. If omitted,
635@samp{Medium} weight is implied.
636@item
637Width properties: @samp{Semi-Condensed} or @samp{Condensed}. If
638omitted, a default width is used.
639@end itemize
d68eb23c
CY
640
641@noindent
b63a8e8e 642Here are some examples of GTK font patterns:
d68eb23c 643
fe762311 644@example
d68eb23c
CY
645Monospace 12
646Monospace Bold Italic 12
fe762311 647@end example
d68eb23c
CY
648
649@cindex XLFD
650@cindex X Logical Font Description
651 The third way to specify a font is to use an @dfn{XLFD} (@dfn{X
652Logical Font Description}). This is the traditional method for
1df7defd 653specifying fonts under X@. Each XLFD consists of fourteen words or
d68eb23c
CY
654numbers, separated by dashes, like this:
655
fe762311 656@example
d68eb23c 657-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
fe762311 658@end example
d68eb23c
CY
659
660@noindent
661A wildcard character (@samp{*}) in an XLFD matches any sequence of
662characters (including none), and @samp{?} matches any single
663character. However, matching is implementation-dependent, and can be
664inaccurate when wildcards match dashes in a long name. For reliable
665results, supply all 14 dashes and use wildcards only within a field.
1df7defd 666Case is insignificant in an XLFD@. The syntax for an XLFD is as
d68eb23c
CY
667follows:
668
fe762311 669@example
d68eb23c
CY
670-@var{maker}-@var{family}-@var{weight}-@var{slant}-@var{widthtype}-@var{style}@dots{}
671@dots{}-@var{pixels}-@var{height}-@var{horiz}-@var{vert}-@var{spacing}-@var{width}-@var{registry}-@var{encoding}
fe762311 672@end example
d68eb23c
CY
673
674@noindent
675The entries have the following meanings:
676
677@table @var
678@item maker
679The name of the font manufacturer.
680@item family
1df7defd 681The name of the font family (e.g., @samp{courier}).
d68eb23c
CY
682@item weight
683The font weight---normally either @samp{bold}, @samp{medium} or
684@samp{light}. Some font names support other values.
685@item slant
686The font slant---normally @samp{r} (roman), @samp{i} (italic),
687@samp{o} (oblique), @samp{ri} (reverse italic), or @samp{ot} (other).
688Some font names support other values.
689@item widthtype
ae742cb5 690The font width---normally @samp{normal}, @samp{condensed},
9eb25ee8
GM
691@samp{semicondensed}, or @samp{extended}. Some font names support
692other values.
d68eb23c 693@item style
b63a8e8e
CY
694An optional additional style name. Usually it is empty---most XLFDs
695have two hyphens in a row at this point.
d68eb23c
CY
696@item pixels
697The font height, in pixels.
698@item height
699The font height on the screen, measured in tenths of a printer's
700point. This is the point size of the font, times ten. For a given
701vertical resolution, @var{height} and @var{pixels} are proportional;
702therefore, it is common to specify just one of them and use @samp{*}
703for the other.
704@item horiz
705The horizontal resolution, in pixels per inch, of the screen for which
706the font is intended.
707@item vert
708The vertical resolution, in pixels per inch, of the screen for which
709the font is intended. Normally the resolution of the fonts on your
710system is the right value for your screen; therefore, you normally
711specify @samp{*} for this and @var{horiz}.
712@item spacing
713This is @samp{m} (monospace), @samp{p} (proportional) or @samp{c}
714(character cell).
715@item width
716The average character width, in pixels, multiplied by ten.
717@item registry
718@itemx encoding
719The X font character set that the font depicts. (X font character
720sets are not the same as Emacs character sets, but they are similar.)
721You can use the @command{xfontsel} program to check which choices you
722have. Normally you should use @samp{iso8859} for @var{registry} and
723@samp{1} for @var{encoding}.
724@end table
725
726 The fourth and final method of specifying a font is to use a ``font
727nickname''. Certain fonts have shorter nicknames, which you can use
728instead of a normal font specification. For instance, @samp{6x13} is
729equivalent to
730
fe762311 731@example
d68eb23c 732-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1
fe762311 733@end example
d68eb23c
CY
734
735@cindex client-side fonts
736@cindex server-side fonts
737 On X, Emacs recognizes two types of fonts: @dfn{client-side} fonts,
738which are provided by the Xft and Fontconfig libraries, and
739@dfn{server-side} fonts, which are provided by the X server itself.
740Most client-side fonts support advanced font features such as
741antialiasing and subpixel hinting, while server-side fonts do not.
742Fontconfig and GTK patterns match only client-side fonts.
743
744@cindex listing system fonts
745 You will probably want to use a fixed-width default font---that is,
746a font in which all characters have the same width. For Xft and
747Fontconfig fonts, you can use the @command{fc-list} command to list
748the available fixed-width fonts, like this:
749
750@example
751fc-list :spacing=mono fc-list :spacing=charcell
752@end example
753
754@noindent
755For server-side X fonts, you can use the @command{xlsfonts} program to
756list the available fixed-width fonts, like this:
757
758@example
759xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+"
760xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
761xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'
762@end example
763
764@noindent
765Any font with @samp{m} or @samp{c} in the @var{spacing} field of the
766XLFD is a fixed-width font. To see what a particular font looks like,
767use the @command{xfd} command. For example:
768
769@example
770xfd -fn 6x13
771@end example
772
773@noindent
774displays the entire font @samp{6x13}.
775
776 While running Emacs, you can also set the font of a specific kind of
777text (@pxref{Faces}), or a particular frame (@pxref{Frame
778Parameters}).
779
8cf51b2c
GM
780@node Speedbar
781@section Speedbar Frames
782@cindex speedbar
783
784@cindex attached frame (of speedbar)
785 The @dfn{speedbar} is a special frame for conveniently navigating in
786or operating on another frame. The speedbar, when it exists, is
787always associated with a specific frame, called its @dfn{attached
788frame}; all speedbar operations act on that frame.
789
790 Type @kbd{M-x speedbar} to create the speedbar and associate it with
791the current frame. To dismiss the speedbar, type @kbd{M-x speedbar}
792again, or select the speedbar and type @kbd{q}. (You can also delete
793the speedbar frame like any other Emacs frame.) If you wish to
794associate the speedbar with a different frame, dismiss it and call
795@kbd{M-x speedbar} from that frame.
796
797 The speedbar can operate in various modes. Its default mode is
798@dfn{File Display} mode, which shows the files in the current
799directory of the selected window of the attached frame, one file per
800line. Clicking on a file name visits that file in the selected window
801of the attached frame, and clicking on a directory name shows that
802directory in the speedbar (@pxref{Mouse References}). Each line also
803has a box, @samp{[+]} or @samp{<+>}, that you can click on to
804@dfn{expand} the contents of that item. Expanding a directory adds
805the contents of that directory to the speedbar display, underneath the
806directory's own line. Expanding an ordinary file adds a list of the
807tags in that file to the speedbar display; you can click on a tag name
808to jump to that tag in the selected window of the attached frame.
809When a file or directory is expanded, the @samp{[+]} changes to
810@samp{[-]}; you can click on that box to @dfn{contract} the item,
811hiding its contents.
812
813 You navigate through the speedbar using the keyboard, too. Typing
d7e9a7f8
EZ
814@key{RET} while point is on a line in the speedbar is equivalent to
815clicking the item on the current line, and @key{SPC} expands or
8cf51b2c
GM
816contracts the item. @kbd{U} displays the parent directory of the
817current directory. To copy, delete, or rename the file on the current
818line, type @kbd{C}, @kbd{D}, and @kbd{R} respectively. To create a
819new directory, type @kbd{M}.
820
821 Another general-purpose speedbar mode is @dfn{Buffer Display} mode;
822in this mode, the speedbar displays a list of Emacs buffers. To
823switch to this mode, type @kbd{b} in the speedbar. To return to File
824Display mode, type @kbd{f}. You can also change the display mode by
825clicking @kbd{mouse-3} anywhere in the speedbar window (or
826@kbd{mouse-1} on the mode-line) and selecting @samp{Displays} in the
827pop-up menu.
828
829 Some major modes, including Rmail mode, Info, and GUD, have
830specialized ways of putting useful items into the speedbar for you to
831select. For example, in Rmail mode, the speedbar shows a list of Rmail
832files, and lets you move the current message to another Rmail file by
833clicking on its @samp{<M>} box.
834
835 For more details on using and programming the speedbar, @xref{Top,
836Speedbar,,speedbar, Speedbar Manual}.
837
838@node Multiple Displays
839@section Multiple Displays
840@cindex multiple displays
841
842 A single Emacs can talk to more than one X display. Initially, Emacs
843uses just one display---the one specified with the @env{DISPLAY}
844environment variable or with the @samp{--display} option (@pxref{Initial
845Options}). To connect to another display, use the command
846@code{make-frame-on-display}:
847
848@findex make-frame-on-display
849@table @kbd
850@item M-x make-frame-on-display @key{RET} @var{display} @key{RET}
851Create a new frame on display @var{display}.
852@end table
853
854 A single X server can handle more than one screen. When you open
855frames on two screens belonging to one server, Emacs knows they share a
856single keyboard, and it treats all the commands arriving from these
857screens as a single stream of input.
858
859 When you open frames on different X servers, Emacs makes a separate
4fc2e5bf
CY
860input stream for each server. Each server also has its own selected
861frame. The commands you enter with a particular X server apply to
862that server's selected frame.
8cf51b2c 863
b63a8e8e
CY
864@node Frame Parameters
865@section Frame Parameters
866@cindex default-frame-alist
8cf51b2c 867
b63a8e8e
CY
868 You can control the default appearance and behavior of all frames by
869specifying a default list of @dfn{frame parameters} in the variable
870@code{default-frame-alist}. Its value should be a list of entries,
871each specifying a parameter name and a value for that parameter.
872These entries take effect whenever Emacs creates a new frame,
873including the initial frame.
8cf51b2c 874
b63a8e8e
CY
875@cindex frame size, specifying default
876 For example, you can add the following lines to your init file
877(@pxref{Init File}) to set the default frame width to 90 character
878columns, the default frame height to 40 character rows, and the
879default font to @samp{Monospace-10}:
8cf51b2c
GM
880
881@example
b63a8e8e
CY
882(add-to-list 'default-frame-alist '(width . 90))
883(add-to-list 'default-frame-alist '(height . 40))
884(add-to-list 'default-frame-alist '(font . "Monospace-10"))
8cf51b2c
GM
885@end example
886
b63a8e8e
CY
887 For a list of frame parameters and their effects, see @ref{Frame
888Parameters,,, elisp, The Emacs Lisp Reference Manual}.
8cf51b2c 889
b63a8e8e
CY
890@cindex initial-frame-alist
891 You can also specify a list of frame parameters which apply to just
892the initial frame, by customizing the variable
893@code{initial-frame-alist}.
8cf51b2c 894
b63a8e8e
CY
895 If Emacs is compiled to use an X toolkit, frame parameters that
896specify colors and fonts don't affect menus and the menu bar, since
897those are drawn by the toolkit and not directly by Emacs.
8cf51b2c
GM
898
899@node Scroll Bars
900@section Scroll Bars
901@cindex Scroll Bar mode
902@cindex mode, Scroll Bar
903
da97a9e6
CY
904 On graphical displays, there is a @dfn{scroll bar} on the side of
905each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's up and
906down buttons scrolls the window by one line at a time. Clicking
907@kbd{Mouse-1} above or below the scroll bar's inner box scrolls the
908window by nearly the entire height of the window, like @kbd{M-v} and
909@kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box
910scrolls continuously.
911
912 If Emacs is compiled on the X Window System without X toolkit
913support, the scroll bar behaves differently. Clicking @kbd{Mouse-1}
914anywhere on the scroll bar scrolls forward like @kbd{C-v}, while
915@kbd{Mouse-3} scrolls backward like @kbd{M-v}. Clicking @kbd{Mouse-2}
916in the scroll bar lets you drag the inner box up and down.
8cf51b2c
GM
917
918@findex scroll-bar-mode
8cf51b2c 919@findex toggle-scroll-bar
da97a9e6
CY
920 To toggle the use of scroll bars, type @kbd{M-x scroll-bar-mode}.
921This command applies to all frames, including frames yet to be
922created. To toggle scroll bars for just the selected frame, use the
8cf51b2c
GM
923command @kbd{M-x toggle-scroll-bar}.
924
da97a9e6
CY
925@vindex scroll-bar-mode
926 To control the use of scroll bars at startup, customize the variable
927@code{scroll-bar-mode}. Its value should be either @code{right} (put
928scroll bars on the right side of windows), @code{left} (put them on
929the left), or @code{nil} (disable scroll bars). By default, Emacs
930puts scroll bars on the right if it was compiled with GTK+ support on
931the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll
870e8fb8 932bars on the left if compiled on the X Window System without GTK+
da97a9e6
CY
933support (following the old convention for X applications).
934
8cf51b2c
GM
935@vindex scroll-bar-width
936@cindex width of the scroll bar
da97a9e6
CY
937 You can also use the X resource @samp{verticalScrollBars} to enable
938or disable the scroll bars (@pxref{Resources}). To control the scroll
939bar width, change the @code{scroll-bar-width} frame parameter
940(@pxref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}).
8cf51b2c 941
daef8ab1
XF
942@vindex scroll-bar-adjust-thumb-portion
943@cindex overscrolling
944If you're using Emacs on X (with GTK+ or Motif), you can customize the
945variable @code{scroll-bar-adjust-thumb-portion} to control
946@dfn{overscrolling} of the scroll bar, i.e. dragging the thumb down even
947when the end of the buffer is visible. If its value is
948non-@code{nil}, the scroll bar can be dragged downwards even if the
949end of the buffer is shown; if @code{nil}, the thumb will be at the
950bottom when the end of the buffer is shown. You can not over-scroll
951when the entire buffer is visible.
952
8cf51b2c
GM
953@node Drag and Drop
954@section Drag and Drop
955@cindex drag and drop
956
b63a8e8e
CY
957 In most graphical desktop environments, Emacs has basic support for
958@dfn{drag and drop} operations. For instance, dropping text onto an
959Emacs frame inserts the text where it is dropped. Dropping a file
960onto an Emacs frame visits that file. As a special case, dropping the
961file on a Dired buffer moves or copies the file (according to the
962conventions of the application it came from) into the directory
963displayed in that buffer.
8cf51b2c
GM
964
965@vindex dnd-open-file-other-window
966 Dropping a file normally visits it in the window you drop it on. If
967you prefer to visit the file in a new window in such cases, customize
968the variable @code{dnd-open-file-other-window}.
969
970 The XDND and Motif drag and drop protocols, and the old KDE 1.x
971protocol, are currently supported.
972
973@node Menu Bars
974@section Menu Bars
975@cindex Menu Bar mode
976@cindex mode, Menu Bar
977@findex menu-bar-mode
978@vindex menu-bar-mode
979
b63a8e8e
CY
980 You can toggle the use of menu bars with @kbd{M-x menu-bar-mode}.
981With no argument, this command toggles Menu Bar mode, a global minor
982mode. With an argument, the command turns Menu Bar mode on if the
983argument is positive, off if the argument is not positive. To control
984the use of menu bars at startup, customize the variable
985@code{menu-bar-mode}.
8cf51b2c
GM
986
987@kindex C-Mouse-3 @r{(when menu bar is disabled)}
0be641c0 988 Expert users often turn off the menu bar, especially on text
8cf51b2c
GM
989terminals, where this makes one additional line available for text.
990If the menu bar is off, you can still pop up a menu of its contents
991with @kbd{C-Mouse-3} on a display which supports pop-up menus.
992@xref{Menu Mouse Clicks}.
993
994 @xref{Menu Bar}, for information on how to invoke commands with the
995menu bar. @xref{X Resources}, for how to customize the menu bar
996menus' visual appearance.
997
998@node Tool Bars
999@section Tool Bars
1000@cindex Tool Bar mode
1001@cindex mode, Tool Bar
1002@cindex icons, toolbar
1003
da97a9e6
CY
1004 On graphical displays, Emacs puts a @dfn{tool bar} at the top of
1005each frame, just below the menu bar. This is a row of icons which you
1006can click on with the mouse to invoke various commands.
8cf51b2c 1007
da97a9e6
CY
1008 The global (default) tool bar contains general commands. Some major
1009modes define their own tool bars; whenever a buffer with such a major
1010mode is current, the mode's tool bar replaces the global tool bar.
8cf51b2c
GM
1011
1012@findex tool-bar-mode
1013@vindex tool-bar-mode
da97a9e6
CY
1014 To toggle the use of tool bars, type @kbd{M-x tool-bar-mode}. This
1015command applies to all frames, including frames yet to be created. To
1016control the use of tool bars at startup, customize the variable
1017@code{tool-bar-mode}.
8cf51b2c 1018
20fe03ad
JD
1019@vindex tool-bar-style
1020@cindex Tool Bar style
da97a9e6
CY
1021 When Emacs is compiled with GTK+ support, each tool bar item can
1022consist of an image, or a text label, or both. By default, Emacs
1023follows the Gnome desktop's tool bar style setting; if none is
1024defined, it displays tool bar items as just images. To impose a
1025specific tool bar style, customize the variable @code{tool-bar-style}.
20fe03ad 1026
8b2dd508 1027@cindex Tool Bar position
da97a9e6
CY
1028 You can also control the placement of the tool bar for the GTK+ tool
1029bar with the frame parameter @code{tool-bar-position}. @xref{Frame
1030Parameters,,, elisp, The Emacs Lisp Reference Manual}.
8b2dd508 1031
8cf51b2c
GM
1032@node Dialog Boxes
1033@section Using Dialog Boxes
1034@cindex dialog boxes
1035
1036@vindex use-dialog-box
1037 A dialog box is a special kind of menu for asking you a yes-or-no
1038question or some other special question. Many Emacs commands use a
1039dialog box to ask a yes-or-no question, if you used the mouse to
c5c040a7 1040invoke the command that led to the question.
8cf51b2c 1041
c5c040a7
CY
1042 To disable the use of dialog boxes, change the variable
1043@code{use-dialog-box} to @code{nil}. In that case, Emacs always
1044performs yes-or-no prompts using the echo area and keyboard input.
1045This variable also controls whether to use file selection windows (but
1046those are not supported on all platforms).
8cf51b2c
GM
1047
1048@vindex use-file-dialog
9c5e9396 1049@cindex file selection dialog, how to disable
8cf51b2c
GM
1050 A file selection window is a special kind of dialog box for asking
1051for file names. You can customize the variable @code{use-file-dialog}
1052to suppress the use of file selection windows, even if you still want
1053other kinds of dialogs. This variable has no effect if you have
1054suppressed all dialog boxes with the variable @code{use-dialog-box}.
1055
1056@vindex x-gtk-show-hidden-files
8cf51b2c 1057@vindex x-gtk-file-dialog-help-text
9c5e9396
EZ
1058@cindex hidden files, in GTK+ file chooser
1059@cindex help text, in GTK+ file chooser
c5c040a7
CY
1060 When Emacs is compiled with GTK+ support, it uses the GTK+ ``file
1061chooser'' dialog. Emacs adds an additional toggle button to this
1062dialog, which you can use to enable or disable the display of hidden
1063files (files starting with a dot) in that dialog. If you want this
1064toggle to be activated by default, change the variable
1065@code{x-gtk-show-hidden-files} to @code{t}. In addition, Emacs adds
1066help text to the GTK+ file chooser dialog; to disable this help text,
1067change the variable @code{x-gtk-file-dialog-help-text} to @code{nil}.
1068
8cf51b2c
GM
1069@node Tooltips
1070@section Tooltips
1071@cindex tooltips
1072
b63a8e8e
CY
1073 @dfn{Tooltips} are small windows that display text information at
1074the current mouse position. They activate when there is a pause in
1075mouse movement over some significant piece of text in a window, or the
1076mode line, or some other part of the Emacs frame such as a tool bar
1077button or menu item.
8cf51b2c
GM
1078
1079@findex tooltip-mode
b63a8e8e
CY
1080 You can toggle the use of tooltips with the command @kbd{M-x
1081tooltip-mode}. When Tooltip mode is disabled, the help text is
1082displayed in the echo area instead. To control the use of tooltips at
1083startup, customize the variable @code{tooltip-mode}.
8cf51b2c
GM
1084
1085@vindex tooltip-delay
1086 The variables @code{tooltip-delay} specifies how long Emacs should
1087wait before displaying a tooltip. For additional customization
1088options for displaying tooltips, use @kbd{M-x customize-group
b63a8e8e 1089@key{RET} tooltip @key{RET}}.
8cf51b2c 1090
d366bd53 1091@vindex x-gtk-use-system-tooltips
da97a9e6
CY
1092 If Emacs is built with GTK+ support, it displays tooltips via GTK+,
1093using the default appearance of GTK+ tooltips. To disable this,
1094change the variable @code{x-gtk-use-system-tooltips} to @code{nil}.
b63a8e8e
CY
1095If you do this, or if Emacs is built without GTK+ support, most
1096attributes of the tooltip text are specified by the @code{tooltip}
1097face, and by X resources (@pxref{X Resources}).
1098
1099 @dfn{GUD tooltips} are special tooltips that show the values of
1df7defd 1100variables when debugging a program with GUD@. @xref{Debugger
b63a8e8e 1101Operation}.
d366bd53 1102
8cf51b2c
GM
1103@node Mouse Avoidance
1104@section Mouse Avoidance
1105@cindex avoiding mouse in the way of your typing
1106@cindex mouse avoidance
1107
b4a1a8b2
CY
1108 On graphical terminals, the mouse pointer may obscure the text in
1109the Emacs frame. Emacs provides two methods to avoid this problem.
1110
1111@vindex make-pointer-invisible
1112 Firstly, Emacs hides the mouse pointer each time you type a
1113self-inserting character, if the pointer lies inside an Emacs frame;
1114moving the mouse pointer makes it visible again. To disable this
1115feature, set the variable @code{make-pointer-invisible} to @code{nil}.
1116
8cf51b2c 1117@vindex mouse-avoidance-mode
b4a1a8b2
CY
1118 Secondly, you can use Mouse Avoidance mode, a minor mode, to keep
1119the mouse pointer away from point. To use Mouse Avoidance mode,
1120customize the variable @code{mouse-avoidance-mode}. You can set this
1121to various values to move the mouse in several ways:
8cf51b2c
GM
1122
1123@table @code
1124@item banish
05b621a6
CY
1125Move the pointer to a corner of the frame on any key-press. You can
1126customize the variable @code{mouse-avoidance-banish-position} to
1127specify where the pointer goes when it is banished.
8cf51b2c 1128@item exile
05b621a6
CY
1129Banish the pointer only if the cursor gets too close, and allow it to
1130return once the cursor is out of the way.
8cf51b2c 1131@item jump
05b621a6
CY
1132If the cursor gets too close to the pointer, displace the pointer by a
1133random distance and direction.
8cf51b2c 1134@item animate
05b621a6 1135As @code{jump}, but shows steps along the way for illusion of motion.
8cf51b2c 1136@item cat-and-mouse
05b621a6 1137The same as @code{animate}.
8cf51b2c
GM
1138@item proteus
1139As @code{animate}, but changes the shape of the mouse pointer too.
1140@end table
1141
1142@findex mouse-avoidance-mode
1143You can also use the command @kbd{M-x mouse-avoidance-mode} to enable
b4a1a8b2
CY
1144the mode. Whenever Mouse Avoidance mode moves the mouse, it also
1145raises the frame.
8cf51b2c
GM
1146
1147@node Non-Window Terminals
1148@section Non-Window Terminals
0be641c0 1149@cindex text terminal
8cf51b2c 1150
0be641c0 1151 On a text terminal, Emacs can display only one Emacs frame at a
8cf51b2c
GM
1152time. However, you can still create multiple Emacs frames, and switch
1153between them. Switching frames on these terminals is much like
1154switching between different window configurations.
1155
1156 Use @kbd{C-x 5 2} to create a new frame and switch to it; use @kbd{C-x
11575 o} to cycle through the existing frames; use @kbd{C-x 5 0} to delete
1158the current frame.
1159
1160 Each frame has a number to distinguish it. If your terminal can
1161display only one frame at a time, the selected frame's number @var{n}
1162appears near the beginning of the mode line, in the form
1163@samp{F@var{n}}.
1164
1165@findex set-frame-name
1166@findex select-frame-by-name
1167 @samp{F@var{n}} is in fact the frame's initial name. You can give
1168frames more meaningful names if you wish, and you can select a frame
1169by its name. Use the command @kbd{M-x set-frame-name @key{RET}
1170@var{name} @key{RET}} to specify a new name for the selected frame,
1171and use @kbd{M-x select-frame-by-name @key{RET} @var{name} @key{RET}}
1172to select a frame according to its name. The name you specify appears
1173in the mode line when the frame is selected.
1174
1175@node Text-Only Mouse
0be641c0 1176@section Using a Mouse in Text Terminals
8cf51b2c
GM
1177@cindex mouse support
1178@cindex terminal emulators, mouse support
1179
0be641c0 1180Some text terminals support mouse clicks in the terminal window.
8cf51b2c
GM
1181
1182@cindex xterm
b63a8e8e
CY
1183 In a terminal emulator which is compatible with @command{xterm}, you
1184can use @kbd{M-x xterm-mouse-mode} to give Emacs control over simple
1185uses of the mouse---basically, only non-modified single clicks are
1186supported. The normal @command{xterm} mouse functionality for such
8cf51b2c
GM
1187clicks is still available by holding down the @kbd{SHIFT} key when you
1188press the mouse button. Xterm Mouse mode is a global minor mode
1189(@pxref{Minor Modes}). Repeating the command turns the mode off
1190again.
1191
bc36ad1c 1192@findex gpm-mouse-mode
b63a8e8e
CY
1193 In the console on GNU/Linux, you can use @kbd{M-x gpm-mouse-mode} to
1194enable mouse support. You must have the gpm server installed and
1195running on your system in order for this to work.
1196
1197@iftex
430e2ae6 1198@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features},
b63a8e8e
CY
1199@end iftex
1200@ifnottex
430e2ae6 1201@xref{MS-DOS Mouse},
b63a8e8e
CY
1202@end ifnottex
1203for information about mouse support on MS-DOS.