+@node Faces
+@section Using Multiple Typefaces
+@cindex faces
+
+ You can specify various styles for displaying text using
+@dfn{faces}. Each face can specify various @dfn{face attributes},
+such as the font family, the height, weight and slant of the
+characters, the foreground and background color, and underlining or
+overlining. A face does not have to specify all of these attributes;
+often it inherits most of them from another face.
+
+ On graphical display, all the Emacs face attributes are meaningful.
+On a text-only terminal, only some of them work. Some text-only
+terminals support inverse video, bold, and underline attributes; some
+support colors. Text-only terminals generally do not support changing
+the height and width or the font family.
+
+ Emacs uses faces automatically for highlighting, through the work of
+Font Lock mode. @xref{Font Lock}, for more information about Font
+Lock mode and syntactic highlighting. You can print out the buffer
+with the highlighting that appears on your screen using the command
+@code{ps-print-buffer-with-faces}. @xref{PostScript}.
+
+ You control the appearance of a part of the text in the buffer by
+specifying the face or faces to use for it. The style of display used
+for any given character is determined by combining the attributes of
+all the applicable faces specified for that character. Any attribute
+that isn't specified by these faces is taken from the @code{default} face,
+whose attributes reflect the default settings of the frame itself.
+
+ Enriched mode, the mode for editing formatted text, includes several
+commands and menus for specifying faces for text in the buffer.
+@xref{Format Faces}, for how to specify the font for text in the
+buffer. @xref{Format Colors}, for how to specify the foreground and
+background color.
+
+@cindex face colors, setting
+@findex set-face-foreground
+@findex set-face-background
+ To alter the appearance of a face, use the customization buffer.
+@xref{Face Customization}. You can also use X resources to specify
+attributes of particular faces (@pxref{Resources}). Alternatively,
+you can change the foreground and background colors of a specific face
+with @kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}.
+These commands prompt in the minibuffer for a face name and a color
+name, with completion, and then set that face to use the specified
+color. Changing the colors of the @code{default} face also changes
+the foreground and background colors on all frames, both existing and
+those to be created in the future. (You can also set foreground and
+background colors for the current frame only; see @ref{Frame
+Parameters}.)
+
+ Emacs can correctly display variable-width fonts, but Emacs commands
+that calculate width and indentation do not know how to calculate
+variable widths. This can sometimes lead to incorrect results when
+you use variable-width fonts. In particular, indentation commands can
+give inconsistent results, so we recommend you avoid variable-width
+fonts for editing program source code. Filling will sometimes make
+lines too long or too short. We plan to address these issues in
+future Emacs versions.
+
+@node Standard Faces
+@section Standard Faces
+
+@findex list-faces-display
+ To see what faces are currently defined, and what they look like,
+type @kbd{M-x list-faces-display}. It's possible for a given face to
+look different in different frames; this command shows the appearance
+in the frame in which you type it.
+
+ Here are the standard faces for specifying text appearance. You can
+apply them to specific text when you want the effects they produce.
+
+@table @code
+@item default
+This face is used for ordinary text that doesn't specify any face.
+@item bold
+This face uses a bold variant of the default font, if it has one.
+It's up to you to choose a default font that has a bold variant,
+if you want to use one.
+@item italic
+This face uses an italic variant of the default font, if it has one.
+@item bold-italic
+This face uses a bold italic variant of the default font, if it has one.
+@item underline
+This face underlines text.
+@item fixed-pitch
+This face forces use of a particular fixed-width font.
+@item variable-pitch
+This face forces use of a particular variable-width font. It's
+reasonable to customize this face to use a different variable-width font,
+if you like, but you should not make it a fixed-width font.
+@item shadow
+This face is used for making the text less noticeable than the surrounding
+ordinary text. Usually this can be achieved by using shades of gray in
+contrast with either black or white default foreground color.
+@end table
+
+ Here's an incomplete list of faces used to highlight parts of the
+text temporarily for specific purposes. (Many other modes define
+their own faces for this purpose.)
+
+@table @code
+@item highlight
+This face is used for highlighting portions of text, in various modes.
+For example, mouse-sensitive text is highlighted using this face.
+@item isearch
+This face is used for highlighting the current Isearch match.
+@item query-replace
+This face is used for highlighting the current Query Replace match.
+@item lazy-highlight
+This face is used for lazy highlighting of Isearch and Query Replace
+matches other than the current one.
+@item region
+This face is used for displaying a selected region (when Transient Mark
+mode is enabled---see below).
+@item secondary-selection
+This face is used for displaying a secondary X selection (@pxref{Secondary
+Selection}).
+@item trailing-whitespace
+The face for highlighting excess spaces and tabs at the end of a line
+when @code{show-trailing-whitespace} is non-@code{nil}; see
+@ref{Useless Whitespace}.
+@item nobreak-space
+The face for displaying the character ``nobreak space.''
+@item escape-glyph
+The face for highlighting the @samp{\} or @samp{^} that indicates
+a control character. It's also used when @samp{\} indicates a
+nobreak space or nobreak (soft) hyphen.
+@end table
+
+@cindex @code{region} face
+ When Transient Mark mode is enabled, the text of the region is
+highlighted when the mark is active. This uses the face named
+@code{region}; you can control the style of highlighting by changing the
+style of this face (@pxref{Face Customization}). @xref{Transient Mark},
+for more information about Transient Mark mode and activation and
+deactivation of the mark.
+
+ These faces control the appearance of parts of the Emacs frame.
+They exist as faces to provide a consistent way to customize the
+appearance of these parts of the frame.
+
+@table @code
+@item mode-line
+@itemx modeline
+This face is used for the mode line of the currently selected window,
+and for menu bars when toolkit menus are not used. By default, it's
+drawn with shadows for a ``raised'' effect on graphical displays, and
+drawn as the inverse of the default face on non-windowed terminals.
+@code{modeline} is an alias for the @code{mode-line} face, for
+compatibility with old Emacs versions.
+@item mode-line-inactive
+Like @code{mode-line}, but used for mode lines of the windows other
+than the selected one (if @code{mode-line-in-non-selected-windows} is
+non-@code{nil}). This face inherits from @code{mode-line}, so changes
+in that face affect mode lines in all windows.
+@item mode-line-highlight
+Like @code{highlight}, but used for portions of text on mode lines.
+@item mode-line-buffer-id
+This face is used for buffer identification parts in the mode line.
+@item header-line
+Similar to @code{mode-line} for a window's header line, which appears
+at the top of a window just as the mode line appears at the bottom.
+Most windows do not have a header line---only some special modes, such
+Info mode, create one.
+@item vertical-border
+This face is used for the vertical divider between windows.
+By default this face inherits from the @code{mode-line-inactive} face
+on character terminals. On graphical displays the foreground color of
+this face is used for the vertical line between windows without
+scrollbars.
+@item minibuffer-prompt
+@cindex @code{minibuffer-prompt} face
+@vindex minibuffer-prompt-properties
+This face is used for the prompt strings displayed in the minibuffer.
+By default, Emacs automatically adds this face to the value of
+@code{minibuffer-prompt-properties}, which is a list of text
+properties used to display the prompt text. (This variable takes
+effect when you enter the minibuffer.)
+@item fringe
+@cindex @code{fringe} face
+The face for the fringes to the left and right of windows on graphic
+displays. (The fringes are the narrow portions of the Emacs frame
+between the text area and the window's right and left borders.)
+@xref{Fringes}.
+@item scroll-bar
+This face determines the visual appearance of the scroll bar.
+@xref{Scroll Bars}.
+@item border
+This face determines the color of the frame border.
+@item cursor
+This face determines the color of the cursor.
+@item mouse
+This face determines the color of the mouse pointer.
+@item tool-bar
+This face determines the color of tool bar icons. @xref{Tool Bars}.
+@item tooltip
+This face is used for tooltips. @xref{Tooltips}.
+@item menu
+@cindex menu bar appearance
+@cindex @code{menu} face, no effect if customized
+@cindex customization of @code{menu} face
+This face determines the colors and font of Emacs's menus. @xref{Menu
+Bars}. Setting the font of LessTif/Motif menus is currently not
+supported; attempts to set the font are ignored in this case.
+Likewise, attempts to customize this face in Emacs built with GTK and
+in the MS-Windows/Mac ports are ignored by the respective GUI toolkits;
+you need to use system-wide styles and options to change the
+appearance of the menus.
+@end table
+
+@node Font Lock
+@section Font Lock mode
+@cindex Font Lock mode
+@cindex mode, Font Lock
+@cindex syntax highlighting and coloring
+
+ Font Lock mode is a minor mode, always local to a particular buffer,
+which highlights (or ``fontifies'') the buffer contents according to
+the syntax of the text you are editing. It can recognize comments and
+strings in most languages; in several languages, it can also recognize
+and properly highlight various other important constructs---for
+example, names of functions being defined or reserved keywords.
+Some special modes, such as Occur mode and Info mode, have completely
+specialized ways of assigning fonts for Font Lock mode.
+
+@findex font-lock-mode
+ Font Lock mode is turned on by default in all modes which support it.
+You can toggle font-lock for each buffer with the command @kbd{M-x
+font-lock-mode}. Using a positive argument unconditionally turns Font
+Lock mode on, and a negative or zero argument turns it off.
+
+@findex global-font-lock-mode
+@vindex global-font-lock-mode
+ If you do not wish Font Lock mode to be turned on by default,
+customize the variable @code{global-font-lock-mode} using the Customize
+interface (@pxref{Easy Customization}), or use the function
+@code{global-font-lock-mode} in your @file{.emacs} file, like this:
+
+@example
+(global-font-lock-mode 0)
+@end example
+
+@noindent
+This variable, like all the variables that control Font Lock mode,
+take effect whenever fontification is done; that is, potentially at
+any time.
+
+@findex turn-on-font-lock
+ If you have disabled Global Font Lock mode, you can still enable Font
+Lock for specific major modes by adding the function
+@code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For
+example, to enable Font Lock mode for editing C files, you can do this:
+
+@example
+(add-hook 'c-mode-hook 'turn-on-font-lock)
+@end example
+
+ Font Lock mode uses several specifically named faces to do its job,
+including @code{font-lock-string-face}, @code{font-lock-comment-face},
+and others. The easiest way to find them all is to use @kbd{M-x
+customize-group @key{RET} font-lock-faces @key{RET}}. You can then
+use that customization buffer to customize the appearance of these
+faces. @xref{Face Customization}.
+
+ You can also customize these faces using @kbd{M-x
+set-face-foreground} or @kbd{M-x set-face-background}. @xref{Faces}.
+
+@vindex font-lock-maximum-decoration
+ The variable @code{font-lock-maximum-decoration} specifies the
+preferred level of fontification, for modes that provide multiple
+levels. Level 1 is the least amount of fontification; some modes
+support levels as high as 3. The normal default is ``as high as
+possible.'' You can specify an integer, which applies to all modes, or
+you can specify different numbers for particular major modes; for
+example, to use level 1 for C/C++ modes, and the default level
+otherwise, use this:
+
+@example
+(setq font-lock-maximum-decoration
+ '((c-mode . 1) (c++-mode . 1)))
+@end example
+
+@vindex font-lock-maximum-size
+ Fontification can be too slow for large buffers, so you can suppress
+it for buffers above a certain size. The variable
+@code{font-lock-maximum-size} specifies a buffer size, beyond which
+buffer fontification is suppressed.
+
+@c @w is used below to prevent a bad page-break.
+@vindex font-lock-beginning-of-syntax-function
+@cindex incorrect fontification
+@cindex parenthesis in column zero and fontification
+@cindex brace in column zero and fontification
+ Comment and string fontification (or ``syntactic'' fontification)
+relies on analysis of the syntactic structure of the buffer text. For
+the sake of speed, some modes, including Lisp mode, rely on a special
+convention: an open-parenthesis or open-brace in the leftmost column
+always defines the @w{beginning} of a defun, and is thus always
+outside any string or comment. (@xref{Left Margin Paren}.) If you
+don't follow this convention, Font Lock mode can misfontify the text
+that follows an open-parenthesis or open-brace in the leftmost column
+that is inside a string or comment.
+
+@cindex slow display during scrolling
+ The variable @code{font-lock-beginning-of-syntax-function} (always
+buffer-local) specifies how Font Lock mode can find a position
+guaranteed to be outside any comment or string. In modes which use the
+leftmost column parenthesis convention, the default value of the variable
+is @code{beginning-of-defun}---that tells Font Lock mode to use the
+convention. If you set this variable to @code{nil}, Font Lock no longer
+relies on the convention. This avoids incorrect results, but the price
+is that, in some cases, fontification for a changed text must rescan
+buffer text from the beginning of the buffer. This can considerably
+slow down redisplay while scrolling, particularly if you are close to
+the end of a large buffer.
+
+@findex font-lock-add-keywords
+ Font Lock highlighting patterns already exist for many modes, but you
+may want to fontify additional patterns. You can use the function
+@code{font-lock-add-keywords}, to add your own highlighting patterns for
+a particular mode. For example, to highlight @samp{FIXME:} words in C
+comments, use this:
+
+@example
+(font-lock-add-keywords
+ 'c-mode
+ '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t)))
+@end example
+
+@findex font-lock-remove-keywords
+ To remove keywords from the font-lock highlighting patterns, use the
+function @code{font-lock-remove-keywords}. @xref{Search-based
+Fontification,,, elisp, The Emacs Lisp Reference Manual}, for
+documentation of the format of this list.
+
+@cindex just-in-time (JIT) font-lock
+@cindex background syntax highlighting
+ Fontifying large buffers can take a long time. To avoid large
+delays when a file is visited, Emacs fontifies only the visible
+portion of a buffer. As you scroll through the buffer, each portion
+that becomes visible is fontified as soon as it is displayed. The
+parts of the buffer that are not displayed are fontified
+``stealthily,'' in the background, i.e.@: when Emacs is idle. You can
+control this background fontification, also called @dfn{Just-In-Time}
+(or @dfn{JIT}) Lock, by customizing variables in the customization
+group @samp{jit-lock}. @xref{Specific Customization}.
+
+@node Highlight Interactively
+@section Interactive Highlighting
+@cindex highlighting by matching
+@cindex interactive highlighting
+@cindex Highlight Changes mode
+
+@findex highlight-changes-mode
+ Use @kbd{M-x highlight-changes-mode} to enable (or disable)
+Highlight Changes mode, a minor mode that uses faces (colors,
+typically) to indicate which parts of the buffer were changed most
+recently.
+
+@cindex Hi Lock mode
+@findex hi-lock-mode
+ Hi Lock mode is another minor mode, which highlights text that
+matches your specified regular expressions. For example, you might
+wish to see all the references to a certain variable in a program
+source file, highlight certain parts in a voluminous output of some
+program, or make certain names stand out in an article. Use the
+@kbd{M-x hi-lock-mode} command to enable (or disable) Hi Lock mode.
+To enable Hi Lock mode for all buffers, use @kbd{M-x
+global-hi-lock-mode} or place @code{(global-hi-lock-mode 1)} in your
+@file{.emacs} file.
+
+ Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except
+that you specify explicitly the regular expressions to highlight. You
+control them with these commands:
+
+@table @kbd
+@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
+@kindex C-x w h
+@findex highlight-regexp
+Highlight text that matches @var{regexp} using face @var{face}
+(@code{highlight-regexp}). The highlighting will remain as long as
+the buffer is loaded. For example, to highlight all occurrences of
+the word ``whim'' using the default face (a yellow background)
+@kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for
+highlighting, Hi Lock provides several of its own and these are
+pre-loaded into a history list. While being prompted for a face use
+@kbd{M-p} and @kbd{M-n} to cycle through them.
+
+You can use this command multiple times, specifying various regular
+expressions to highlight in different ways.
+
+@item C-x w r @var{regexp} @key{RET}
+@kindex C-x w r
+@findex unhighlight-regexp
+Unhighlight @var{regexp} (@code{unhighlight-regexp}).
+
+If you invoke this from the menu, you select the expression to
+unhighlight from a list. If you invoke this from the keyboard, you
+use the minibuffer. It will show the most recently added regular
+expression; use @kbd{M-p} to show the next older expression and
+@kbd{M-n} to select the next newer expression. (You can also type the
+expression by hand, with completion.) When the expression you want to
+unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit
+the minibuffer and unhighlight it.
+
+@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
+@kindex C-x w l
+@findex highlight-lines-matching-regexp
+@cindex lines, highlighting
+@cindex highlighting lines of text
+Highlight entire lines containing a match for @var{regexp}, using face
+@var{face} (@code{highlight-lines-matching-regexp}).
+
+@item C-x w b
+@kindex C-x w b
+@findex hi-lock-write-interactive-patterns
+Insert all the current highlighting regexp/face pairs into the buffer
+at point, with comment delimiters to prevent them from changing your
+program. (This key binding runs the
+@code{hi-lock-write-interactive-patterns} command.)
+
+These patterns will be read the next time you visit the file while
+Hi Lock mode is enabled, or whenever you use the @kbd{M-x
+hi-lock-find-patterns} command.
+
+@item C-x w i
+@kindex C-x w i
+@findex hi-lock-find-patterns
+@vindex hi-lock-exclude-modes
+Re-read regexp/face pairs in the current buffer
+(@code{hi-lock-write-interactive-patterns}). Users familiar with Font
+Lock keywords might interactively enter patterns
+(@code{highlight-regexp}), write them into the file
+(@code{hi-lock-write-interactive-patterns}), edit them, perhaps
+including different faces for different parenthesized parts of the
+match, and finally use this command
+(@code{hi-lock-write-interactive-patterns}) to have Hi Lock highlight
+them.
+
+This command does nothing if the current major mode's symbol is a member
+of the list @code{hi-lock-exclude-modes}.
+@end table
+
+@node Fringes
+@section Window Fringes
+@cindex fringes
+
+ On a graphical display, each Emacs window normally has narrow
+@dfn{fringes} on the left and right edges. The fringes display
+indications about the text in the window.
+
+ The most common use of the fringes is to indicate a continuation
+line, when one line of text is split into multiple lines on the
+screen. The left fringe shows a curving arrow for each screen line
+except the first, indicating that ``this is not the real beginning.''
+The right fringe shows a curving arrow for each screen line except the
+last, indicating that ``this is not the real end.''
+
+ The fringes indicate line truncation with short horizontal arrows
+meaning ``there's more text on this line which is scrolled
+horizontally out of view;'' clicking the mouse on one of the arrows
+scrolls the display horizontally in the direction of the arrow. The
+fringes can also indicate other things, such as empty lines, or where a
+program you are debugging is executing (@pxref{Debuggers}).
+
+@findex set-fringe-style
+@findex fringe-mode
+ You can enable and disable the fringes for all frames using
+@kbd{M-x fringe-mode}. To enable and disable the fringes
+for the selected frame, use @kbd{M-x set-fringe-style}.
+
+@node Displaying Boundaries
+@section Displaying Boundaries
+
+@vindex indicate-buffer-boundaries
+ On a graphical display, Emacs can indicate the buffer boundaries in
+the fringes. It indicates the first line and the last line with
+angle images in the fringes. This can be combined with up and down
+arrow images which say whether it is possible to scroll the window up
+and down.
+
+ The buffer-local variable @code{indicate-buffer-boundaries} controls
+how the buffer boundaries and window scrolling is indicated in the
+fringes. If the value is @code{left} or @code{right}, both angle and
+arrow bitmaps are displayed in the left or right fringe, respectively.
+
+ If value is an alist, each element @code{(@var{indicator} .
+@var{position})} specifies the position of one of the indicators.
+The @var{indicator} must be one of @code{top}, @code{bottom},
+@code{up}, @code{down}, or @code{t} which specifies the default
+position for the indicators not present in the alist.
+The @var{position} is one of @code{left}, @code{right}, or @code{nil}
+which specifies not to show this indicator.
+
+ For example, @code{((top . left) (t . right))} places the top angle
+bitmap in left fringe, the bottom angle bitmap in right fringe, and
+both arrow bitmaps in right fringe. To show just the angle bitmaps in
+the left fringe, but no arrow bitmaps, use @code{((top . left)
+(bottom . left))}.
+
+@vindex default-indicate-buffer-boundaries
+ The value of the variable @code{default-indicate-buffer-boundaries}
+is the default value for @code{indicate-buffer-boundaries} in buffers
+that do not override it.
+
+@node Useless Whitespace
+@section Useless Whitespace
+
+@cindex trailing whitespace
+@cindex whitespace, trailing
+@vindex show-trailing-whitespace
+ It is easy to leave unnecessary spaces at the end of a line, or
+empty lines at the end of a file, without realizing it. In most
+cases, this @dfn{trailing whitespace} has no effect, but there are
+special circumstances where it matters. It can also be a nuisance
+that the line has ``changed,'' when the change is just spaces added or
+removed at the end.
+
+ You can make trailing whitespace at the end of a line visible on the
+screen by setting the buffer-local variable
+@code{show-trailing-whitespace} to @code{t}. Then Emacs displays
+trailing whitespace in the face @code{trailing-whitespace}.
+
+ This feature does not apply when point is at the end of the line
+containing the whitespace. Strictly speaking, that is ``trailing
+whitespace'' nonetheless, but displaying it specially in that case
+looks ugly while you are typing in new text. In this special case,
+the location of point is enough to show you that the spaces are
+present.
+
+@findex delete-trailing-whitespace
+ To delete all trailing whitespace within the current buffer's
+accessible portion (@pxref{Narrowing}), type @kbd{M-x
+delete-trailing-whitespace @key{RET}}. (This command does not remove
+the form-feed characters.)
+
+@vindex indicate-empty-lines
+@vindex default-indicate-empty-lines
+@cindex unused lines
+@cindex fringes, and unused line indication
+ Emacs can indicate unused lines at the end of the window with a
+small image in the left fringe (@pxref{Fringes}). The image appears
+for window lines that do not correspond to any buffer text. Blank
+lines at the end of the buffer then stand out because they do not have
+this image in the fringe.
+
+ To enable this feature, set the buffer-local variable
+@code{indicate-empty-lines} to a non-@code{nil} value. The default
+value of this variable is controlled by the variable
+@code{default-indicate-empty-lines}; by setting that variable, you
+can enable or disable this feature for all new buffers. (This feature
+currently doesn't work on text-only terminals.)
+