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