@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
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.
@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
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 terminals do not support all face
attributes, particularly font, height, and width, and some support a
-limited range of colors.
+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 the face named @code{default}.
+ 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
@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)
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
@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
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