]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/display.texi
* window.c (quad): New function.
[gnu-emacs] / doc / emacs / display.texi
index e7d58c32290de1fbfa22ef3984c9fa53e344bd01..90bfcf147c55dde18e069a557dcb3205cb8c7fde 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
@@ -478,21 +475,39 @@ type @kbd{M-x list-faces-display}.  With a prefix argument, this
 prompts for a regular expression, and displays only faces with names
 matching that regular expression (@pxref{Regexps}).
 
+@vindex frame-background-mode
   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.  In addition, most Emacs faces are defined so
+that their attributes are different on light and dark frame
+backgrounds, for reasons of legibility.  By default, Emacs
+automatically chooses which set of face attributes to display on each
+frame, based on the frame's current background color.  However, you
+can override this by giving the variable @code{frame-background-mode}
+a non-@code{nil} value.  A value of @code{dark} makes Emacs treat all
+frames as if they have a dark background, whereas a value of
+@code{light} makes it treat all frames as if they have a light
+background.
 
 @cindex background color
 @cindex default face
-  You can customize a face to alter its appearance, and save those
-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.
+  You can customize a face to alter its attributes, and save those
+customizations for future Emacs sessions.  @xref{Face Customization},
+for details.
+
+  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 +529,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 +656,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 +684,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 +767,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 +986,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
@@ -1028,9 +1044,9 @@ the left fringe, but no arrow bitmaps, use @code{((top .  left)
 @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, and it can be a nuisance.
+empty lines at the end of a buffer, without realizing it.  In most
+cases, this @dfn{trailing whitespace} has no effect, but sometimes it
+can be a nuisance.
 
   You can make trailing whitespace at the end of a line visible by
 setting the buffer-local variable @code{show-trailing-whitespace} to
@@ -1045,9 +1061,13 @@ the location of point is enough to show you that the spaces are
 present.
 
 @findex delete-trailing-whitespace
+@vindex delete-trailing-lines
   Type @kbd{M-x delete-trailing-whitespace} to delete all trailing
-whitespace within the buffer.  If the region is active, it deletes all
-trailing whitespace in the region instead.
+whitespace.  This command deletes all extra spaces at the end of each
+line in the buffer, and all empty lines at the end of the buffer; to
+ignore the latter, change the variable @code{delete-trailing-lines} to
+@code{nil}.  If the region is active, the command instead deletes
+extra spaces at the end of each line in the region.
 
 @vindex indicate-empty-lines
 @cindex unused lines
@@ -1441,9 +1461,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 +1585,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.