Merge changes from emacs-24; up to 2012-04-26T02:03:19Z!ueno@unixuser.org
[bpt/emacs.git] / doc / emacs / display.texi
index e7d58c3..2fa7112 100644 (file)
@@ -3,7 +3,7 @@
 @c   Free Software Foundation, Inc.
 
 @c See file emacs.texi for copying conditions.
-@node Display, Search, Registers, Top
+@node Display
 @chapter Controlling the Display
 
   Since only part of a large buffer fits in the window, Emacs has to
@@ -22,13 +22,13 @@ the text is displayed.
 * Follow Mode::            Follow mode lets two windows scroll as one.
 * Faces::                  How to change the display style using faces.
 * Colors::                 Specifying colors for faces.
-* Standard Faces::         Emacs' predefined faces.
+* Standard Faces::         The main predefined faces.
 * Text Scale::             Increasing or decreasing text size in a buffer.
 * Font Lock::              Minor mode for syntactic highlighting using faces.
 * Highlight Interactively:: Tell Emacs what text to highlight.
 * Fringes::                Enabling or disabling window fringes.
 * Displaying Boundaries::  Displaying top and bottom of the buffer.
-* Useless Whitespace::     Showing possibly-spurious trailing whitespace.
+* Useless Whitespace::     Showing possibly spurious trailing whitespace.
 * Selective Display::      Hiding lines with lots of indentation.
 * Optional Mode Line::     Optional mode line display features.
 * Text Display::           How text characters are normally displayed.
@@ -260,14 +260,11 @@ placed from the top margin of the window; thus, as with
   These two variables are ignored if either @code{scroll-step} or
 @code{scroll-conservatively} are set to a non-zero value.
 
-  Note that @code{scroll-margin}, described below, limits the amount
-of scrolling so as to put point outside of the top or bottom margin,
-even if aggressive scrolling specifies a fraction @var{f} that is
-larger than the window portion between the top and the bottom margins.
-
 @vindex scroll-margin
   The variable @code{scroll-margin} restricts how close point can come
-to the top or bottom of a window.  Its value is a number of screen
+to the top or bottom of a window (even if aggressive scrolling
+specifies a fraction @var{f} that is larger than the window portion
+between the top and the bottom margins).  Its value is a number of screen
 lines; if point comes within that many lines of the top or bottom of
 the window, Emacs performs automatic scrolling.  By default,
 @code{scroll-margin} is 0.
@@ -286,8 +283,8 @@ scrolling whenever point moves off the left or right edge of the
 screen.  To disable automatic horizontal scrolling, set the variable
 @code{auto-hscroll-mode} to @code{nil}.  Note that when the automatic
 horizontal scrolling is turned off, if point moves off the edge of the
-screen, the cursor disappears to indicate that.  (On text-only
-terminals, the cursor is left at the edge instead.)
+screen, the cursor disappears to indicate that.  (On text terminals,
+the cursor is left at the edge instead.)
 
 @vindex hscroll-margin
   The variable @code{hscroll-margin} controls how close point can get
@@ -448,7 +445,7 @@ and visits it with View mode enabled.
 @cindex synchronizing windows
 
   @dfn{Follow mode} is a minor mode that makes two windows, both
-showing the same buffer, scroll as a single tall ``virtual window.''
+showing the same buffer, scroll as a single tall ``virtual window''.
 To use Follow mode, go to a frame with just one window, split it into
 two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x
 follow-mode}.  From then on, you can edit the buffer in either of the
@@ -479,9 +476,9 @@ prompts for a regular expression, and displays only faces with names
 matching that regular expression (@pxref{Regexps}).
 
   It's possible for a given face to look different in different
-frames.  For instance, some text-only terminals do not support all
-face attributes, particularly font, height, and width, and some
-support a limited range of colors.
+frames.  For instance, some text terminals do not support all face
+attributes, particularly font, height, and width, and some support a
+limited range of colors.
 
 @cindex background color
 @cindex default face
@@ -489,10 +486,20 @@ support a limited range of colors.
 changes for future Emacs sessions.  @xref{Face Customization}.  A face
 does not have to specify every single attribute; often it inherits
 most attributes from another face.  Any ultimately unspecified
-attribute is taken from a face named @code{default}, whose attributes
-are all specified.  The @code{default} face is the default for
-displaying text, and its background color is also used as the frame's
-background color.
+attribute is taken from the face named @code{default}.
+
+  The @code{default} face is the default for displaying text, and all
+of its attributes are specified.  Its background color is also used as
+the frame's background color.  @xref{Colors}.
+
+@cindex cursor face
+  Another special face is the @code{cursor} face.  On graphical
+displays, the background color of this face is used to draw the text
+cursor.  None of the other attributes of this face have any effect;
+the foreground color for text under the cursor is taken from the
+background color of the underlying text.  On text terminals, the
+appearance of the text cursor is determined by the terminal, not by
+the @code{cursor} face.
 
   You can also use X resources to specify attributes of any particular
 face.  @xref{Resources}.
@@ -514,16 +521,18 @@ specify a color for a face---for instance, when customizing the face
 or an @dfn{RGB triplet}.
 
 @findex list-colors-display
+@vindex list-colors-sort
   A color name is a pre-defined name, such as @samp{dark orange} or
 @samp{medium sea green}.  To view a list of color names, type @kbd{M-x
-list-colors-display}.  If you run this command on a graphical display,
-it shows the full range of color names known to Emacs (these are the
-standard X11 color names, defined in X's @file{rgb.txt} file).  If you
-run the command on a text-only terminal, it shows only a small subset
-of colors that can be safely displayed on such terminals.  However,
-Emacs understands X11 color names even on text-only terminals; if a
-face is given a color specified by an X11 color name, it is displayed
-using the closest-matching terminal color.
+list-colors-display}.  To control the order in which colors are shown,
+customize @code{list-colors-sort}.  If you run this command on a
+graphical display, it shows the full range of color names known to
+Emacs (these are the standard X11 color names, defined in X's
+@file{rgb.txt} file).  If you run the command on a text terminal, it
+shows only a small subset of colors that can be safely displayed on
+such terminals.  However, Emacs understands X11 color names even on
+text terminals; if a face is given a color specified by an X11 color
+name, it is displayed using the closest-matching terminal color.
 
   An RGB triplet is a string of the form @samp{#RRGGBB}.  Each of the
 R, G, and B components is a hexadecimal number specifying the
@@ -639,8 +648,8 @@ 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 on
-text-only terminals.
+This face is used for the vertical divider between windows on text
+terminals.
 @item minibuffer-prompt
 @cindex @code{minibuffer-prompt} face
 @vindex minibuffer-prompt-properties
@@ -667,9 +676,9 @@ This face determines the color of the mouse pointer.
 @end table
 
   The following faces likewise control the appearance of parts of the
-Emacs frame, but only on text-only terminals, or when Emacs is built
-on X with no toolkit support.  (For all other cases, the appearance of
-the respective frame elements is determined by system-wide settings.)
+Emacs frame, but only on text terminals, or when Emacs is built on X
+with no toolkit support.  (For all other cases, the appearance of the
+respective frame elements is determined by system-wide settings.)
 
 @table @code
 @item scroll-bar
@@ -750,11 +759,10 @@ argument disables it.
 
 @findex global-font-lock-mode
 @vindex global-font-lock-mode
-  To toggle Font Lock mode in all buffers, type @kbd{M-x
-global-font-lock-mode}.  To impose this setting for future Emacs
-sessions, customize the variable @code{global-font-lock-mode}
-(@pxref{Easy Customization}), or add the following line to your init
-file:
+  Type @kbd{M-x global-font-lock-mode} to toggle Font Lock mode in all
+buffers.  To impose this setting for future Emacs sessions, customize
+the variable @code{global-font-lock-mode} (@pxref{Easy
+Customization}), or add the following line to your init file:
 
 @example
 (global-font-lock-mode 0)
@@ -970,15 +978,15 @@ fringes on the selected frame only, use @kbd{M-x set-fringe-style}.
 line (@pxref{Continuation Lines}).  When one line of text is split
 into multiple screen lines, 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
+real beginning''.  The right fringe shows a curving arrow for each
 screen line except the last, indicating that ``this is not the real
-end.''  If the line's direction is right-to-left (@pxref{Bidirectional
+end''.  If the line's direction is right-to-left (@pxref{Bidirectional
 Editing}), the meanings of the curving arrows in the fringes are
 swapped.
 
   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
+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 buffer
@@ -1441,9 +1449,9 @@ global-hl-line-mode} enables or disables the same mode globally.
 Emacs can display long lines by @dfn{truncation}.  This means that all
 the characters that do not fit in the width of the screen or window do
 not appear at all.  On graphical displays, a small straight arrow in
-the fringe indicates truncation at either end of the line.  On
-text-only terminals, this is indicated with @samp{$} signs in the
-leftmost and/or rightmost columns.
+the fringe indicates truncation at either end of the line.  On text
+terminals, this is indicated with @samp{$} signs in the leftmost
+and/or rightmost columns.
 
 @vindex truncate-lines
 @findex toggle-truncate-lines
@@ -1565,7 +1573,7 @@ of an overline above the text, including the height of the overline
 itself, in pixels; the default is 2.
 
 @findex tty-suppress-bold-inverse-default-colors
-  On some text-only terminals, bold face and inverse video together
-result in text that is hard to read.  Call the function
+  On some text terminals, bold face and inverse video together result
+in text that is hard to read.  Call the function
 @code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil}
 argument to suppress the effect of bold-face in this case.