Update docs for a bunch of 24.3 changes.
[bpt/emacs.git] / doc / emacs / display.texi
CommitLineData
802b0ea7 1@c This is part of the Emacs manual.
acaf905b 2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012
0419b8d6
GM
3@c Free Software Foundation, Inc.
4
6bf7aab6 5@c See file emacs.texi for copying conditions.
abb9615e 6@node Display
6bf7aab6
DL
7@chapter Controlling the Display
8
41859241
CY
9 Since only part of a large buffer fits in the window, Emacs has to
10show only a part of it. This chapter describes commands and variables
11that let you specify which part of the text you want to see, and how
12the text is displayed.
6bf7aab6
DL
13
14@menu
8838673e 15* Scrolling:: Commands to move text up and down in a window.
e7a3ff06 16* Recentering:: A scroll command that centers the current line.
43d67313 17* Auto Scrolling:: Redisplay scrolls text automatically when needed.
54952612 18* Horizontal Scrolling:: Moving text left and right in a window.
f404f8bc
CY
19* Narrowing:: Restricting display and editing to a portion
20 of the buffer.
a6326082 21* View Mode:: Viewing read-only buffers.
54952612 22* Follow Mode:: Follow mode lets two windows scroll as one.
8838673e 23* Faces:: How to change the display style using faces.
8863a584 24* Colors:: Specifying colors for faces.
44e97401 25* Standard Faces:: The main predefined faces.
d366bd53 26* Text Scale:: Increasing or decreasing text size in a buffer.
b8f3a9e3 27* Font Lock:: Minor mode for syntactic highlighting using faces.
b8f3a9e3 28* Highlight Interactively:: Tell Emacs what text to highlight.
fad78d58 29* Fringes:: Enabling or disabling window fringes.
9d2908a6 30* Displaying Boundaries:: Displaying top and bottom of the buffer.
2d2f6581 31* Useless Whitespace:: Showing possibly spurious trailing whitespace.
6bf7aab6
DL
32* Selective Display:: Hiding lines with lots of indentation.
33* Optional Mode Line:: Optional mode line display features.
34* Text Display:: How text characters are normally displayed.
099bfef9 35* Cursor Display:: Features for displaying the cursor.
9d2908a6
RS
36* Line Truncation:: Truncating lines to fit the screen width instead
37 of continuing them to multiple screen lines.
458db4b6 38* Visual Line Mode:: Word wrap and screen line-based editing.
0015d677 39* Display Custom:: Information on variables for customizing display.
6bf7aab6
DL
40@end menu
41
dc917bd9
RS
42@node Scrolling
43@section Scrolling
550f41cd 44@cindex scrolling
dc917bd9 45
550f41cd
CY
46 If a window is too small to display all the text in its buffer, it
47displays only a portion of it. @dfn{Scrolling} commands change which
48portion of the buffer is displayed.
dc917bd9 49
550f41cd
CY
50 Scrolling ``forward'' or ``up'' advances the portion of the buffer
51displayed in the window; equivalently, it moves the buffer text
52upwards relative to the window. Scrolling ``backward'' or ``down''
e7a3ff06
CY
53displays an earlier portion of the buffer, and moves the text
54downwards relative to the window.
55
56 In Emacs, scrolling ``up'' or ``down'' refers to the direction that
57the text moves in the window, @emph{not} the direction that the window
58moves relative to the text. This terminology was adopted by Emacs
59before the modern meaning of ``scrolling up'' and ``scrolling down''
60became widespread. Hence, the strange result that @key{PageDown}
61scrolls ``up'' in the Emacs sense.
dc917bd9 62
550f41cd
CY
63 The portion of a buffer displayed in a window always contains point.
64If you move point past the bottom or top of the window, scrolling
65occurs automatically to bring it back onscreen (@pxref{Auto
66Scrolling}). You can also scroll explicitly with these commands:
dc917bd9
RS
67
68@table @kbd
dc917bd9 69@item C-v
b5700de6
CY
70@itemx @key{next}
71@itemx @key{PageDown}
61436e9f 72Scroll forward by nearly a full window (@code{scroll-up-command}).
dc917bd9 73@item M-v
b5700de6
CY
74@itemx @key{prior}
75@itemx @key{PageUp}
61436e9f 76Scroll backward (@code{scroll-down-command}).
e7a3ff06
CY
77@end table
78
79@kindex C-v
80@kindex M-v
81@kindex next
82@kindex prior
83@kindex PageDown
84@kindex PageUp
85@findex scroll-up-command
86@findex scroll-down-command
87 @kbd{C-v} (@code{scroll-up-command}) scrolls forward by nearly the
88whole window height. The effect is to take the two lines at the
89bottom of the window and put them at the top, followed by lines that
90were not previously visible. If point was in the text that scrolled
91off the top, it ends up on the window's new topmost line. The
92@key{next} (or @key{PageDown}) key is equivalent to @kbd{C-v}.
93
94 @kbd{M-v} (@code{scroll-down-command}) scrolls backward in a similar
95way. The @key{prior} (or @key{PageUp}) key is equivalent to
96@kbd{M-v}.
97
98@vindex next-screen-context-lines
99 The number of lines of overlap left by these scroll commands is
100controlled by the variable @code{next-screen-context-lines}, whose
101default value is 2. You can supply the commands with a numeric prefix
102argument, @var{n}, to scroll by @var{n} lines; Emacs attempts to leave
103point unchanged, so that the text and point move up or down together.
104@kbd{C-v} with a negative argument is like @kbd{M-v} and vice versa.
105
106@vindex scroll-error-top-bottom
107 By default, these commands signal an error (by beeping or flashing
108the screen) if no more scrolling is possible, because the window has
109reached the beginning or end of the buffer. If you change the
110variable @code{scroll-error-top-bottom} to @code{t}, the command moves
111point to the farthest possible position. If point is already there,
112the command signals an error.
113
114@vindex scroll-preserve-screen-position
115@cindex @code{scroll-command} property
116 Some users like scroll commands to keep point at the same screen
117position, so that scrolling back to the same screen conveniently
118returns point to its original position. You can enable this behavior
119via the variable @code{scroll-preserve-screen-position}. If the value
120is @code{t}, Emacs adjusts point to keep the cursor at the same screen
121position whenever a scroll command moves it off-window, rather than
122moving it to the topmost or bottommost line. With any other
123non-@code{nil} value, Emacs adjusts point this way even if the scroll
124command leaves point in the window. This variable affects all the
125scroll commands documented in this section, as well as scrolling with
b63a8e8e 126the mouse wheel (@pxref{Mouse Commands}); in general, it affects any
e7a3ff06
CY
127command that has a non-@code{nil} @code{scroll-command} property.
128@xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}.
129
130@vindex scroll-up
131@vindex scroll-down
132@findex scroll-up-line
133@findex scroll-down-line
134 The commands @kbd{M-x scroll-up} and @kbd{M-x scroll-down} behave
135similarly to @code{scroll-up-command} and @code{scroll-down-command},
136except they do not obey @code{scroll-error-top-bottom}. Prior to
137Emacs 24, these were the default commands for scrolling up and down.
138The commands @kbd{M-x scroll-up-line} and @kbd{M-x scroll-down-line}
139scroll the current window by one line at a time. If you intend to use
140any of these commands, you might want to give them key bindings
141(@pxref{Init Rebinding}).
142
143@node Recentering
144@section Recentering
145
146@table @kbd
147@item C-l
148Scroll the selected window so the current line is the center-most text
149line; on subsequent consecutive invocations, make the current line the
150top line, the bottom line, and so on in cyclic order. Possibly
151redisplay the screen too (@code{recenter-top-bottom}).
152
153@item M-x recenter
154Scroll the selected window so the current line is the center-most text
155line. Possibly redisplay the screen too.
156
dc917bd9
RS
157@item C-M-l
158Scroll heuristically to bring useful information onto the screen
159(@code{reposition-window}).
160@end table
161
162@kindex C-l
956c76ef 163@findex recenter-top-bottom
550f41cd
CY
164 The @kbd{C-l} (@code{recenter-top-bottom}) command @dfn{recenters}
165the selected window, scrolling it so that the current screen line is
166exactly in the center of the window, or as close to the center as
167possible.
956c76ef
CY
168
169 Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window
170so that point is on the topmost screen line. Typing a third @kbd{C-l}
171scrolls the window so that point is on the bottom-most screen line.
41859241 172Each successive @kbd{C-l} cycles through these three positions.
91ed7ea8
CY
173
174@vindex recenter-positions
175 You can change the cycling order by customizing the list variable
176@code{recenter-positions}. Each list element should be the symbol
177@code{top}, @code{middle}, or @code{bottom}, or a number; an integer
41859241 178means to move the line to the specified screen line, while a
91ed7ea8 179floating-point number between 0.0 and 1.0 specifies a percentage of
41859241
CY
180the screen space from the top of the window. The default,
181@code{(middle top bottom)}, is the cycling order described above.
182Furthermore, if you change the variable @code{scroll-margin} to a
183non-zero value @var{n}, @kbd{C-l} always leaves at least @var{n}
184screen lines between point and the top or bottom of the window
185(@pxref{Auto Scrolling}).
956c76ef 186
e7a3ff06
CY
187 You can also give @kbd{C-l} a prefix argument. A plain prefix
188argument, @kbd{C-u C-l}, simply recenters point. A positive argument
189@var{n} puts point @var{n} lines down from the top of the window. An
190argument of zero puts point on the topmost line. A negative argument
191@var{-n} puts point @var{n} lines from the bottom of the window. When
192given an argument, @kbd{C-l} does not clear the screen or cycle
193through different screen positions.
dc917bd9 194
666e158e 195@vindex recenter-redisplay
91ed7ea8 196 If the variable @code{recenter-redisplay} has a non-@code{nil}
550f41cd
CY
197value, each invocation of @kbd{C-l} also clears and redisplays the
198screen; the special value @code{tty} (the default) says to do this on
199text-terminal frames only. Redisplaying is useful in case the screen
200becomes garbled for any reason (@pxref{Screen Garbled}).
201
202@findex recenter
41859241 203 The more primitive command @kbd{M-x recenter} behaves like
550f41cd 204@code{recenter-top-bottom}, but does not cycle among screen positions.
666e158e 205
dc917bd9
RS
206@kindex C-M-l
207@findex reposition-window
41859241
CY
208 @kbd{C-M-l} (@code{reposition-window}) scrolls the current window
209heuristically in a way designed to get useful information onto the
210screen. For example, in a Lisp file, this command tries to get the
dc917bd9
RS
211entire current defun onto the screen if possible.
212
43d67313
RS
213@node Auto Scrolling
214@section Automatic Scrolling
215
956c76ef
CY
216 Emacs performs @dfn{automatic scrolling} when point moves out of the
217visible portion of the text.
218
dc917bd9 219@vindex scroll-conservatively
956c76ef
CY
220 Normally, this centers point vertically within the window. However,
221if you set @code{scroll-conservatively} to a small number @var{n},
222then if you move point just a little off the screen (less than @var{n}
223lines), Emacs scrolls the text just far enough to bring point back on
09725d26
EZ
224screen. By default, @code{scroll-conservatively} is@tie{}0. If you
225set @code{scroll-conservatively} to a large number (larger than 100),
226Emacs will never center point as result of scrolling, even if point
227moves far away from the text previously displayed in the window. With
228such a large value, Emacs will always scroll text just enough for
229bringing point into view, so point will end up at the top or bottom of
230the window, depending on the scroll direction.
231
232@vindex scroll-step
233 The variable @code{scroll-step} determines how many lines to scroll
234the window when point moves off the screen. If moving by that number
235of lines fails to bring point back into view, point is centered
236instead. The default value is zero, which causes point to always be
237centered after scrolling.
dc917bd9
RS
238
239@cindex aggressive scrolling
240@vindex scroll-up-aggressively
241@vindex scroll-down-aggressively
6fdebe93
EZ
242 When the window does scroll by a distance longer than
243@code{scroll-step}, you can control how aggressively it scrolls by
244setting the variables @code{scroll-up-aggressively} and
245@code{scroll-down-aggressively}. The value of
246@code{scroll-up-aggressively} should be either @code{nil}, or a
247fraction @var{f} between 0 and 1. A fraction specifies where on the
248screen to put point when scrolling upward, i.e.@: forward. When point
249goes off the window end, the new start position is chosen to put point
250@var{f} parts of the window height from the bottom margin. Thus,
251larger @var{f} means more aggressive scrolling: more new text is
252brought into view. The default value, @code{nil}, is equivalent to
2530.5.
dc917bd9
RS
254
255 Likewise, @code{scroll-down-aggressively} is used for scrolling
6fdebe93
EZ
256down, i.e.@: backward. The value specifies how far point should be
257placed from the top margin of the window; thus, as with
3b361baf 258@code{scroll-up-aggressively}, a larger value is more aggressive.
dc917bd9 259
09725d26
EZ
260 These two variables are ignored if either @code{scroll-step} or
261@code{scroll-conservatively} are set to a non-zero value.
262
dc917bd9
RS
263@vindex scroll-margin
264 The variable @code{scroll-margin} restricts how close point can come
a162959e
GM
265to the top or bottom of a window (even if aggressive scrolling
266specifies a fraction @var{f} that is larger than the window portion
267between the top and the bottom margins). Its value is a number of screen
956c76ef
CY
268lines; if point comes within that many lines of the top or bottom of
269the window, Emacs performs automatic scrolling. By default,
270@code{scroll-margin} is 0.
dc917bd9
RS
271
272@node Horizontal Scrolling
273@section Horizontal Scrolling
274@cindex horizontal scrolling
275
956c76ef 276@vindex auto-hscroll-mode
dc917bd9 277 @dfn{Horizontal scrolling} means shifting all the lines sideways
956c76ef
CY
278within a window, so that some of the text near the left margin is not
279displayed. When the text in a window is scrolled horizontally, text
280lines are truncated rather than continued (@pxref{Line Truncation}).
281If a window shows truncated lines, Emacs performs automatic horizontal
282scrolling whenever point moves off the left or right edge of the
283screen. To disable automatic horizontal scrolling, set the variable
6308321a
EZ
284@code{auto-hscroll-mode} to @code{nil}. Note that when the automatic
285horizontal scrolling is turned off, if point moves off the edge of the
0be641c0
CY
286screen, the cursor disappears to indicate that. (On text terminals,
287the cursor is left at the edge instead.)
956c76ef
CY
288
289@vindex hscroll-margin
290 The variable @code{hscroll-margin} controls how close point can get
6308321a
EZ
291to the window's edges before automatic scrolling occurs. It is
292measured in columns. For example, if the value is 5, then moving
293point within 5 columns of an edge causes horizontal scrolling away
294from that edge.
956c76ef
CY
295
296@vindex hscroll-step
297 The variable @code{hscroll-step} determines how many columns to
298scroll the window when point gets too close to the edge. Zero, the
299default value, means to center point horizontally within the window.
300A positive integer value specifies the number of columns to scroll by.
301A floating-point number specifies the fraction of the window's width
302to scroll by.
303
304 You can also perform explicit horizontal scrolling with the
305following commands:
dc917bd9
RS
306
307@table @kbd
308@item C-x <
309Scroll text in current window to the left (@code{scroll-left}).
310@item C-x >
311Scroll to the right (@code{scroll-right}).
312@end table
313
314@kindex C-x <
315@kindex C-x >
316@findex scroll-left
317@findex scroll-right
6308321a
EZ
318 @kbd{C-x <} (@code{scroll-left}) scrolls text in the selected window
319to the left by the full width of the window, less two columns. (In
320other words, the text in the window moves left relative to the
321window.) With a numeric argument @var{n}, it scrolls by @var{n}
322columns.
323
324 If the text is scrolled to the left, and point moves off the left
325edge of the window, the cursor will freeze at the left edge of the
326window, until point moves back to the displayed portion of the text.
327This is independent of the current setting of
328@code{auto-hscroll-mode}, which, for text scrolled to the left, only
329affects the behavior at the right edge of the window.
956c76ef
CY
330
331 @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right.
332The window cannot be scrolled any farther to the right once it is
333displayed normally, with each line starting at the window's left
334margin; attempting to do so has no effect. This means that you don't
335have to calculate the argument precisely for @w{@kbd{C-x >}}; any
336sufficiently large argument will restore the normal display.
dc917bd9
RS
337
338 If you use those commands to scroll a window horizontally, that sets
339a lower bound for automatic horizontal scrolling. Automatic scrolling
340will continue to scroll the window, but never farther to the right
341than the amount you previously set by @code{scroll-left}.
342
f404f8bc
CY
343@node Narrowing
344@section Narrowing
345@cindex widening
346@cindex restriction
347@cindex narrowing
348@cindex accessible portion
349
350 @dfn{Narrowing} means focusing in on some portion of the buffer,
351making the rest temporarily inaccessible. The portion which you can
352still get to is called the @dfn{accessible portion}. Canceling the
353narrowing, which makes the entire buffer once again accessible, is
354called @dfn{widening}. The bounds of narrowing in effect in a buffer
355are called the buffer's @dfn{restriction}.
356
357 Narrowing can make it easier to concentrate on a single subroutine or
358paragraph by eliminating clutter. It can also be used to limit the
359range of operation of a replace command or repeating keyboard macro.
360
361@table @kbd
362@item C-x n n
363Narrow down to between point and mark (@code{narrow-to-region}).
364@item C-x n w
365Widen to make the entire buffer accessible again (@code{widen}).
366@item C-x n p
367Narrow down to the current page (@code{narrow-to-page}).
368@item C-x n d
369Narrow down to the current defun (@code{narrow-to-defun}).
370@end table
371
372 When you have narrowed down to a part of the buffer, that part appears
373to be all there is. You can't see the rest, you can't move into it
374(motion commands won't go outside the accessible part), you can't change
375it in any way. However, it is not gone, and if you save the file all
376the inaccessible text will be saved. The word @samp{Narrow} appears in
377the mode line whenever narrowing is in effect.
378
379@kindex C-x n n
380@findex narrow-to-region
381 The primary narrowing command is @kbd{C-x n n} (@code{narrow-to-region}).
382It sets the current buffer's restrictions so that the text in the current
383region remains accessible, but all text before the region or after the
384region is inaccessible. Point and mark do not change.
385
386@kindex C-x n p
387@findex narrow-to-page
388@kindex C-x n d
389@findex narrow-to-defun
390 Alternatively, use @kbd{C-x n p} (@code{narrow-to-page}) to narrow
391down to the current page. @xref{Pages}, for the definition of a page.
392@kbd{C-x n d} (@code{narrow-to-defun}) narrows down to the defun
393containing point (@pxref{Defuns}).
394
395@kindex C-x n w
396@findex widen
397 The way to cancel narrowing is to widen with @kbd{C-x n w}
398(@code{widen}). This makes all text in the buffer accessible again.
399
400 You can get information on what part of the buffer you are narrowed down
401to using the @kbd{C-x =} command. @xref{Position Info}.
402
403 Because narrowing can easily confuse users who do not understand it,
404@code{narrow-to-region} is normally a disabled command. Attempting to use
405this command asks for confirmation and gives you the option of enabling it;
406if you enable the command, confirmation will no longer be required for
407it. @xref{Disabling}.
408
a6326082
CY
409@node View Mode
410@section View Mode
411@cindex View mode
412@cindex mode, View
413
41859241
CY
414@kindex s @r{(View mode)}
415@kindex SPC @r{(View mode)}
416@kindex DEL @r{(View mode)}
a6326082
CY
417 View mode is a minor mode that lets you scan a buffer by sequential
418screenfuls. It provides commands for scrolling through the buffer
419conveniently but not for changing it. Apart from the usual Emacs
420cursor motion commands, you can type @key{SPC} to scroll forward one
e2aeef63
CY
421windowful, @key{DEL} to scroll backward, and @kbd{s} to start an
422incremental search.
a6326082 423
41859241
CY
424@kindex q @r{(View mode)}
425@kindex e @r{(View mode)}
426@findex View-quit
427@findex View-exit
428 Typing @kbd{q} (@code{View-quit}) disables View mode, and switches
429back to the buffer and position before View mode was enabled. Typing
430@kbd{e} (@code{View-exit}) disables View mode, keeping the current
431buffer and position.
a6326082
CY
432
433@findex view-buffer
434@findex view-file
435 @kbd{M-x view-buffer} prompts for an existing Emacs buffer, switches
436to it, and enables View mode. @kbd{M-x view-file} prompts for a file
437and visits it with View mode enabled.
438
dc917bd9
RS
439@node Follow Mode
440@section Follow Mode
441@cindex Follow mode
442@cindex mode, Follow
443@findex follow-mode
444@cindex windows, synchronizing
445@cindex synchronizing windows
446
447 @dfn{Follow mode} is a minor mode that makes two windows, both
16152b76 448showing the same buffer, scroll as a single tall ``virtual window''.
dc917bd9
RS
449To use Follow mode, go to a frame with just one window, split it into
450two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x
451follow-mode}. From then on, you can edit the buffer in either of the
452two windows, or scroll either one; the other window follows it.
453
454 In Follow mode, if you move point outside the portion visible in one
455window and into the portion visible in the other window, that selects
456the other window---again, treating the two as if they were parts of
457one large window.
458
459 To turn off Follow mode, type @kbd{M-x follow-mode} a second time.
460
b8f3a9e3 461@node Faces
8863a584 462@section Text Faces
b8f3a9e3
GM
463@cindex faces
464
d366bd53 465 Emacs can display text in several different styles, called
0015d677 466@dfn{faces}. Each face can specify various @dfn{face attributes},
d366bd53
CY
467such as the font, height, weight, slant, foreground and background
468color, and underlining or overlining. Most major modes assign faces
469to the text automatically, via Font Lock mode. @xref{Font Lock}, for
470more information about how these faces are assigned.
471
472@findex list-faces-display
473 To see what faces are currently defined, and what they look like,
474type @kbd{M-x list-faces-display}. With a prefix argument, this
475prompts for a regular expression, and displays only faces with names
476matching that regular expression (@pxref{Regexps}).
477
35b6586e 478@vindex frame-background-mode
d366bd53 479 It's possible for a given face to look different in different
0be641c0
CY
480frames. For instance, some text terminals do not support all face
481attributes, particularly font, height, and width, and some support a
35b6586e
CY
482limited range of colors. In addition, most Emacs faces are defined so
483that their attributes are different on light and dark frame
484backgrounds, for reasons of legibility. By default, Emacs
485automatically chooses which set of face attributes to display on each
486frame, based on the frame's current background color. However, you
487can override this by giving the variable @code{frame-background-mode}
488a non-@code{nil} value. A value of @code{dark} makes Emacs treat all
489frames as if they have a dark background, whereas a value of
490@code{light} makes it treat all frames as if they have a light
491background.
b8f3a9e3 492
d366bd53
CY
493@cindex background color
494@cindex default face
35b6586e
CY
495 You can customize a face to alter its attributes, and save those
496customizations for future Emacs sessions. @xref{Face Customization},
497for details.
06848b82
CY
498
499 The @code{default} face is the default for displaying text, and all
500of its attributes are specified. Its background color is also used as
2680c309 501the frame's background color. @xref{Colors}.
06848b82
CY
502
503@cindex cursor face
504 Another special face is the @code{cursor} face. On graphical
505displays, the background color of this face is used to draw the text
506cursor. None of the other attributes of this face have any effect;
507the foreground color for text under the cursor is taken from the
508background color of the underlying text. On text terminals, the
509appearance of the text cursor is determined by the terminal, not by
510the @code{cursor} face.
d366bd53
CY
511
512 You can also use X resources to specify attributes of any particular
513face. @xref{Resources}.
956c76ef 514
8863a584
CY
515 Emacs can display variable-width fonts, but some Emacs commands,
516particularly indentation commands, do not account for variable
517character display widths. Therefore, we recommend not using
518variable-width fonts for most faces, particularly those assigned by
519Font Lock mode.
520
521@node Colors
522@section Colors for Faces
523@cindex color name
524@cindex RGB triplet
525
526 Faces can have various foreground and background colors. When you
527specify a color for a face---for instance, when customizing the face
528(@pxref{Face Customization})---you can use either a @dfn{color name}
529or an @dfn{RGB triplet}.
530
531@findex list-colors-display
b7314ef7 532@vindex list-colors-sort
8863a584
CY
533 A color name is a pre-defined name, such as @samp{dark orange} or
534@samp{medium sea green}. To view a list of color names, type @kbd{M-x
b7314ef7
GM
535list-colors-display}. To control the order in which colors are shown,
536customize @code{list-colors-sort}. If you run this command on a
0be641c0
CY
537graphical display, it shows the full range of color names known to
538Emacs (these are the standard X11 color names, defined in X's
539@file{rgb.txt} file). If you run the command on a text terminal, it
540shows only a small subset of colors that can be safely displayed on
541such terminals. However, Emacs understands X11 color names even on
542text terminals; if a face is given a color specified by an X11 color
543name, it is displayed using the closest-matching terminal color.
8863a584
CY
544
545 An RGB triplet is a string of the form @samp{#RRGGBB}. Each of the
546R, G, and B components is a hexadecimal number specifying the
547component's relative intensity, one to four digits long (usually two
548digits are used). The components must have the same number of digits.
549For hexadecimal values A to F, either upper or lower case are
550acceptable.
551
552 The @kbd{M-x list-colors-display} command also shows the equivalent
553RGB triplet for each named color. For instance, @samp{medium sea
554green} is equivalent to @samp{#3CB371}.
555
556@cindex face colors, setting
956c76ef
CY
557@findex set-face-foreground
558@findex set-face-background
8863a584
CY
559 You can change the foreground and background colors of a face with
560@kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}.
561These commands prompt in the minibuffer for a face name and a color,
562with completion, and then set that face to use the specified color.
d366bd53
CY
563They affect the face colors on all frames, but their effects do not
564persist for future Emacs sessions, unlike using the customization
565buffer or X resources. You can also use frame parameters to set
8863a584 566foreground and background colors for a specific frame; @xref{Frame
d366bd53
CY
567Parameters}.
568
43d08eb9
RS
569@node Standard Faces
570@section Standard Faces
571
54952612
RS
572 Here are the standard faces for specifying text appearance. You can
573apply them to specific text when you want the effects they produce.
b8f3a9e3
GM
574
575@table @code
576@item default
54952612 577This face is used for ordinary text that doesn't specify any face.
d366bd53 578Its background color is used as the frame's background color.
43d08eb9 579@item bold
956c76ef 580This face uses a bold variant of the default font.
43d08eb9 581@item italic
956c76ef 582This face uses an italic variant of the default font.
43d08eb9 583@item bold-italic
956c76ef 584This face uses a bold italic variant of the default font.
43d08eb9
RS
585@item underline
586This face underlines text.
587@item fixed-pitch
956c76ef
CY
588This face forces use of a fixed-width font. It's reasonable to
589customize this face to use a different fixed-width font, if you like,
590but you should not make it a variable-width font.
43d08eb9 591@item variable-pitch
956c76ef 592This face forces use of a variable-width font.
3b91a16d
JL
593@item shadow
594This face is used for making the text less noticeable than the surrounding
595ordinary text. Usually this can be achieved by using shades of gray in
596contrast with either black or white default foreground color.
43d08eb9
RS
597@end table
598
599 Here's an incomplete list of faces used to highlight parts of the
600text temporarily for specific purposes. (Many other modes define
601their own faces for this purpose.)
602
603@table @code
604@item highlight
d366bd53
CY
605This face is used for text highlighting in various contexts, such as
606when the mouse cursor is moved over a hyperlink.
43d08eb9 607@item isearch
d366bd53 608This face is used to highlight the current Isearch match
956c76ef 609(@pxref{Incremental Search}).
54952612 610@item query-replace
d366bd53 611This face is used to highlight the current Query Replace match
956c76ef 612(@pxref{Replace}).
43d08eb9 613@item lazy-highlight
d366bd53
CY
614This face is used to highlight ``lazy matches'' for Isearch and Query
615Replace (matches other than the current one).
43d08eb9 616@item region
d366bd53
CY
617This face is used for displaying an active region (@pxref{Mark}).
618When Emacs is built with GTK support, its colors are taken from the
619current GTK theme.
43d08eb9
RS
620@item secondary-selection
621This face is used for displaying a secondary X selection (@pxref{Secondary
622Selection}).
623@item trailing-whitespace
3b91a16d 624The face for highlighting excess spaces and tabs at the end of a line
d366bd53
CY
625when @code{show-trailing-whitespace} is non-@code{nil} (@pxref{Useless
626Whitespace}).
43d08eb9 627@item escape-glyph
d366bd53
CY
628The face for displaying control characters and escape sequences
629(@pxref{Text Display}).
630@item nobreak-space
939db9ac 631The face for displaying ``no-break'' space characters (@pxref{Text
d366bd53 632Display}).
43d08eb9
RS
633@end table
634
d366bd53
CY
635 The following faces control the appearance of parts of the Emacs
636frame:
43d08eb9
RS
637
638@table @code
b8f3a9e3 639@item mode-line
3b91a16d
JL
640This face is used for the mode line of the currently selected window,
641and for menu bars when toolkit menus are not used. By default, it's
54952612 642drawn with shadows for a ``raised'' effect on graphical displays, and
3b91a16d 643drawn as the inverse of the default face on non-windowed terminals.
b9e58bf2
EZ
644@item mode-line-inactive
645Like @code{mode-line}, but used for mode lines of the windows other
646than the selected one (if @code{mode-line-in-non-selected-windows} is
ac6875fc
RS
647non-@code{nil}). This face inherits from @code{mode-line}, so changes
648in that face affect mode lines in all windows.
d545c9fd
JL
649@item mode-line-highlight
650Like @code{highlight}, but used for portions of text on mode lines.
651@item mode-line-buffer-id
652This face is used for buffer identification parts in the mode line.
b8f3a9e3 653@item header-line
54952612
RS
654Similar to @code{mode-line} for a window's header line, which appears
655at the top of a window just as the mode line appears at the bottom.
656Most windows do not have a header line---only some special modes, such
657Info mode, create one.
53abc3bf 658@item vertical-border
0be641c0
CY
659This face is used for the vertical divider between windows on text
660terminals.
3094ad7a 661@item minibuffer-prompt
3b91a16d
JL
662@cindex @code{minibuffer-prompt} face
663@vindex minibuffer-prompt-properties
3094ad7a 664This face is used for the prompt strings displayed in the minibuffer.
3b91a16d
JL
665By default, Emacs automatically adds this face to the value of
666@code{minibuffer-prompt-properties}, which is a list of text
43d67313
RS
667properties used to display the prompt text. (This variable takes
668effect when you enter the minibuffer.)
b8f3a9e3 669@item fringe
3b91a16d 670@cindex @code{fringe} face
b8f3a9e3
GM
671The face for the fringes to the left and right of windows on graphic
672displays. (The fringes are the narrow portions of the Emacs frame
940627fe 673between the text area and the window's right and left borders.)
43d08eb9 674@xref{Fringes}.
b8f3a9e3 675@item cursor
939db9ac
CY
676The @code{:background} attribute of this face specifies the color of
677the text cursor. @xref{Cursor Display}.
d366bd53
CY
678@item tooltip
679This face is used for tooltip text. By default, if Emacs is built
680with GTK support, tooltips are drawn via GTK and this face has no
681effect. @xref{Tooltips}.
b8f3a9e3
GM
682@item mouse
683This face determines the color of the mouse pointer.
d366bd53
CY
684@end table
685
686 The following faces likewise control the appearance of parts of the
0be641c0
CY
687Emacs frame, but only on text terminals, or when Emacs is built on X
688with no toolkit support. (For all other cases, the appearance of the
689respective frame elements is determined by system-wide settings.)
d366bd53
CY
690
691@table @code
692@item scroll-bar
693This face determines the visual appearance of the scroll bar.
694@xref{Scroll Bars}.
b8f3a9e3 695@item tool-bar
54952612 696This face determines the color of tool bar icons. @xref{Tool Bars}.
b8f3a9e3 697@item menu
9e6bb19f
EZ
698@cindex menu bar appearance
699@cindex @code{menu} face, no effect if customized
700@cindex customization of @code{menu} face
701This face determines the colors and font of Emacs's menus. @xref{Menu
d366bd53 702Bars}.
b8f3a9e3
GM
703@end table
704
d366bd53
CY
705@node Text Scale
706@section Text Scale
956c76ef
CY
707
708@cindex adjust buffer face height
709@findex text-scale-adjust
710@kindex C-x C-+
711@kindex C-x C--
712@kindex C-x C-=
713@kindex C-x C-0
714 To increase the height of the default face in the current buffer,
715type @kbd{C-x C-+} or @kbd{C-x C-=}. To decrease it, type @kbd{C-x
716C--}. To restore the default (global) face height, type @kbd{C-x
717C-0}. These keys are all bound to the same command,
718@code{text-scale-adjust}, which looks at the last key typed to
719determine which action to take.
720
721 The final key of these commands may be repeated without the leading
722@kbd{C-x}. For instance, @kbd{C-x C-= C-= C-=} increases the face
d366bd53
CY
723height by three steps. Each step scales the text height by a factor
724of 1.2; to change this factor, customize the variable
725@code{text-scale-mode-step}. As an exception, a numeric argument of 0
726to the @code{text-scale-adjust} command restores the default height,
727similar to typing @kbd{C-x C-0}.
956c76ef
CY
728
729@cindex increase buffer face height
730@findex text-scale-increase
731@cindex decrease buffer face height
732@findex text-scale-decrease
733 The commands @code{text-scale-increase} and
734@code{text-scale-decrease} increase or decrease the height of the
735default face, just like @kbd{C-x C-+} and @kbd{C-x C--} respectively.
736You may find it convenient to bind to these commands, rather than
737@code{text-scale-adjust}.
738
05fbc4a9
MB
739@cindex set buffer face height
740@findex text-scale-set
d366bd53
CY
741 The command @code{text-scale-set} scales the height of the default
742face in the current buffer to an absolute level specified by its
743prefix argument.
05fbc4a9 744
956c76ef 745@findex text-scale-mode
d366bd53
CY
746 The above commands automatically enable the minor mode
747@code{text-scale-mode} if the current font scaling is other than 1,
748and disable it otherwise.
956c76ef 749
b8f3a9e3
GM
750@node Font Lock
751@section Font Lock mode
752@cindex Font Lock mode
753@cindex mode, Font Lock
754@cindex syntax highlighting and coloring
755
8cc11660 756 Font Lock mode is a minor mode, always local to a particular buffer,
d366bd53
CY
757which assigns faces to (or @dfn{fontifies}) the text in the buffer.
758Each buffer's major mode tells Font Lock mode which text to fontify;
759for instance, programming language modes fontify syntactically
760relevant constructs like comments, strings, and function names.
b8f3a9e3
GM
761
762@findex font-lock-mode
d366bd53
CY
763 Font Lock mode is enabled by default. To toggle it in the current
764buffer, type @kbd{M-x font-lock-mode}. A positive numeric argument
765unconditionally enables Font Lock mode, and a negative or zero
766argument disables it.
b8f3a9e3
GM
767
768@findex global-font-lock-mode
769@vindex global-font-lock-mode
166bc0c8
CY
770 Type @kbd{M-x global-font-lock-mode} to toggle Font Lock mode in all
771buffers. To impose this setting for future Emacs sessions, customize
772the variable @code{global-font-lock-mode} (@pxref{Easy
773Customization}), or add the following line to your init file:
b8f3a9e3
GM
774
775@example
c4e8acbc 776(global-font-lock-mode 0)
b8f3a9e3
GM
777@end example
778
d366bd53
CY
779@noindent
780If you have disabled Global Font Lock mode, you can still enable Font
54952612 781Lock for specific major modes by adding the function
6e317956
CY
782@code{font-lock-mode} to the mode hooks (@pxref{Hooks}). For example,
783to enable Font Lock mode for editing C files, you can do this:
c4e8acbc
CY
784
785@example
6e317956 786(add-hook 'c-mode-hook 'font-lock-mode)
c4e8acbc 787@end example
0015d677 788
b8f3a9e3
GM
789 Font Lock mode uses several specifically named faces to do its job,
790including @code{font-lock-string-face}, @code{font-lock-comment-face},
54952612
RS
791and others. The easiest way to find them all is to use @kbd{M-x
792customize-group @key{RET} font-lock-faces @key{RET}}. You can then
793use that customization buffer to customize the appearance of these
794faces. @xref{Face Customization}.
b8f3a9e3 795
b8f3a9e3 796@vindex font-lock-maximum-decoration
d366bd53
CY
797 You can customize the variable @code{font-lock-maximum-decoration}
798to alter the amount of fontification applied by Font Lock mode, for
799major modes that support this feature. The value should be a number
800(with 1 representing a minimal amount of fontification; some modes
801support levels as high as 3); or @code{t}, meaning ``as high as
802possible'' (the default). You can also specify different numbers for
803particular major modes; for example, to use level 1 for C/C++ modes,
804and the default level otherwise, use the value
b8f3a9e3
GM
805
806@example
d366bd53 807'((c-mode . 1) (c++-mode . 1)))
b8f3a9e3
GM
808@end example
809
b8f3a9e3 810@vindex font-lock-beginning-of-syntax-function
e07e854d
EZ
811@cindex incorrect fontification
812@cindex parenthesis in column zero and fontification
813@cindex brace in column zero and fontification
b8f3a9e3
GM
814 Comment and string fontification (or ``syntactic'' fontification)
815relies on analysis of the syntactic structure of the buffer text. For
174862cf
RS
816the sake of speed, some modes, including Lisp mode, rely on a special
817convention: an open-parenthesis or open-brace in the leftmost column
d366bd53 818always defines the beginning of a defun, and is thus always outside
20db1522 819any string or comment. Therefore, you should avoid placing an
d366bd53
CY
820open-parenthesis or open-brace in the leftmost column, if it is inside
821a string or comment. @xref{Left Margin Paren}, for details.
b8f3a9e3 822
6bb2ed9b 823@cindex slow display during scrolling
ae742cb5
CY
824 The variable @code{font-lock-beginning-of-syntax-function}, which is
825always buffer-local, specifies how Font Lock mode can find a position
826guaranteed to be outside any comment or string. In modes which use
827the leftmost column parenthesis convention, the default value of the
828variable is @code{beginning-of-defun}---that tells Font Lock mode to
829use the convention. If you set this variable to @code{nil}, Font Lock
830no longer relies on the convention. This avoids incorrect results,
831but the price is that, in some cases, fontification for a changed text
832must rescan buffer text from the beginning of the buffer. This can
833considerably slow down redisplay while scrolling, particularly if you
834are close to the end of a large buffer.
b8f3a9e3
GM
835
836@findex font-lock-add-keywords
d366bd53
CY
837 Font Lock highlighting patterns already exist for most modes, but
838you may want to fontify additional patterns. You can use the function
839@code{font-lock-add-keywords}, to add your own highlighting patterns
840for a particular mode. For example, to highlight @samp{FIXME:} words
841in C comments, use this:
b8f3a9e3
GM
842
843@example
a152877d
SM
844(add-hook 'c-mode-hook
845 (lambda ()
846 (font-lock-add-keywords nil
ae742cb5
CY
847 '(("\\<\\(FIXME\\):" 1
848 font-lock-warning-face t)))))
b8f3a9e3
GM
849@end example
850
4063fff3 851@findex font-lock-remove-keywords
d366bd53
CY
852@noindent
853To remove keywords from the font-lock highlighting patterns, use the
cd77ce13 854function @code{font-lock-remove-keywords}. @xref{Search-based
956c76ef 855Fontification,,, elisp, The Emacs Lisp Reference Manual}.
4063fff3 856
3be9b0ca
EZ
857@cindex just-in-time (JIT) font-lock
858@cindex background syntax highlighting
859 Fontifying large buffers can take a long time. To avoid large
d366bd53
CY
860delays when a file is visited, Emacs initially fontifies only the
861visible portion of a buffer. As you scroll through the buffer, each
862portion that becomes visible is fontified as soon as it is displayed;
863this type of Font Lock is called @dfn{Just-In-Time} (or @dfn{JIT})
864Lock. You can control how JIT Lock behaves, including telling it to
865perform fontification while idle, by customizing variables in the
956c76ef 866customization group @samp{jit-lock}. @xref{Specific Customization}.
3be9b0ca 867
b8f3a9e3 868@node Highlight Interactively
54952612 869@section Interactive Highlighting
b8f3a9e3
GM
870@cindex highlighting by matching
871@cindex interactive highlighting
54952612 872@cindex Highlight Changes mode
b8f3a9e3 873
54952612 874@findex highlight-changes-mode
956c76ef 875Highlight Changes mode is a minor mode that @dfn{highlights} the parts
d366bd53 876of the buffer that were changed most recently, by giving that text a
956c76ef
CY
877different face. To enable or disable Highlight Changes mode, use
878@kbd{M-x highlight-changes-mode}.
b8f3a9e3 879
54952612 880@cindex Hi Lock mode
b8f3a9e3 881@findex hi-lock-mode
956c76ef
CY
882 Hi Lock mode is a minor mode that highlights text that matches
883regular expressions you specify. For example, you can use it to
884highlight all the references to a certain variable in a program source
885file, highlight certain parts in a voluminous output of some program,
886or highlight certain names in an article. To enable or disable Hi
887Lock mode, use the command @kbd{M-x hi-lock-mode}. To enable Hi Lock
888mode for all buffers, use @kbd{M-x global-hi-lock-mode} or place
889@code{(global-hi-lock-mode 1)} in your @file{.emacs} file.
54952612
RS
890
891 Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except
892that you specify explicitly the regular expressions to highlight. You
893control them with these commands:
b8f3a9e3
GM
894
895@table @kbd
896@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
897@kindex C-x w h
898@findex highlight-regexp
cedf175b 899Highlight text that matches @var{regexp} using face @var{face}
54952612
RS
900(@code{highlight-regexp}). The highlighting will remain as long as
901the buffer is loaded. For example, to highlight all occurrences of
902the word ``whim'' using the default face (a yellow background)
903@kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for
904highlighting, Hi Lock provides several of its own and these are
29a483ac
JL
905pre-loaded into a list of default values. While being prompted
906for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
54952612
RS
907
908You can use this command multiple times, specifying various regular
909expressions to highlight in different ways.
b8f3a9e3
GM
910
911@item C-x w r @var{regexp} @key{RET}
912@kindex C-x w r
913@findex unhighlight-regexp
630acdcc 914Unhighlight @var{regexp} (@code{unhighlight-regexp}).
54952612
RS
915
916If you invoke this from the menu, you select the expression to
917unhighlight from a list. If you invoke this from the keyboard, you
918use the minibuffer. It will show the most recently added regular
919expression; use @kbd{M-p} to show the next older expression and
920@kbd{M-n} to select the next newer expression. (You can also type the
921expression by hand, with completion.) When the expression you want to
922unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit
923the minibuffer and unhighlight it.
b8f3a9e3
GM
924
925@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
926@kindex C-x w l
927@findex highlight-lines-matching-regexp
928@cindex lines, highlighting
929@cindex highlighting lines of text
04d0b662 930Highlight entire lines containing a match for @var{regexp}, using face
b8f3a9e3
GM
931@var{face} (@code{highlight-lines-matching-regexp}).
932
933@item C-x w b
934@kindex C-x w b
935@findex hi-lock-write-interactive-patterns
936Insert all the current highlighting regexp/face pairs into the buffer
937at point, with comment delimiters to prevent them from changing your
54952612
RS
938program. (This key binding runs the
939@code{hi-lock-write-interactive-patterns} command.)
b8f3a9e3 940
3173ce7e
RS
941These patterns are extracted from the comments, if appropriate, if you
942invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while
943Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}).
b8f3a9e3
GM
944
945@item C-x w i
946@kindex C-x w i
947@findex hi-lock-find-patterns
3173ce7e
RS
948Extract regexp/face pairs from comments in the current buffer
949(@code{hi-lock-find-patterns}). Thus, you can enter patterns
950interactively with @code{highlight-regexp}, store them into the file
951with @code{hi-lock-write-interactive-patterns}, edit them (perhaps
cedf175b 952including different faces for different parenthesized parts of the
3173ce7e
RS
953match), and finally use this command (@code{hi-lock-find-patterns}) to
954have Hi Lock highlight the edited patterns.
b8f3a9e3 955
3173ce7e 956@vindex hi-lock-file-patterns-policy
d439bcd8 957The variable @code{hi-lock-file-patterns-policy} controls whether Hi
0419b8d6
GM
958Lock mode should automatically extract and highlight patterns found in a
959file when it is visited. Its value can be @code{nil} (never highlight),
960@code{ask} (query the user), or a function. If it is a function,
961@code{hi-lock-find-patterns} calls it with the patterns as argument; if
962the function returns non-@code{nil}, the patterns are used. The default
963is @code{ask}. Note that patterns are always highlighted if you call
964@code{hi-lock-find-patterns} directly, regardless of the value of this
965variable.
3173ce7e
RS
966
967@vindex hi-lock-exclude-modes
968Also, @code{hi-lock-find-patterns} does nothing if the current major
969mode's symbol is a member of the list @code{hi-lock-exclude-modes}.
b8f3a9e3
GM
970@end table
971
fad78d58
RS
972@node Fringes
973@section Window Fringes
974@cindex fringes
975
939db9ac
CY
976@findex set-fringe-style
977@findex fringe-mode
978 On graphical displays, each Emacs window normally has narrow
956c76ef
CY
979@dfn{fringes} on the left and right edges. The fringes are used to
980display symbols that provide information about the text in the window.
939db9ac
CY
981You can type @kbd{M-x fringe-mode} to disable the fringes, or modify
982their width. This command affects fringes in all frames; to modify
983fringes on the selected frame only, use @kbd{M-x set-fringe-style}.
fad78d58
RS
984
985 The most common use of the fringes is to indicate a continuation
d366bd53
CY
986line (@pxref{Continuation Lines}). When one line of text is split
987into multiple screen lines, the left fringe shows a curving arrow for
988each screen line except the first, indicating that ``this is not the
16152b76 989real beginning''. The right fringe shows a curving arrow for each
d366bd53 990screen line except the last, indicating that ``this is not the real
16152b76 991end''. If the line's direction is right-to-left (@pxref{Bidirectional
d366bd53 992Editing}), the meanings of the curving arrows in the fringes are
34313041 993swapped.
fad78d58 994
566da2e7 995 The fringes indicate line truncation with short horizontal arrows
fad78d58 996meaning ``there's more text on this line which is scrolled
16152b76 997horizontally out of view''. Clicking the mouse on one of the arrows
d366bd53
CY
998scrolls the display horizontally in the direction of the arrow.
999
1000 The fringes can also indicate other things, such as buffer
1001boundaries (@pxref{Displaying Boundaries}), and where a program you
1002are debugging is executing (@pxref{Debuggers}).
fad78d58 1003
939db9ac
CY
1004@vindex overflow-newline-into-fringe
1005 The fringe is also used for drawing the cursor, if the current line
1006is exactly as wide as the window and point is at the end of the line.
1007To disable this, change the variable
1008@code{overflow-newline-into-fringe} to @code{nil}; this causes Emacs
1009to continue or truncate lines that are exactly as wide as the window.
fad78d58 1010
9d2908a6
RS
1011@node Displaying Boundaries
1012@section Displaying Boundaries
1013
1014@vindex indicate-buffer-boundaries
939db9ac 1015 On graphical displays, Emacs can indicate the buffer boundaries in
d366bd53
CY
1016the fringes. If you enable this feature, the first line and the last
1017line are marked with angle images in the fringes. This can be
1018combined with up and down arrow images which say whether it is
1019possible to scroll the window.
9d2908a6
RS
1020
1021 The buffer-local variable @code{indicate-buffer-boundaries} controls
1022how the buffer boundaries and window scrolling is indicated in the
1023fringes. If the value is @code{left} or @code{right}, both angle and
1024arrow bitmaps are displayed in the left or right fringe, respectively.
1025
1026 If value is an alist, each element @code{(@var{indicator} .
1027@var{position})} specifies the position of one of the indicators.
1028The @var{indicator} must be one of @code{top}, @code{bottom},
1029@code{up}, @code{down}, or @code{t} which specifies the default
1030position for the indicators not present in the alist.
1031The @var{position} is one of @code{left}, @code{right}, or @code{nil}
1032which specifies not to show this indicator.
1033
1034 For example, @code{((top . left) (t . right))} places the top angle
1035bitmap in left fringe, the bottom angle bitmap in right fringe, and
1036both arrow bitmaps in right fringe. To show just the angle bitmaps in
1037the left fringe, but no arrow bitmaps, use @code{((top . left)
1038(bottom . left))}.
1039
fad78d58
RS
1040@node Useless Whitespace
1041@section Useless Whitespace
1042
1043@cindex trailing whitespace
1044@cindex whitespace, trailing
1045@vindex show-trailing-whitespace
1046 It is easy to leave unnecessary spaces at the end of a line, or
48de8b12
CY
1047empty lines at the end of a buffer, without realizing it. In most
1048cases, this @dfn{trailing whitespace} has no effect, but sometimes it
1049can be a nuisance.
fad78d58 1050
956c76ef
CY
1051 You can make trailing whitespace at the end of a line visible by
1052setting the buffer-local variable @code{show-trailing-whitespace} to
1053@code{t}. Then Emacs displays trailing whitespace, using the face
1054@code{trailing-whitespace}.
fad78d58
RS
1055
1056 This feature does not apply when point is at the end of the line
1057containing the whitespace. Strictly speaking, that is ``trailing
1058whitespace'' nonetheless, but displaying it specially in that case
1059looks ugly while you are typing in new text. In this special case,
1060the location of point is enough to show you that the spaces are
1061present.
1062
1063@findex delete-trailing-whitespace
48de8b12 1064@vindex delete-trailing-lines
d366bd53 1065 Type @kbd{M-x delete-trailing-whitespace} to delete all trailing
48de8b12
CY
1066whitespace. This command deletes all extra spaces at the end of each
1067line in the buffer, and all empty lines at the end of the buffer; to
1068ignore the latter, change the varaible @code{delete-trailing-lines} to
1069@code{nil}. If the region is active, the command instead deletes
1070extra spaces at the end of each line in the region.
fad78d58 1071
23e3383d 1072@vindex indicate-empty-lines
877db12e
RS
1073@cindex unused lines
1074@cindex fringes, and unused line indication
d366bd53
CY
1075 On graphical displays, Emacs can indicate unused lines at the end of
1076the window with a small image in the left fringe (@pxref{Fringes}).
8863a584
CY
1077The image appears for screen lines that do not correspond to any
1078buffer text, so blank lines at the end of the buffer stand out because
1079they lack this image. To enable this feature, set the buffer-local
1080variable @code{indicate-empty-lines} to a non-@code{nil} value. You
1081can enable or disable this feature for all new buffers by setting the
1082default value of this variable, e.g.@: @code{(setq-default
1083indicate-empty-lines t)}.
fad78d58 1084
e490b289
CY
1085@cindex Whitespace mode
1086@cindex mode, Whitespace
1087@findex whitespace-mode
1088@vindex whitespace-style
1089 Whitespace mode is a buffer-local minor mode that lets you
1090``visualize'' many kinds of whitespace in the buffer, by either
1091drawing the whitespace characters with a special face or displaying
1092them as special glyphs. To toggle this mode, type @kbd{M-x
1093whitespace-mode}. The kinds of whitespace visualized are determined
1094by the list variable @code{whitespace-style}. Here is a partial list
1095of possible elements (see the variable's documentation for the full
1096list):
1097
1098@table @code
1099@item face
1100Enable all visualizations which use special faces. This element has a
27e428e7 1101special meaning: if it is absent from the list, none of the other
e490b289
CY
1102visualizations take effect except @code{space-mark}, @code{tab-mark},
1103and @code{newline-mark}.
1104
1105@item trailing
1106Highlight trailing whitespace.
1107
1108@item tabs
1109Highlight tab characters.
1110
1111@item spaces
1112Highlight space and non-breaking space characters.
1113
1114@item lines
1115@vindex whitespace-line-column
1116Highlight lines longer than 80 lines. To change the column limit,
1117customize the variable @code{whitespace-line-column}.
1118
1119@item newline
1120Highlight newlines.
1121
1122@item empty
1123Highlight empty lines.
1124
1125@item space-mark
1126Draw space and non-breaking characters with a special glyph.
1127
1128@item tab-mark
1129Draw tab characters with a special glyph.
1130
1131@item newline-mark
1132Draw newline characters with a special glyph.
1133@end table
1134
6bf7aab6
DL
1135@node Selective Display
1136@section Selective Display
4946337d 1137@cindex selective display
6bf7aab6
DL
1138@findex set-selective-display
1139@kindex C-x $
1140
956c76ef
CY
1141 Emacs has the ability to hide lines indented more than a given
1142number of columns. You can use this to get an overview of a part of a
1143program.
6bf7aab6 1144
d239287a
LT
1145 To hide lines in the current buffer, type @kbd{C-x $}
1146(@code{set-selective-display}) with a numeric argument @var{n}. Then
1147lines with at least @var{n} columns of indentation disappear from the
1148screen. The only indication of their presence is that three dots
1149(@samp{@dots{}}) appear at the end of each visible line that is
1150followed by one or more hidden ones.
6bf7aab6
DL
1151
1152 The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as
1153if they were not there.
1154
1155 The hidden lines are still present in the buffer, and most editing
1156commands see them as usual, so you may find point in the middle of the
1157hidden text. When this happens, the cursor appears at the end of the
1158previous line, after the three dots. If point is at the end of the
1159visible line, before the newline that ends it, the cursor appears before
1160the three dots.
1161
1162 To make all lines visible again, type @kbd{C-x $} with no argument.
1163
1164@vindex selective-display-ellipses
1165 If you set the variable @code{selective-display-ellipses} to
1166@code{nil}, the three dots do not appear at the end of a line that
1167precedes hidden lines. Then there is no visible indication of the
1168hidden lines. This variable becomes local automatically when set.
1169
0015d677
RS
1170 See also @ref{Outline Mode} for another way to hide part of
1171the text in a buffer.
1172
6bf7aab6
DL
1173@node Optional Mode Line
1174@section Optional Mode Line Features
1175
b213b767
LK
1176@cindex buffer size display
1177@cindex display of buffer size
1178@findex size-indication-mode
1179 The buffer percentage @var{pos} indicates the percentage of the
1180buffer above the top of the window. You can additionally display the
1181size of the buffer by typing @kbd{M-x size-indication-mode} to turn on
1182Size Indication mode. The size will be displayed immediately
1183following the buffer percentage like this:
1184
1185@example
1186@var{POS} of @var{SIZE}
1187@end example
1188
1189@noindent
1190Here @var{SIZE} is the human readable representation of the number of
1191characters in the buffer, which means that @samp{k} for 10^3, @samp{M}
1192for 10^6, @samp{G} for 10^9, etc., are used to abbreviate.
1193
e598186c
RS
1194@cindex line number display
1195@cindex display of line number
6bf7aab6
DL
1196@findex line-number-mode
1197 The current line number of point appears in the mode line when Line
1198Number mode is enabled. Use the command @kbd{M-x line-number-mode} to
1199turn this mode on and off; normally it is on. The line number appears
b213b767 1200after the buffer percentage @var{pos}, with the letter @samp{L} to
79199dd2
AM
1201indicate what it is.
1202
1203@cindex Column Number mode
1204@cindex mode, Column Number
1205@findex column-number-mode
1206 Similarly, you can display the current column number by turning on
1207Column number mode with @kbd{M-x column-number-mode}. The column
1208number is indicated by the letter @samp{C}. However, when both of
1209these modes are enabled, the line and column numbers are displayed in
1210parentheses, the line number first, rather than with @samp{L} and
1211@samp{C}. For example: @samp{(561,2)}. @xref{Minor Modes}, for more
1212information about minor modes and about how to use these commands.
6bf7aab6 1213
43f971ab
EZ
1214@cindex narrowing, and line number display
1215 If you have narrowed the buffer (@pxref{Narrowing}), the displayed
1216line number is relative to the accessible portion of the buffer.
54952612
RS
1217Thus, it isn't suitable as an argument to @code{goto-line}. (Use
1218@code{what-line} command to see the line number relative to the whole
1219file.)
43f971ab 1220
6bf7aab6
DL
1221@vindex line-number-display-limit
1222 If the buffer is very large (larger than the value of
956c76ef
CY
1223@code{line-number-display-limit}), Emacs won't compute the line
1224number, because that would be too slow; therefore, the line number
1225won't appear on the mode-line. To remove this limit, set
1226@code{line-number-display-limit} to @code{nil}.
43f971ab
EZ
1227
1228@vindex line-number-display-limit-width
1229 Line-number computation can also be slow if the lines in the buffer
956c76ef
CY
1230are too long. For this reason, Emacs doesn't display line numbers if
1231the average width, in characters, of lines near point is larger than
1232the value of @code{line-number-display-limit-width}. The default
1233value is 200 characters.
6bf7aab6 1234
6bf7aab6
DL
1235@findex display-time
1236@cindex time (on mode line)
1237 Emacs can optionally display the time and system load in all mode
4f00b8c1
DL
1238lines. To enable this feature, type @kbd{M-x display-time} or customize
1239the option @code{display-time-mode}. The information added to the mode
bb3865e8 1240line looks like this:
6bf7aab6
DL
1241
1242@example
1243@var{hh}:@var{mm}pm @var{l.ll}
1244@end example
1245
1246@noindent
1247@vindex display-time-24hr-format
1248Here @var{hh} and @var{mm} are the hour and minute, followed always by
4f1948eb
EZ
1249@samp{am} or @samp{pm}. @var{l.ll} is the average number, collected
1250for the last few minutes, of processes in the whole system that were
1251either running or ready to run (i.e.@: were waiting for an available
1252processor). (Some fields may be missing if your operating system
1253cannot support them.) If you prefer time display in 24-hour format,
1254set the variable @code{display-time-24hr-format} to @code{t}.
6bf7aab6
DL
1255
1256@cindex mail (on mode line)
72bd7b7b
DL
1257@vindex display-time-use-mail-icon
1258@vindex display-time-mail-face
fad78d58
RS
1259@vindex display-time-mail-file
1260@vindex display-time-mail-directory
6bf7aab6 1261 The word @samp{Mail} appears after the load level if there is mail
939db9ac
CY
1262for you that you have not read yet. On graphical displays, you can
1263use an icon instead of @samp{Mail} by customizing
1264@code{display-time-use-mail-icon}; this may save some space on the
1265mode line. You can customize @code{display-time-mail-face} to make
1266the mail indicator prominent. Use @code{display-time-mail-file} to
1267specify the mail file to check, or set
1268@code{display-time-mail-directory} to specify the directory to check
1269for incoming mail (any nonempty regular file in the directory is
1270considered as ``newly arrived mail'').
6bf7aab6 1271
956c76ef
CY
1272@cindex mail (on mode line)
1273@findex display-battery-mode
1274@vindex display-battery-mode
1275@vindex battery-mode-line-format
1276 When running Emacs on a laptop computer, you can display the battery
1277charge on the mode-line, by using the command
1278@code{display-battery-mode} or customizing the variable
1279@code{display-battery-mode}. The variable
1280@code{battery-mode-line-format} determines the way the battery charge
1281is displayed; the exact mode-line message depends on the operating
1282system, and it usually shows the current battery charge as a
1283percentage of the total charge.
1284
47d7776c 1285@cindex mode line, 3D appearance
bd3ead08
EZ
1286@cindex attributes of mode line, changing
1287@cindex non-integral number of lines in a window
939db9ac 1288 On graphical displays, the mode line is drawn as a 3D box. If you
d366bd53
CY
1289don't like this effect, you can disable it by customizing the
1290@code{mode-line} face and setting its @code{box} attribute to
1291@code{nil}. @xref{Face Customization}.
bd3ead08 1292
b9e58bf2 1293@cindex non-selected windows, mode line appearance
ac6875fc 1294 By default, the mode line of nonselected windows is displayed in a
1c9f5f23 1295different face, called @code{mode-line-inactive}. Only the selected
ac6875fc
RS
1296window is displayed in the @code{mode-line} face. This helps show
1297which window is selected. When the minibuffer is selected, since
1298it has no mode line, the window from which you activated the minibuffer
1299has its mode line displayed using @code{mode-line}; as a result,
1300ordinary entry to the minibuffer does not change any mode lines.
1301
1302@vindex mode-line-in-non-selected-windows
1303 You can disable use of @code{mode-line-inactive} by setting variable
1c9f5f23
KS
1304@code{mode-line-in-non-selected-windows} to @code{nil}; then all mode
1305lines are displayed in the @code{mode-line} face.
b9e58bf2 1306
589a3f9f
RS
1307@vindex eol-mnemonic-unix
1308@vindex eol-mnemonic-dos
1309@vindex eol-mnemonic-mac
1310@vindex eol-mnemonic-undecided
1311 You can customize the mode line display for each of the end-of-line
1312formats by setting each of the variables @code{eol-mnemonic-unix},
1313@code{eol-mnemonic-dos}, @code{eol-mnemonic-mac}, and
54952612 1314@code{eol-mnemonic-undecided} to the strings you prefer.
589a3f9f 1315
6bf7aab6
DL
1316@node Text Display
1317@section How Text Is Displayed
1318@cindex characters (in text)
d366bd53 1319@cindex printing character
6bf7aab6 1320
d366bd53
CY
1321 Most characters are @dfn{printing characters}: when they appear in a
1322buffer, they are displayed literally on the screen. Printing
1323characters include @acronym{ASCII} numbers, letters, and punctuation
1324characters, as well as many non-@acronym{ASCII} characters.
6bf7aab6 1325
956c76ef 1326@vindex tab-width
a3dcc84e 1327@cindex control characters on display
d366bd53
CY
1328 The @acronym{ASCII} character set contains non-printing @dfn{control
1329characters}. Two of these are displayed specially: the newline
1330character (Unicode code point @code{U+000A}) is displayed by starting
1331a new line, while the tab character (@code{U+0009}) is displayed as a
1332space that extends to the next tab stop column (normally every 8
1333columns). The number of spaces per tab is controlled by the
1334buffer-local variable @code{tab-width}, which must have an integer
1335value between 1 and 1000, inclusive. Note that how the tab character
1336in the buffer is displayed has nothing to do with the definition of
1337@key{TAB} as a command.
1338
a3dcc84e
EZ
1339 Other @acronym{ASCII} control characters, whose codes are below
1340@code{U+0020} (octal 40, decimal 32), are displayed as a caret
d366bd53
CY
1341(@samp{^}) followed by the non-control version of the character, with
1342the @code{escape-glyph} face. For instance, the @samp{control-A}
1343character, @code{U+0001}, is displayed as @samp{^A}.
54952612 1344
a3dcc84e 1345@cindex octal escapes
54952612 1346@vindex ctl-arrow
a3dcc84e
EZ
1347 The raw bytes with codes @code{U+0080} (octal 200) through
1348@code{U+009F} (octal 237) are displayed as @dfn{octal escape
1349sequences}, with the @code{escape-glyph} face. For instance,
d366bd53
CY
1350character code @code{U+0098} (octal 230) is displayed as @samp{\230}.
1351If you change the buffer-local variable @code{ctl-arrow} to
a3dcc84e
EZ
1352@code{nil}, the @acronym{ASCII} control characters are also displayed
1353as octal escape sequences instead of caret escape sequences.
6bf7aab6 1354
470a11a3 1355@vindex nobreak-char-display
939db9ac
CY
1356@cindex non-breaking space
1357@cindex non-breaking hyphen
1358@cindex soft hyphen
1359 Some non-@acronym{ASCII} characters have the same appearance as an
1360@acronym{ASCII} space or hyphen (minus) character. Such characters
1361can cause problems if they are entered into a buffer without your
8863a584 1362realization, e.g.@: by yanking; for instance, source code compilers
939db9ac
CY
1363typically do not treat non-@acronym{ASCII} spaces as whitespace
1364characters. To deal with this problem, Emacs displays such characters
1365specially: it displays @code{U+00A0} (no-break space) with the
1366@code{nobreak-space} face, and it displays @code{U+00AD} (soft
1367hyphen), @code{U+2010} (hyphen), and @code{U+2011} (non-breaking
1368hyphen) with the @code{escape-glyph} face. To disable this, change
1369the variable @code{nobreak-char-display} to @code{nil}. If you give
1370this variable a non-@code{nil} and non-@code{t} value, Emacs instead
1371displays such characters as a highlighted backslash followed by a
1372space or hyphen.
b5cced4b 1373
54952612
RS
1374 You can customize the way any particular character code is displayed
1375by means of a display table. @xref{Display Tables,, Display Tables,
1376elisp, The Emacs Lisp Reference Manual}.
1377
0eb025fb
EZ
1378@cindex glyphless characters
1379@cindex characters with no font glyphs
d366bd53
CY
1380 On graphical displays, some characters may have no glyphs in any of
1381the fonts available to Emacs. These @dfn{glyphless characters} are
1382normally displayed as boxes containing the hexadecimal character code.
a3dcc84e
EZ
1383Similarly, on text terminals, characters that cannot be displayed
1384using the terminal encoding (@pxref{Terminal Coding}) are normally
1385displayed as question signs. You can control the display method by
1386customizing the variable @code{glyphless-char-display-control}.
1387@xref{Glyphless Chars,, Glyphless Character Display, elisp, The Emacs
1388Lisp Reference Manual}, for details.
0eb025fb 1389
0015d677
RS
1390@node Cursor Display
1391@section Displaying the Cursor
939db9ac 1392@cindex text cursor
4cb4f3ba 1393
468160b7 1394@vindex visible-cursor
939db9ac
CY
1395 On a text terminal, the cursor's appearance is controlled by the
1396terminal, largely out of the control of Emacs. Some terminals offer
1397two different cursors: a ``visible'' static cursor, and a ``very
1398visible'' blinking cursor. By default, Emacs uses the very visible
1399cursor, and switches to it when you start or resume Emacs. If the
1400variable @code{visible-cursor} is @code{nil} when Emacs starts or
1401resumes, it uses the normal cursor.
1402
1403@cindex cursor face
1404@vindex cursor-type
1405 On a graphical display, many more properties of the text cursor can
1406be altered. To customize its color, change the @code{:background}
1407attribute of the face named @code{cursor} (@pxref{Face
1408Customization}). (The other attributes of this face have no effect;
1409the text shown under the cursor is drawn using the frame's background
1410color.) To change its shape, customize the buffer-local variable
1411@code{cursor-type}; possible values are @code{box} (the default),
1412@code{hollow} (a hollow box), @code{bar} (a vertical bar), @code{(bar
1413. @var{n})} (a vertical bar @var{n} pixels wide), @code{hbar} (a
1414horizontal bar), @code{(hbar . @var{n})} (a horizontal bar @var{n}
1415pixels tall), or @code{nil} (no cursor at all).
468160b7 1416
939db9ac
CY
1417@findex blink-cursor-mode
1418@cindex cursor, blinking
1419@cindex blinking cursor
1420@vindex blink-cursor-alist
1421 To disable cursor blinking, change the variable
1422@code{blink-cursor-mode} to @code{nil} (@pxref{Easy Customization}),
1423or add the line @code{(blink-cursor-mode 0)} to your init file.
1424Alternatively, you can change how the cursor looks when it ``blinks
1425off'' by customizing the list variable @code{blink-cursor-alist}.
1426Each element in the list should have the form @code{(@var{on-type}
1427. @var{off-type})}; this means that if the cursor is displayed as
1428@var{on-type} when it blinks on (where @var{on-type} is one of the
1429cursor types described above), then it is displayed as @var{off-type}
1430when it blinks off.
0015d677
RS
1431
1432@vindex x-stretch-cursor
1433@cindex wide block cursor
939db9ac
CY
1434 Some characters, such as tab characters, are ``extra wide''. When
1435the cursor is positioned over such a character, it is normally drawn
1436with the default character width. You can make the cursor stretch to
1437cover wide characters, by changing the variable
0015d677
RS
1438@code{x-stretch-cursor} to a non-@code{nil} value.
1439
939db9ac
CY
1440@cindex cursor in non-selected windows
1441@vindex cursor-in-non-selected-windows
1442 The cursor normally appears in non-selected windows as a
1443non-blinking hollow box. (For a bar cursor, it instead appears as a
1444thinner bar.) To turn off cursors in non-selected windows, change the
1445variable @code{cursor-in-non-selected-windows} to @code{nil}.
1446
0015d677
RS
1447@findex hl-line-mode
1448@findex global-hl-line-mode
1449@cindex highlight current line
54952612
RS
1450 To make the cursor even more visible, you can use HL Line mode, a
1451minor mode that highlights the line containing point. Use @kbd{M-x
0015d677
RS
1452hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
1453global-hl-line-mode} enables or disables the same mode globally.
1454
9d2908a6 1455@node Line Truncation
939db9ac 1456@section Line Truncation
0015d677
RS
1457
1458@cindex truncation
1459@cindex line truncation, and fringes
939db9ac
CY
1460 As an alternative to continuation (@pxref{Continuation Lines}),
1461Emacs can display long lines by @dfn{truncation}. This means that all
1462the characters that do not fit in the width of the screen or window do
1463not appear at all. On graphical displays, a small straight arrow in
0be641c0
CY
1464the fringe indicates truncation at either end of the line. On text
1465terminals, this is indicated with @samp{$} signs in the leftmost
1466and/or rightmost columns.
0015d677
RS
1467
1468@vindex truncate-lines
1469@findex toggle-truncate-lines
1470 Horizontal scrolling automatically causes line truncation
1471(@pxref{Horizontal Scrolling}). You can explicitly enable line
1472truncation for a particular buffer with the command @kbd{M-x
1473toggle-truncate-lines}. This works by locally changing the variable
1474@code{truncate-lines}. If that variable is non-@code{nil}, long lines
1475are truncated; if it is @code{nil}, they are continued onto multiple
1476screen lines. Setting the variable @code{truncate-lines} in any way
1477makes it local to the current buffer; until that time, the default
939db9ac 1478value, which is normally @code{nil}, is in effect.
6bf7aab6 1479
939db9ac
CY
1480@vindex truncate-partial-width-windows
1481 If a split window becomes too narrow, Emacs may automatically enable
1482line truncation. @xref{Split Window}, for the variable
1483@code{truncate-partial-width-windows} which controls this.
80174a97 1484
458db4b6
CY
1485@node Visual Line Mode
1486@section Visual Line Mode
1487
1488@cindex word wrap
1489 Another alternative to ordinary line continuation is to use
1490@dfn{word wrap}. Here, each long logical line is divided into two or
1491more screen lines, like in ordinary line continuation. However, Emacs
1492attempts to wrap the line at word boundaries near the right window
1493edge. This makes the text easier to read, as wrapping does not occur
1494in the middle of words.
1495
1496@cindex Visual Line mode
1497@findex visual-line-mode
1498@findex global-visual-line-mode
1499 Word wrap is enabled by Visual Line mode, an optional minor mode.
1500To turn on Visual Line mode in the current buffer, type @kbd{M-x
1501visual-line-mode}; repeating this command turns it off. You can also
1502turn on Visual Line mode using the menu bar: in the Options menu,
1503select the @samp{Line Wrapping in this Buffer} submenu, followed by
1504the @samp{Word Wrap (Visual Line Mode)} menu item. While Visual Line
1505mode is enabled, the mode-line shows the string @samp{wrap} in the
1506mode display. The command @kbd{M-x global-visual-line-mode} toggles
1507Visual Line mode in all buffers.
1508
1509@findex beginning-of-visual-line
1510@findex end-of-visual-line
1511@findex next-logical-line
1512@findex previous-logical-line
1513 In Visual Line mode, some editing commands work on screen lines
1514instead of logical lines: @kbd{C-a} (@code{beginning-of-visual-line})
1515moves to the beginning of the screen line, @kbd{C-e}
1516(@code{end-of-visual-line}) moves to the end of the screen line, and
1517@kbd{C-k} (@code{kill-visual-line}) kills text to the end of the
21927cd7
CY
1518screen line.
1519
1520 To move by logical lines, use the commands @kbd{M-x
1521next-logical-line} and @kbd{M-x previous-logical-line}. These move
1522point to the next logical line and the previous logical line
1523respectively, regardless of whether Visual Line mode is enabled. If
1524you use these commands frequently, it may be convenient to assign key
1525bindings to them. @xref{Init Rebinding}.
458db4b6
CY
1526
1527 By default, word-wrapped lines do not display fringe indicators.
1528Visual Line mode is often used to edit files that contain many long
1529logical lines, so having a fringe indicator for each wrapped line
1530would be visually distracting. You can change this by customizing the
1531variable @code{visual-line-fringe-indicators}.
1532
9d2908a6
RS
1533@node Display Custom
1534@section Customization of Display
80174a97 1535
939db9ac
CY
1536 This section describes variables that control miscellaneous aspects
1537of the appearance of the Emacs screen. Beginning users can skip it.
62ea61af 1538
9d2908a6
RS
1539@vindex visible-bell
1540 If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
1541to make the whole screen blink when it would normally make an audible bell
1542sound. This variable has no effect if your terminal does not have a way
1543to make the screen blink.
80174a97 1544
9d2908a6
RS
1545@vindex echo-keystrokes
1546 The variable @code{echo-keystrokes} controls the echoing of multi-character
1547keys; its value is the number of seconds of pause required to cause echoing
1548to start, or zero, meaning don't echo at all. The value takes effect when
bfd779dd 1549there is something to echo. @xref{Echo Area}.
80174a97 1550
b4a1a8b2 1551@cindex mouse pointer
62095f01 1552@cindex hourglass pointer display
b4a1a8b2 1553@vindex display-hourglass
62095f01 1554@vindex hourglass-delay
b4a1a8b2
CY
1555 On graphical displays, Emacs displays the mouse pointer as an
1556hourglass if Emacs is busy. To disable this feature, set the variable
1557@code{display-hourglass} to @code{nil}. The variable
1558@code{hourglass-delay} determines the number of seconds of ``busy
1559time'' before the hourglass is shown; the default is 1.
1560
1561@vindex make-pointer-invisible
1562 If the mouse pointer lies inside an Emacs frame, Emacs makes it
1563invisible each time you type a character to insert text, to prevent it
1564from obscuring the text. (To be precise, the hiding occurs when you
1565type a ``self-inserting'' character. @xref{Inserting Text}.) Moving
1566the mouse pointer makes it visible again. To disable this feature,
1567set the variable @code{make-pointer-invisible} to @code{nil}.
1568
1569@vindex underline-minimum-offset
1570@vindex x-underline-at-descent-line
1571 On graphical displays, the variable @code{underline-minimum-offset}
1572determines the minimum distance between the baseline and underline, in
1573pixels, for underlined text. By default, the value is 1; increasing
1574it may improve the legibility of underlined text for certain fonts.
1575(However, Emacs will never draw the underline below the current line
1576area.) The variable @code{x-underline-at-descent-line} determines how
1577to draw underlined text. The default is @code{nil}, which means to
1578draw it at the baseline level of the font; if you change it to
1579@code{nil}, Emacs draws the underline at the same height as the font's
1580descent line.
099bfef9 1581
9d2908a6 1582@vindex overline-margin
b4a1a8b2
CY
1583 The variable @code{overline-margin} specifies the vertical position
1584of an overline above the text, including the height of the overline
1585itself, in pixels; the default is 2.
9d2908a6 1586
a66b12be 1587@findex tty-suppress-bold-inverse-default-colors
0be641c0
CY
1588 On some text terminals, bold face and inverse video together result
1589in text that is hard to read. Call the function
a66b12be
RS
1590@code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil}
1591argument to suppress the effect of bold-face in this case.