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