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