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