(socket_status): New function.
[bpt/emacs.git] / man / frames.texi
CommitLineData
6bf7aab6 1@c This is part of the Emacs manual.
70c88b57 2@c Copyright (C) 1985, 86, 87, 93-95, 97, 99, 2000 Free Software Foundation, Inc.
6bf7aab6
DL
3@c See file emacs.texi for copying conditions.
4@node Frames, International, Windows, Top
5@chapter Frames and X Windows
6@cindex frames
7
8 When using the X Window System, you can create multiple windows at the
9X level in a single Emacs session. Each X window that belongs to Emacs
10displays a @dfn{frame} which can contain one or several Emacs windows.
11A frame initially contains a single general-purpose Emacs window which
12you can subdivide vertically or horizontally into smaller windows. A
13frame normally contains its own echo area and minibuffer, but you can
14make frames that don't have these---they use the echo area and
15minibuffer of another frame.
16
17 Editing you do in one frame also affects the other frames. For
18instance, if you put text in the kill ring in one frame, you can yank it
19in another frame. If you exit Emacs through @kbd{C-x C-c} in one frame,
20it terminates all the frames. To delete just one frame, use @kbd{C-x 5
210}.
22
23 To avoid confusion, we reserve the word ``window'' for the
24subdivisions that Emacs implements, and never use it to refer to a
25frame.
26
27 Emacs compiled for MS-DOS emulates some aspects of the window system
28so that you can use many of the features described in this chapter.
29@xref{MS-DOS Input}, for more information.
30
70c88b57
DL
31@cindex MS Windows
32 Emacs compiled for MS Windows mostly supports the same features as
33under X.
34
35Features which rely on text in multiple faces (such as Font Lock mode)
36will also work on non-windowed terminals that can display more than one
37face, whether by colors or underlining and emboldening, such as the
38Linux console. Emacs determines automatically whether the terminal has
39such support.
40
6bf7aab6
DL
41@menu
42* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
43* Secondary Selection:: Cutting without altering point and mark.
44* Mouse References:: Using the mouse to select an item from a list.
45* Menu Mouse Clicks:: Mouse clicks that bring up menus.
46* Mode Line Mouse:: Mouse clicks on the mode line.
47* Speedbar:: How to make and use a speedbar frame.
48* Creating Frames:: Creating additional Emacs frames with various contents.
49* Multiple Displays:: How one Emacs job can talk to several displays.
50* Special Buffer Frames:: You can make certain buffers have their own frames.
51* Frame Parameters:: Changing the colors and other modes of frames.
52* Scroll Bars:: How to enable and disable scroll bars; how to use them.
70c88b57 53* Wheeled Mice:: Using mouse wheels for scrolling.
6bf7aab6 54* Menu Bars:: Enabling and disabling the menu bar.
70c88b57
DL
55@c * Tool Bars:: Enabling and disabling the tool bar.
56* Dialog Boxes:: Controlling use of dialog boxes.
6bf7aab6
DL
57* Faces:: How to change the display style using faces.
58* Font Lock:: Minor mode for syntactic highlighting using faces.
59* Support Modes:: Font Lock support modes make Font Lock faster.
60* Highlight Changes:: Using colors to show where you changed the buffer.
70c88b57
DL
61* Trailing Whitespace:: Showing possibly-spurious trailing whitespace.
62* Tooltips:: Showing `tooltips', AKA `ballon help' for active text.
63* Misc X:: Iconifying and deleting frames.
6bf7aab6 64* Non-Window Terminals:: Multiple frames on terminals that show only one.
70c88b57 65* XTerm Mouse:: Using the mouse in an XTerm terminal emulator.
6bf7aab6
DL
66@end menu
67
68@node Mouse Commands
69@section Mouse Commands for Editing
70@cindex mouse buttons (what they do)
71
72 The mouse commands for selecting and copying a region are mostly
73compatible with the @code{xterm} program. You can use the same mouse
74commands for copying between Emacs and other X client programs.
75
76@kindex DELETE
77 If you select a region with any of these mouse commands, and then
78immediately afterward type the @key{DELETE} function key, it deletes the
79region that you selected. The @key{BACKSPACE} function key and the
80ASCII character @key{DEL} do not do this; if you type any other key
81in between the mouse command and @key{DELETE}, it does not do this.
82
83@findex mouse-set-region
84@findex mouse-set-point
85@findex mouse-yank-at-click
86@findex mouse-save-then-click
87@kindex Mouse-1
88@kindex Mouse-2
89@kindex Mouse-3
90@table @kbd
91@item Mouse-1
92Move point to where you click (@code{mouse-set-point}).
93This is normally the left button.
94
95@item Drag-Mouse-1
96Set the region to the text you select by dragging, and copy it to the
97kill ring (@code{mouse-set-region}). You can specify both ends of the
98region with this single command.
99
100@vindex mouse-scroll-min-lines
101If you move the mouse off the top or bottom of the window while
102dragging, the window scrolls at a steady rate until you move the mouse
103back into the window. This way, you can select regions that don't fit
104entirely on the screen. The number of lines scrolled per step depends
105on how far away from the window edge the mouse has gone; the variable
106@code{mouse-scroll-min-lines} specifies a minimum step size.
107
108@item Mouse-2
109Yank the last killed text, where you click (@code{mouse-yank-at-click}).
110This is normally the middle button.
111
112@item Mouse-3
113This command, @code{mouse-save-then-kill}, has several functions
114depending on where you click and the status of the region.
115
116The most basic case is when you click @kbd{Mouse-1} in one place and
117then @kbd{Mouse-3} in another. This selects the text between those two
118positions as the region. It also copies the new region to the kill
119ring, so that you can copy it to someplace else.
120
121If you click @kbd{Mouse-1} in the text, scroll with the scroll bar, and
122then click @kbd{Mouse-3}, it remembers where point was before scrolling
123(where you put it with @kbd{Mouse-1}), and uses that position as the
124other end of the region. This is so that you can select a region that
125doesn't fit entirely on the screen.
126
127More generally, if you do not have a highlighted region, @kbd{Mouse-3}
128selects the text between point and the click position as the region. It
129does this by setting the mark where point was, and moving point to where
130you click.
131
132If you have a highlighted region, or if the region was set just before
133by dragging button 1, @kbd{Mouse-3} adjusts the nearer end of the region
134by moving it to where you click. The adjusted region's text also
135replaces the old region's text in the kill ring.
136
137If you originally specified the region using a double or triple
138@kbd{Mouse-1}, so that the region is defined to consist of entire words
139or lines, then adjusting the region with @kbd{Mouse-3} also proceeds by
140entire words or lines.
141
142If you use @kbd{Mouse-3} a second time consecutively, at the same place,
143that kills the region already selected.
144
145@item Double-Mouse-1
146This key sets the region around the word which you click on. If you
147click on a character with ``symbol'' syntax (such as underscore, in C
148mode), it sets the region around the symbol surrounding that character.
149
150If you click on a character with open-parenthesis or close-parenthesis
151syntax, it sets the region around the parenthetical grouping (sexp)
152which that character starts or ends. If you click on a character with
153string-delimiter syntax (such as a singlequote or doublequote in C), it
154sets the region around the string constant (using heuristics to figure
155out whether that character is the beginning or the end of it).
156
157@item Double-Drag-Mouse-1
158This key selects a region made up of the words you drag across.
159
160@item Triple-Mouse-1
161This key sets the region around the line you click on.
162
163@item Triple-Drag-Mouse-1
164This key selects a region made up of the lines you drag across.
165@end table
166
167 The simplest way to kill text with the mouse is to press @kbd{Mouse-1}
168at one end, then press @kbd{Mouse-3} twice at the other end.
169@xref{Killing}. To copy the text into the kill ring without deleting it
170from the buffer, press @kbd{Mouse-3} just once---or just drag across the
171text with @kbd{Mouse-1}. Then you can copy it elsewhere by yanking it.
172
173@vindex mouse-yank-at-point
174 To yank the killed or copied text somewhere else, move the mouse there
175and press @kbd{Mouse-2}. @xref{Yanking}. However, if
176@code{mouse-yank-at-point} is non-@code{nil}, @kbd{Mouse-2} yanks at
177point. Then it does not matter where you click, or even which of the
178frame's windows you click on. The default value is @code{nil}. This
179variable also affects yanking the secondary selection.
180
181@cindex cutting and X
182@cindex pasting and X
183@cindex X cutting and pasting
184 To copy text to another X window, kill it or save it in the kill ring.
185Under X, this also sets the @dfn{primary selection}. Then use the
186``paste'' or ``yank'' command of the program operating the other window
187to insert the text from the selection.
188
189 To copy text from another X window, use the ``cut'' or ``copy'' command
190of the program operating the other window, to select the text you want.
191Then yank it in Emacs with @kbd{C-y} or @kbd{Mouse-2}.
192
193 These cutting and pasting commands also work on MS-Windows.
194
195@cindex primary selection
196@cindex cut buffer
197@cindex selection, primary
198@vindex x-cut-buffer-max
199 When Emacs puts text into the kill ring, or rotates text to the front
200of the kill ring, it sets the @dfn{primary selection} in the X server.
201This is how other X clients can access the text. Emacs also stores the
202text in the cut buffer, but only if the text is short enough
203(@code{x-cut-buffer-max} specifies the maximum number of characters);
204putting long strings in the cut buffer can be slow.
205
206 The commands to yank the first entry in the kill ring actually check
207first for a primary selection in another program; after that, they check
208for text in the cut buffer. If neither of those sources provides text
209to yank, the kill ring contents are used.
210
211@node Secondary Selection
212@section Secondary Selection
213@cindex secondary selection
214
215 The @dfn{secondary selection} is another way of selecting text using
216X. It does not use point or the mark, so you can use it to kill text
217without setting point or the mark.
218
219@table @kbd
220@findex mouse-set-secondary
221@kindex M-Drag-Mouse-1
222@item M-Drag-Mouse-1
223Set the secondary selection, with one end at the place where you press
224down the button, and the other end at the place where you release it
225(@code{mouse-set-secondary}). The highlighting appears and changes as
226you drag.
227
228If you move the mouse off the top or bottom of the window while
229dragging, the window scrolls at a steady rate until you move the mouse
230back into the window. This way, you can mark regions that don't fit
231entirely on the screen.
232
233@findex mouse-start-secondary
234@kindex M-Mouse-1
235@item M-Mouse-1
236Set one endpoint for the @dfn{secondary selection}
237(@code{mouse-start-secondary}).
238
239@findex mouse-secondary-save-then-kill
240@kindex M-Mouse-3
241@item M-Mouse-3
242Make a secondary selection, using the place specified with @kbd{M-Mouse-1}
243as the other end (@code{mouse-secondary-save-then-kill}). A second click
244at the same place kills the secondary selection just made.
245
246@findex mouse-yank-secondary
247@kindex M-Mouse-2
248@item M-Mouse-2
249Insert the secondary selection where you click
250(@code{mouse-yank-secondary}). This places point at the end of the
251yanked text.
252@end table
253
254Double or triple clicking of @kbd{M-Mouse-1} operates on words and
255lines, much like @kbd{Mouse-1}.
256
257If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2}
258yanks at point. Then it does not matter precisely where you click; all
259that matters is which window you click on. @xref{Mouse Commands}.
260
261@node Mouse References
262@section Following References with the Mouse
263@kindex Mouse-2 @r{(selection)}
264
265 Some Emacs buffers display lists of various sorts. These include
266lists of files, of buffers, of possible completions, of matches for
267a pattern, and so on.
268
269 Since yanking text into these buffers is not very useful, most of them
270define @kbd{Mouse-2} specially, as a command to use or view the item you
271click on.
272
273 For example, if you click @kbd{Mouse-2} on a file name in a Dired
274buffer, you visit that file. If you click @kbd{Mouse-2} on an error
275message in the @samp{*Compilation*} buffer, you go to the source code
276for that error message. If you click @kbd{Mouse-2} on a completion in
277the @samp{*Completions*} buffer, you choose that completion.
278
279 You can usually tell when @kbd{Mouse-2} has this special sort of
280meaning because the sensitive text highlights when you move the mouse
281over it.
282
283@node Menu Mouse Clicks
284@section Mouse Clicks for Menus
285
286 Mouse clicks modified with the @key{CTRL} and @key{SHIFT} keys
287bring up menus.
288
289@kindex C-Mouse-3
290@table @kbd
291@item C-Mouse-1
292This menu is for selecting a buffer.
293
294@item C-Mouse-2
295This menu is for specifying faces and other text properties
296for editing formatted text. @xref{Formatted Text}.
297
298@item C-Mouse-3
299This menu is mode-specific. For most modes, this menu has the same
300items as all the mode-specific menu-bar menus put together. Some modes
301may specify a different menu for this button.@footnote{Some systems use
302@kbd{Mouse-3} for a mode-specific menu. We took a survey of users, and
303found they preferred to keep @kbd{Mouse-3} for selecting and killing
304regions. Hence the decision to use @kbd{C-Mouse-3} for this menu.}
305
306@item S-mouse-1
307This menu is for specifying the frame's principal font.
308@end table
309
310@node Mode Line Mouse
311@section Mode Line Mouse Commands
312
313 You can use mouse clicks on window mode lines to select and manipulate
314windows.
315
316@table @kbd
317@item Mouse-1
318@kbd{Mouse-1} on a mode line selects the window above. By dragging
319@kbd{Mouse-1} on the mode line, you can move it, thus changing the
320height of the windows above and below.
321
322@item Mouse-2
323@kbd{Mouse-2} on a mode line expands that window to fill its frame.
324
325@item Mouse-3
326@kbd{Mouse-3} on a mode line deletes the window above.
327
328@item C-Mouse-2
329@kbd{C-Mouse-2} on a mode line splits the window above
330horizontally, above the place in the mode line where you click.
331@end table
332
333 @kbd{C-Mouse-2} on a scroll bar splits the corresponding window
334vertically. @xref{Split Window}.
335
70c88b57
DL
336The commands above apply to areas of the mode line which do not have
337mouse bindings of their own. Normally some areas, such as those
338displaying the buffer name and the major mode name, have their own mouse
339bindings. Help on these bindings is echoed when the mouse is positioned
340over them.
341
6bf7aab6
DL
342@node Creating Frames
343@section Creating Frames
344@cindex creating frames
345
346@kindex C-x 5
347 The prefix key @kbd{C-x 5} is analogous to @kbd{C-x 4}, with parallel
348subcommands. The difference is that @kbd{C-x 5} commands create a new
349frame rather than just a new window in the selected frame (@pxref{Pop
350Up Window}). If an existing visible or iconified frame already displays
351the requested material, these commands use the existing frame, after
352raising or deiconifying as necessary.
353
354 The various @kbd{C-x 5} commands differ in how they find or create the
355buffer to select:
356
357@table @kbd
358@item C-x 5 2
359@kindex C-x 5 2
360@findex make-frame-command
361Create a new frame (@code{make-frame-command}).
362@item C-x 5 b @var{bufname} @key{RET}
363Select buffer @var{bufname} in another frame. This runs
364@code{switch-to-buffer-other-frame}.
365@item C-x 5 f @var{filename} @key{RET}
366Visit file @var{filename} and select its buffer in another frame. This
367runs @code{find-file-other-frame}. @xref{Visiting}.
368@item C-x 5 d @var{directory} @key{RET}
369Select a Dired buffer for directory @var{directory} in another frame.
370This runs @code{dired-other-frame}. @xref{Dired}.
371@item C-x 5 m
372Start composing a mail message in another frame. This runs
373@code{mail-other-frame}. It is the other-frame variant of @kbd{C-x m}.
374@xref{Sending Mail}.
375@item C-x 5 .
376Find a tag in the current tag table in another frame. This runs
377@code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}.
378@xref{Tags}.
379@item C-x 5 r @var{filename} @key{RET}
380@kindex C-x 5 r
381@findex find-file-read-only-other-frame
382Visit file @var{filename} read-only, and select its buffer in another
383frame. This runs @code{find-file-read-only-other-frame}.
384@xref{Visiting}.
385@end table
386
387@cindex default-frame-alist
388@cindex initial-frame-alist
389 You can control the appearance of new frames you create by setting the
390frame parameters in @code{default-frame-alist}. You can use the
391variable @code{initial-frame-alist} to specify parameters that affect
392only the initial frame. @xref{Initial Parameters,,, elisp, The Emacs
393Lisp Reference Manual}, for more information.
394
395@cindex font (default)
396 The easiest way to specify the principal font for all your Emacs
397frames is with an X resource (@pxref{Font X}), but you can also do it by
398modifying @code{default-frame-alist} to specify the @code{font}
399parameter, as shown here:
400
401@example
402(add-to-list 'default-frame-alist '(font . "10x20"))
403@end example
404
405@node Speedbar
406@section Making and Using a Speedbar Frame
407@cindex speedbar
408
409 An Emacs frame can have a @dfn{speedbar}, which is a vertical window
410that serves as a scrollable menu of files you could visit and tags
411within those files. To create a speedbar, type @kbd{M-x speedbar}; this
412creates a speedbar window for the selected frame. From then on, you can
413click on a file name in the speedbar to visit that file in the
414corresponding Emacs frame, or click on a tag name to jump to that tag in
415the Emacs frame.
416
417 Initially the speedbar lists the immediate contents of the current
418directory, one file per line. Each line also has a box, @samp{[+]} or
419@samp{<+>}, that you can click on with @kbd{Mouse-2} to ``open up'' the
420contents of that item. If the line names a directory, opening it adds
421the contents of that directory to the speedbar display, underneath the
422directory's own line. If the line lists an ordinary file, opening it up
423adds a list of the tags in that file to the speedbar display. When a
424file is opened up, the @samp{[+]} changes to @samp{[-]}; you can click
425on that box to ``close up'' that file (hide its contents).
426
427 Some major modes, including Rmail mode, Info, and GUD, have
428specialized ways of putting useful items into the speedbar for you to
429select. For example, in Rmail mode, the speedbar shows a list of Rmail
430files, and lets you move the current message to another Rmail file by
431clicking on its @samp{<M>} box.
432
433 A speedbar belongs to one Emacs frame, and always operates on that
434frame. If you use multiple frames, you can make a speedbar for some or
435all of the frames; type @kbd{M-x speedbar} in any given frame to make a
436speedbar for it.
437
438@node Multiple Displays
439@section Multiple Displays
440@cindex multiple displays
441
442 A single Emacs can talk to more than one X Windows display.
443Initially, Emacs uses just one display---the one specified with the
444@code{DISPLAY} environment variable or with the @samp{--display} option
445(@pxref{Initial Options}). To connect to another display, use the
446command @code{make-frame-on-display}:
447
448@findex make-frame-on-display
449@table @kbd
450@item M-x make-frame-on-display @key{RET} @var{display} @key{RET}
451Create a new frame on display @var{display}.
452@end table
453
454 A single X server can handle more than one screen. When you open
455frames on two screens belonging to one server, Emacs knows they share a
456single keyboard, and it treats all the commands arriving from these
457screens as a single stream of input.
458
459 When you open frames on different X servers, Emacs makes a separate
460input stream for each server. This way, two users can type
461simultaneously on the two displays, and Emacs will not garble their
462input. Each server also has its own selected frame. The commands you
463enter with a particular X server apply to that server's selected frame.
464
465 Despite these features, people using the same Emacs job from different
466displays can still interfere with each other if they are not careful.
467For example, if any one types @kbd{C-x C-c}, that exits the Emacs job
468for all of them!
469
470@node Special Buffer Frames
471@section Special Buffer Frames
472
473@vindex special-display-buffer-names
474 You can make certain chosen buffers, for which Emacs normally creates
475a second window when you have just one window, appear in special frames
476of their own. To do this, set the variable
477@code{special-display-buffer-names} to a list of buffer names; any
478buffer whose name is in that list automatically gets a special frame,
479when an Emacs command wants to display it ``in another window.''
480
481 For example, if you set the variable this way,
482
483@example
484(setq special-display-buffer-names
485 '("*Completions*" "*grep*" "*tex-shell*"))
486@end example
487
488@noindent
489then completion lists, @code{grep} output and the @TeX{} mode shell
490buffer get individual frames of their own. These frames, and the
491windows in them, are never automatically split or reused for any other
492buffers. They continue to show the buffers they were created for,
493unless you alter them by hand. Killing the special buffer deletes its
494frame automatically.
495
496@vindex special-display-regexps
497 More generally, you can set @code{special-display-regexps} to a list
498of regular expressions; then a buffer gets its own frame if its name
499matches any of those regular expressions. (Once again, this applies only
500to buffers that normally get displayed for you in a separate window.)
501
502@vindex special-display-frame-alist
503 The variable @code{special-display-frame-alist} specifies the frame
504parameters for these frames. It has a default value, so you don't need
505to set it.
506
507 For those who know Lisp, an element of
508@code{special-display-buffer-names} or @code{special-display-regexps}
509can also be a list. Then the first element is the buffer name or
510regular expression; the rest of the list specifies how to create the
511frame. It can be an association list specifying frame parameter values;
512these values take precedence over parameter values specified in
513@code{special-display-frame-alist}. Alternatively, it can have this
514form:
515
516@example
517(@var{function} @var{args}...)
518@end example
519
520@noindent
521where @var{function} is a symbol. Then the frame is constructed by
522calling @var{function}; its first argument is the buffer, and its
523remaining arguments are @var{args}.
524
525 An analogous feature lets you specify buffers which should be
526displayed in the selected window. @xref{Force Same Window}. The
527same-window feature takes precedence over the special-frame feature;
528therefore, if you add a buffer name to
529@code{special-display-buffer-names} and it has no effect, check to see
530whether that feature is also in use for the same buffer name.
531
532@node Frame Parameters
533@section Setting Frame Parameters
534@cindex colors
535@cindex Auto-Raise mode
536@cindex Auto-Lower mode
537
538 This section describes commands for altering the display style and
539window management behavior of the selected frame.
540
541@findex set-foreground-color
542@findex set-background-color
543@findex set-cursor-color
544@findex set-mouse-color
545@findex set-border-color
546@findex auto-raise-mode
547@findex auto-lower-mode
548@table @kbd
549@item M-x set-foreground-color @key{RET} @var{color} @key{RET}
550Specify color @var{color} for the foreground of the selected frame.
551(This also changes the foreground color of the default face.)
552
553@item M-x set-background-color @key{RET} @var{color} @key{RET}
554Specify color @var{color} for the background of the selected frame.
555(This also changes the background color of the default face.)
556
557@item M-x set-cursor-color @key{RET} @var{color} @key{RET}
558Specify color @var{color} for the cursor of the selected frame.
559
560@item M-x set-mouse-color @key{RET} @var{color} @key{RET}
561Specify color @var{color} for the mouse cursor when it is over the
562selected frame.
563
564@item M-x set-border-color @key{RET} @var{color} @key{RET}
565Specify color @var{color} for the border of the selected frame.
566
567@item M-x list-colors-display
568Display the defined color names and show what the colors look like.
569This command is somewhat slow.
570
571@item M-x auto-raise-mode
572Toggle whether or not the selected frame should auto-raise. Auto-raise
573means that every time you move the mouse onto the frame, it raises the
574frame.
575
576Note that this auto-raise feature is implemented by Emacs itself. Some
577window managers also implement auto-raise. If you enable auto-raise for
578Emacs frames in your X window manager, it should work, but it is beyond
579Emacs's control and therefore @code{auto-raise-mode} has no effect on
580it.
581
582@item M-x auto-lower-mode
583Toggle whether or not the selected frame should auto-lower.
584Auto-lower means that every time you move the mouse off the frame,
585the frame moves to the bottom of the stack of X windows.
586
587The command @code{auto-lower-mode} has no effect on auto-lower
588implemented by the X window manager. To control that, you must use
589the appropriate window manager features.
590
591@findex set-frame-font
592@item M-x set-frame-font @key{RET} @var{font} @key{RET}
593@cindex font (principal)
594Specify font @var{font} as the principal font for the selected frame.
595The principal font controls several face attributes of the
596@code{default} face (@pxref{Faces}). For example, if the principal font
597has a height of 12 pt, all text will be drawn in 12 pt fonts, unless you
598use another face that specifies a different height. @xref{Font X}, for
599ways to list the available fonts on your system.
600
601@kindex S-Mouse-1
602You can also set a frame's principal font through a pop-up menu.
603Press @kbd{S-Mouse-1} to activate this menu.
604@end table
605
606 In Emacs versions that use an X toolkit, the color-setting and
607font-setting functions don't affect menus and the menu bar, since they
608are displayed by their own widget classes. To change the appearance of
609the menus and menu bar, you must use X resources (@pxref{Resources X}).
610@xref{Colors X}, regarding colors. @xref{Font X}, regarding choice of
611font.
612
613 For information on frame parameters and customization, see @ref{Frame
614Parameters,,, elisp, The Emacs Lisp Reference Manual}.
615
616@node Scroll Bars
617@section Scroll Bars
618@cindex Scroll Bar mode
619@cindex mode, Scroll Bar
620
621 When using X, Emacs normally makes a @dfn{scroll bar} at the left of
70c88b57
DL
622each Emacs window.@footnote{Placing it at the left is usually more
623useful with overlapping frames with text starting at the left margin.}
624The scroll bar runs the height of the window, and shows a moving
625rectangular inner box which represents the portion of the buffer
626currently displayed. The entire height of the scroll bar represents the
627entire length of the buffer.
6bf7aab6
DL
628
629 You can use @kbd{Mouse-2} (normally, the middle button) in the scroll
630bar to move or drag the inner box up and down. If you move it to the
631top of the scroll bar, you see the top of the buffer. If you move it to
632the bottom of the scroll bar, you see the bottom of the buffer.
633
634 The left and right buttons in the scroll bar scroll by controlled
635increments. @kbd{Mouse-1} (normally, the left button) moves the line at
636the level where you click up to the top of the window. @kbd{Mouse-3}
637(normally, the right button) moves the line at the top of the window
638down to the level where you click. By clicking repeatedly in the same
639place, you can scroll by the same distance over and over.
640
641 Aside from scrolling, you can also click @kbd{C-Mouse-2} in the scroll
642bar to split a window vertically. The split occurs on the line where
643you click.
644
645@findex scroll-bar-mode
70c88b57 646@vindex scroll-bar-mode
6bf7aab6
DL
647 You can enable or disable Scroll Bar mode with the command @kbd{M-x
648scroll-bar-mode}. With no argument, it toggles the use of scroll bars.
649With an argument, it turns use of scroll bars on if and only if the
650argument is positive. This command applies to all frames, including
70c88b57
DL
651frames yet to be created. Customize the option @code{scroll-bar-mode}
652to control the use of scroll bars at startup. You can use it to specify
653that they are placed at the right of windows if you prefer that. You
654can use the X resource @samp{verticalScrollBars} to control the initial
655setting of Scroll Bar mode similarly. @xref{Resources X}.
6bf7aab6
DL
656
657@findex toggle-scroll-bar
658 To enable or disable scroll bars for just the selected frame, use the
659@kbd{M-x toggle-scroll-bar} command.
660
70c88b57
DL
661@node Wheeled Mice
662@section Scrolling With `Wheeled' Mice
663
664@cindex mouse wheel
665@findex mwheel-install
666Some mice have a `wheel' instead of a third button. You can usually
667click the wheel to act as @kbd{mouse-3}. You can also use the wheel to
668scroll windows instead of using the scroll bar or keyboard commands.
669Use @kbd{M-x mwheel-install} to set up the wheel for scrolling or put
670@samp{(require 'mwheel)} in your @file{.emacs}. (Support for the wheel
671depends on the window system generating appropriate events for Emacs.)
672
673@vindex mwheel-follow-mouse
674@vindex mwheel-scroll-amount
675The variables @code{mwheel-follow-mouse} and @code{mwheel-scroll-amount}
676determine where and by how much buffers are scrolled.
677
6bf7aab6
DL
678@node Menu Bars
679@section Menu Bars
680@cindex Menu Bar mode
681@cindex mode, Menu Bar
682
683 You can turn display of menu bars on or off with @kbd{M-x
684menu-bar-mode}. With no argument, this command toggles Menu Bar mode, a
685minor mode. With an argument, the command turns Menu Bar mode on if the
686argument is positive, off if the argument is not positive. You can use
687the X resource @samp{menuBarLines} to control the initial setting of
688Menu Bar mode. @xref{Resources X}. Expert users often turn off the
689menu bar, especially on text-only terminals, where this makes one
690additional line available for text.
691
692 @xref{Menu Bar}, for information on how to invoke commands with the
693menu bar.
694
70c88b57
DL
695@c Presumably not useful until we make toolbar items.
696@c @node Tool Bars
697@c @section Tool Bars
698@c @cindex Tool Bar mode
699@c @cindex mode, Tool Bar
700
701@c You can turn display of tool bars on or off with @kbd{M-x
702@c tool-bar-mode}. With no argument, this command toggles Tool Bar mode, a
703@c minor mode. With an argument, the command turns Tool Bar mode on if the
704@c argument is positive, off if the argument is not positive.
705
706@node Dialog Boxes
707@section Using Dialog Boxes
708@cindex dialog boxes
709
710@vindex use-dialog-box
711Certain operations invoked from menus will use a window system dialog
712box to get information via the mouse if such dialog boxes are supported.
713This includes yes/no questions and file selection under Motif/LessTif
714and MS Windows. Customize the option @code{use-dialog-box} to suppress
715the use of dialog boxes.
716
6bf7aab6
DL
717@node Faces
718@section Using Multiple Typefaces
719@cindex faces
720
721 When using Emacs with X, you can set up multiple styles of displaying
722characters. The aspects of style that you can control are the type
723font, the foreground color, the background color, and whether to
724underline. Emacs on MS-DOS supports faces partially by letting you
725control the foreground and background colors of each face
70c88b57
DL
726(@pxref{MS-DOS}). On non-windowed terminals faces are supported to the
727extent the terminal can display them.
6bf7aab6
DL
728
729 The way you control display style is by defining named @dfn{faces}.
730Each face can specify a type font, a foreground color, a background
731color, and an underline flag; but it does not have to specify all of
732them. Then by specifying the face or faces to use for a given part
733of the text in the buffer, you control how that text appears.
734
735 The style of display used for a given character in the text is
736determined by combining several faces. Any aspect of the display style
737that isn't specified by overlays or text properties comes from the frame
738itself.
739
740 Enriched mode, the mode for editing formatted text, includes several
741commands and menus for specifying faces. @xref{Format Faces}, for how
742to specify the font for text in the buffer. @xref{Format Colors}, for
743how to specify the foreground and background color.
744
745 To alter the appearance of a face, use the customization buffer.
746@xref{Face Customization}. You can also use X resources to specify
747attributes of particular faces (@pxref{Resources X}).
748
749@findex list-faces-display
750 To see what faces are currently defined, and what they look like, type
751@kbd{M-x list-faces-display}. It's possible for a given face to look
752different in different frames; this command shows the appearance in the
753frame in which you type it. Here's a list of the standardly defined
754faces:
755
756@table @code
757@item default
758This face is used for ordinary text that doesn't specify any other face.
759@item modeline
70c88b57
DL
760This face is used for mode lines. By default, it's drawn with shadows
761for a `raised' effect under X and set up as the inverse of the default
762face on non-windowed terminals. @xref{Display Vars}.
763@item header-line
764Similar to @code{modeline} for a window's header line.
6bf7aab6
DL
765@item highlight
766This face is used for highlighting portions of text, in various modes.
767@item region
768This face is used for displaying a selected region (when Transient Mark
769mode is enabled---see below).
770@item secondary-selection
771This face is used for displaying a secondary selection (@pxref{Secondary
772Selection}).
773@item bold
774This face uses a bold variant of the default font, if it has one.
775@item italic
776This face uses an italic variant of the default font, if it has one.
777@item bold-italic
778This face uses a bold italic variant of the default font, if it has one.
779@item underline
780This face underlines text.
70c88b57
DL
781@item fixed-pitch
782The basic fixed-pitch face.
783@item fringe
784The face for the fringes to the left and right of windows under X.
785@item scroll-bar
786This face determines the colors of the scroll bar.
787@item border
788This face determines the color of the frame border.
789@item cursor
790This face determines the color of the cursor.
791@item mouse
792This face determines the color of the mouse pointer.
793@item tool-bar
794The basic tool-bar face.
795@item menu
796This face determines the colors and font of Emacs's menus. Setting the
797font of LessTif/Motif menus is currently not supported; attempts to set
798the font are ignored in this case.
799@item trailing-whitespace
800The face for highlighting trailing whitespace when
801@code{show-trailing-whitespace} is non-nil.
802@item variable-pitch
803The basic variable-pitch face.
6bf7aab6
DL
804@end table
805
806@cindex @code{region} face
807 When Transient Mark mode is enabled, the text of the region is
808highlighted when the mark is active. This uses the face named
809@code{region}; you can control the style of highlighting by changing the
810style of this face (@pxref{Face Customization}). @xref{Transient Mark},
811for more information about Transient Mark mode and activation and
812deactivation of the mark.
813
814 One easy way to use faces is to turn on Font Lock mode. This minor
815mode, which is always local to a particular buffer, arranges to
816choose faces according to the syntax of the text you are editing. It
817can recognize comments and strings in most languages; in several
818languages, it can also recognize and properly highlight various other
819important constructs. @xref{Font Lock}, for more information about
820Font Lock mode and syntactic highlighting.
821
822 You can print out the buffer with the highlighting that appears
823on your screen using the command @code{ps-print-buffer-with-faces}.
70c88b57 824@xref{PostScript}.
6bf7aab6
DL
825
826@node Font Lock
827@section Font Lock mode
828@cindex Font Lock mode
829@cindex mode, Font Lock
830@cindex syntax highlighting
70c88b57 831@cindex syntax coloring
6bf7aab6
DL
832
833 Font Lock mode is a minor mode, always local to a particular
834buffer, which highlights (or ``fontifies'') using various faces
835according to the syntax of the text you are editing. It can
836recognize comments and strings in most languages; in several
837languages, it can also recognize and properly highlight various other
838important constructs---for example, names of functions being defined
839or reserved keywords.
840
841@findex font-lock-mode
842@findex turn-on-font-lock
843 The command @kbd{M-x font-lock-mode} turns Font Lock mode on or off
844according to the argument, and toggles the mode when it has no argument.
845The function @code{turn-on-font-lock} unconditionally enables Font Lock
846mode. This is useful in mode-hook functions. For example, to enable
847Font Lock mode whenever you edit a C file, you can do this:
848
849@example
850(add-hook 'c-mode-hook 'turn-on-font-lock)
851@end example
852
853@findex global-font-lock-mode
70c88b57 854@vindex global-font-lock-mode
6bf7aab6 855 To turn on Font Lock mode automatically in all modes which support it,
70c88b57
DL
856customize the user option @code{global-font-lock-mode} or use the
857function @code{global-font-lock-mode}, like this:
6bf7aab6
DL
858
859@example
860(global-font-lock-mode 1)
861@end example
862
863@kindex M-g M-g
864@findex font-lock-fontify-block
865 In Font Lock mode, when you edit the text, the highlighting updates
866automatically in the line that you changed. Most changes don't affect
867the highlighting of subsequent lines, but occasionally they do. To
868rehighlight a range of lines, use the command @kbd{M-g M-g}
869(@code{font-lock-fontify-block}).
870
871@vindex font-lock-mark-block-function
872 In certain major modes, @kbd{M-g M-g} refontifies the entire current
873function. (The variable @code{font-lock-mark-block-function} controls
874how to find the current function.) In other major modes, @kbd{M-g M-g}
875refontifies 16 lines above and below point.
876
877 With a prefix argument @var{n}, @kbd{M-g M-g} refontifies @var{n}
878lines above and below point, regardless of the mode.
879
880 To get the full benefit of Font Lock mode, you need to choose a
881default font which has bold, italic, and bold-italic variants; or else
882you need to have a color or gray-scale screen.
883
884@vindex font-lock-maximum-decoration
885 The variable @code{font-lock-maximum-decoration} specifies the
886preferred level of fontification, for modes that provide multiple
887levels. Level 1 is the least amount of fontification; some modes
888support levels as high as 3. The normal default is ``as high as
889possible.'' You can specify an integer, which applies to all modes, or
890you can specify different numbers for particular major modes; for
891example, to use level 1 for C/C++ modes, and the default level
892otherwise, use this:
893
894@example
895(setq font-lock-maximum-decoration
896 '((c-mode . 1) (c++-mode . 1)))
897@end example
898
899@vindex font-lock-maximum-size
900 Fontification can be too slow for large buffers, so you can suppress
901it. The variable @code{font-lock-maximum-size} specifies a buffer size,
902beyond which buffer fontification is suppressed.
903
904@c @w is used below to prevent a bad page-break.
905@vindex font-lock-beginning-of-syntax-function
906 Comment and string fontification (or ``syntactic'' fontification)
907relies on analysis of the syntactic structure of the buffer text. For
908the purposes of speed, some modes including C mode and Lisp mode rely on
909a special convention: an open-parenthesis in the leftmost column always
910defines the @w{beginning} of a defun, and is thus always outside any string
911or comment. (@xref{Defuns}.) If you don't follow this convention,
912then Font Lock mode can misfontify the text after an open-parenthesis in
913the leftmost column that is inside a string or comment.
914
915 The variable @code{font-lock-beginning-of-syntax-function} (always
916buffer-local) specifies how Font Lock mode can find a position
917guaranteed to be outside any comment or string. In modes which use the
918leftmost column parenthesis convention, the default value of the variable
919is @code{beginning-of-defun}---that tells Font Lock mode to use the
920convention. If you set this variable to @code{nil}, Font Lock no longer
921relies on the convention. This avoids incorrect results, but the price
922is that, in some cases, fontification for a changed text must rescan
923buffer text from the beginning of the buffer.
924
925@findex font-lock-add-keywords
926 Font Lock highlighting patterns already exist for many modes, but you
927may want to fontify additional patterns. You can use the function
928@code{font-lock-add-keywords}, to add your own highlighting patterns for
929a particular mode. For example, to highlight @samp{FIXME:} words in C
930comments, use this:
931
932@example
933(font-lock-add-keywords
934 'c-mode
935 '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t)))
936@end example
937
938@node Support Modes
939@section Font Lock Support Modes
940
941 Font Lock support modes make Font Lock mode faster for large buffers.
942There are two support modes: Fast Lock mode and Lazy Lock mode. They
943use two different methods of speeding up Font Lock mode.
944
945@menu
946* Fast Lock Mode:: Saving font information in files.
947* Lazy Lock Mode:: Fontifying only text that is actually displayed.
70c88b57 948* JIT Lock Mode:: Like Lazy Lock, but generally faster.
6bf7aab6
DL
949* Fast or Lazy:: Which support mode is best for you?
950@end menu
951
952@node Fast Lock Mode
953@subsection Fast Lock Mode
954
955@cindex Fast Lock mode
956@cindex mode, Fast Lock
957 To make Font Lock mode faster for buffers visiting large files, you
958can use Fast Lock mode. Fast Lock mode saves the font information for
959each file in a separate cache file; each time you visit the file, it
960rereads the font information from the cache file instead of refontifying
961the text from scratch.
962
963@findex fast-lock-mode
964 The command @kbd{M-x fast-lock-mode} turns Fast Lock mode on or off,
965according to the argument (with no argument, it toggles). You can also
966arrange to enable Fast Lock mode whenever you use Font Lock mode, like
967this:
968
969@example
970(setq font-lock-support-mode 'fast-lock-mode)
971@end example
972
973@vindex fast-lock-minimum-size
974 It is not worth writing a cache file for small buffers. Therefore,
975the variable @code{fast-lock-minimum-size} specifies a minimum file size
976for caching font information.
977
978@vindex fast-lock-cache-directories
979 The variable @code{fast-lock-cache-directories} specifies where to put
980the cache files. Its value is a list of directories to try; @code{"."}
981means the same directory as the file being edited. The default value is
982@w{@code{("." "~/.emacs-flc")}}, which means to use the same directory if
983possible, and otherwise the directory @file{~/.emacs-flc}.
984
985@vindex fast-lock-save-others
986 The variable @code{fast-lock-save-others} specifies whether Fast Lock
987mode should save cache files for files that you do not own. A
988non-@code{nil} value means yes (and that is the default).
989
990@node Lazy Lock Mode
991@subsection Lazy Lock Mode
992@cindex Lazy Lock mode
993@cindex mode, Lazy Lock
994
995 To make Font Lock mode faster for large buffers, you can use Lazy Lock
996mode to reduce the amount of text that is fontified. In Lazy Lock mode,
997buffer fontification is demand-driven; it happens to portions of the
998buffer that are about to be displayed. And fontification of your
999changes is deferred; it happens only when Emacs has been idle for a
1000certain short period of time.
1001
1002@findex lazy-lock-mode
1003 The command @kbd{M-x lazy-lock-mode} turns Lazy Lock mode on or off,
1004according to the argument (with no argument, it toggles). You can also
1005arrange to enable Lazy Lock mode whenever you use Font Lock mode, like
1006this:
1007
1008@example
1009(setq font-lock-support-mode 'lazy-lock-mode)
1010@end example
1011
1012@vindex lazy-lock-minimum-size
1013 It is not worth avoiding buffer fontification for small buffers.
1014Therefore, the variable @code{lazy-lock-minimum-size} specifies a
1015minimum buffer size for demand-driven buffer fontification. Buffers
1016smaller than that are fontified all at once, as in plain Font Lock mode.
1017
1018@vindex lazy-lock-defer-time
1019 When you alter the buffer, Lazy Lock mode defers fontification of the
1020text you changed. The variable @code{lazy-lock-defer-time} specifies
1021how many seconds Emacs must be idle before it starts fontifying your
1022changes. If the value is 0, then changes are fontified immediately, as
1023in plain Font Lock mode.
1024
1025@vindex lazy-lock-defer-on-scrolling
1026 Lazy Lock mode normally fontifies newly visible portions of the buffer
1027before they are first displayed. However, if the value of
1028@code{lazy-lock-defer-on-scrolling} is non-@code{nil}, newly visible
1029text is fontified only when Emacs is idle for
1030@code{lazy-lock-defer-time} seconds.
1031
1032@vindex lazy-lock-defer-contextually
1033 In some modes, including C mode and Emacs Lisp mode, changes in one
1034line's contents can alter the context for subsequent lines, and thus
1035change how they ought to be fontified. Ordinarily, you must type
1036@kbd{M-g M-g} to refontify the subsequent lines. However, if you set
1037the variable @code{lazy-lock-defer-contextually} to non-@code{nil}, Lazy
1038Lock mode does this automatically, after @code{lazy-lock-defer-time}
1039seconds.
1040
1041@cindex stealth fontification
1042 When Emacs is idle for a long time, Lazy Lock fontifies additional
1043portions of the buffer, not yet displayed, in case you will display them
1044later. This is called @dfn{stealth fontification}.
1045
1046@vindex lazy-lock-stealth-time
1047@vindex lazy-lock-stealth-lines
1048@vindex lazy-lock-stealth-verbose
1049 The variable @code{lazy-lock-stealth-time} specifies how many seconds
1050Emacs has to be idle before stealth fontification starts. A value of
1051@code{nil} means no stealth fontification. The variables
1052@code{lazy-lock-stealth-lines} and @code{lazy-lock-stealth-verbose}
1053specify the granularity and verbosity of stealth fontification.
1054
70c88b57
DL
1055@node JIT Lock Mode
1056@subsection JIT Lock Mode
1057
1058@findex jit-lock-mode
1059The command @kbd{M-x lazy-lock-mode} turns JIT Lock mode on or off,
1060according to the argument (with no argument, it toggles). This support
1061mode is roughly equivalent to Lazy Lock but is generally faster. It
1062supports stealth and deferred fontification.
1063
1064Font-lock uses @code{jit-lock-mode} as default support mode, so you
1065don't have to do anything to activate it.
1066
6bf7aab6
DL
1067@node Fast or Lazy
1068@subsection Fast Lock or Lazy Lock?
1069
1070 Here is a simple guide to help you choose one of the Font Lock support
1071modes.
1072
1073@itemize @bullet
1074@item
1075Fast Lock mode intervenes only during file visiting and buffer
1076killing (and related events); therefore buffer editing and window
1077scrolling are no faster or slower than in plain Font Lock mode.
1078
1079@item
1080Fast Lock mode is slower at reading a cache file than Lazy Lock
1081mode is at fontifying a window; therefore Fast Lock mode is slower at
1082visiting a file than Lazy Lock mode.
1083
1084@item
1085Lazy Lock mode intervenes during window scrolling to fontify text that
1086scrolls onto the screen; therefore, scrolling is slower than in plain
1087Font Lock mode.
1088
1089@item
1090Lazy Lock mode doesn't fontify during buffer editing (it defers
1091fontification of changes); therefore, editing is faster than in plain
1092Font Lock mode.
1093
1094@item
1095Fast Lock mode can be fooled by a file that is kept under version
1096control software; therefore buffer fontification may occur even when
1097a cache file exists for the file.
1098
1099@item
1100Fast Lock mode only works with a buffer visiting a file; Lazy Lock
1101mode works with any buffer.
1102
1103@item
1104Fast Lock mode generates cache files; Lazy Lock mode does not.
1105@end itemize
1106
1107@vindex font-lock-support-mode
1108 The variable @code{font-lock-support-mode} specifies which of these
1109support modes to use; for example, to specify that Fast Lock mode is
1110used for C/C++ modes, and Lazy Lock mode otherwise, set the variable
1111like this:
1112
1113@example
1114(setq font-lock-support-mode
1115 '((c-mode . fast-lock-mode) (c++-mode . fast-lock-mode)
1116 (t . lazy-lock-mode)))
1117@end example
1118
1119@node Highlight Changes
1120@section Highlight Changes Mode
1121
1122@findex highlight-changes-mode
1123 Use @kbd{M-x highlight-changes-mode} to enable a minor mode
1124that uses faces (colors, typically) to indicate which parts of
1125the buffer were changed most recently.
1126
70c88b57
DL
1127@node Trailing Whitespace
1128@section Trailing Whitespace
1129
1130@cindex trailing whitespace
1131@vindex show-trailing-whitespace
1132The option @code{show-trailing-whitespace} can be customized so that
1133Emacs displays trailing whitespace in the face
1134@code{trailing-whitespace}. Trailing whitespace is defined as spaces or
1135tabs at the end of a line. To avoid busy highlighting when entering new
1136text, trailing whitespace is not displayed if point is at the end of the
1137line containing the whitespace.
1138
1139@node Tooltips
1140@section Tooltips (or `Ballon Help')
1141
1142@cindex balloon help
1143@findex tooltip-mode
1144Tooltips are small X windows displaying a help string at the current
1145mouse position, typically over text which can be activated with the
1146mouse or other keys. (This facility is sometimes known as `balloon
1147help'.) To use them customize the user option. @code{tooltip-mode}.
1148The customization group @code{tooltip} controls various aspects of their
1149display.
1150
1151
6bf7aab6
DL
1152@node Misc X
1153@section Miscellaneous X Window Features
1154
1155 The following commands let you create, delete and operate on frames:
1156
1157@table @kbd
1158@item C-z
1159@kindex C-z @r{(X windows)}
1160@findex iconify-or-deiconify-frame
1161Iconify the selected Emacs frame (@code{iconify-or-deiconify-frame}).
1162The normal meaning of @kbd{C-z}, to suspend Emacs, is not useful under a
1163window system, so it has a different binding in that case.
1164
1165If you type this command on an Emacs frame's icon, it deiconifies the frame.
1166
1167@item C-x 5 0
1168@kindex C-x 5 0
1169@findex delete-frame
1170Delete the selected frame (@code{delete-frame}). This is not allowed if
1171there is only one frame.
1172
1173@item C-x 5 o
1174@kindex C-x 5 o
1175@findex other-frame
1176Select another frame, raise it, and warp the mouse to it so that it
1177stays selected. If you repeat this command, it cycles through all the
1178frames on your terminal.
1179@end table
1180
1181@node Non-Window Terminals
1182@section Non-Window Terminals
1183@cindex non-window terminals
1184@cindex single-frame terminals
1185
1186 If your terminal does not have a window system that Emacs supports,
1187then it can display only one Emacs frame at a time. However, you can
1188still create multiple Emacs frames, and switch between them. Switching
1189frames on these terminals is much like switching between different
1190window configurations.
1191
1192 Use @kbd{C-x 5 2} to create a new frame and switch to it; use @kbd{C-x
11935 o} to cycle through the existing frames; use @kbd{C-x 5 0} to delete
1194the current frame.
1195
1196 Each frame has a number to distinguish it. If your terminal can
1197display only one frame at a time, the selected frame's number @var{n}
1198appears near the beginning of the mode line, in the form
1199@samp{F@var{n}}.
1200
1201@findex set-frame-name
1202@findex select-frame-by-name
1203 @samp{F@var{n}} is actually the frame's name. You can also specify a
1204different name if you wish, and you can select a frame by its name. Use
1205the command @kbd{M-x set-frame-name @key{RET} @var{name} @key{RET}} to
1206specify a new name for the selected frame, and use @kbd{M-x
1207select-frame-by-name @key{RET} @var{name} @key{RET}} to select a frame
1208according to its name. The name you specify appears in the mode line
1209when the frame is selected.
1210
70c88b57
DL
1211@node XTerm Mouse
1212@section Using a Mouse in Terminal Emulators
1213
1214Some terminal emulators under X support mouse clicks in the terminal
1215window. In a terminal emulator which is compatible with @code{xterm},
1216you can use @kbd{M-x xterm-mouse-mode} to enable simple use of the
1217mouse---only single clicks are supported. The normal @code{xterm} mouse
1218functionality is still available by holding down the @kbd{SHIFT} key
1219when you press the mouse button.