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