Doc fixes for text-scale-adjust
[bpt/emacs.git] / doc / emacs / display.texi
index 2fa7112..80dffe2 100644 (file)
@@ -1,6 +1,6 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2013 Free Software
+@c Foundation, Inc.
 
 @c See file emacs.texi for copying conditions.
 @node Display
@@ -213,52 +213,62 @@ entire current defun onto the screen if possible.
 @node Auto Scrolling
 @section Automatic Scrolling
 
+@cindex automatic scrolling
   Emacs performs @dfn{automatic scrolling} when point moves out of the
-visible portion of the text.
+visible portion of the text.  Normally, automatic scrolling centers
+point vertically in the window, but there are several ways to alter
+this behavior.
 
 @vindex scroll-conservatively
-  Normally, this centers point vertically within the window.  However,
-if you set @code{scroll-conservatively} to a small number @var{n},
-then if you move point just a little off the screen (less than @var{n}
-lines), Emacs scrolls the text just far enough to bring point back on
-screen.  By default, @code{scroll-conservatively} is@tie{}0.  If you
-set @code{scroll-conservatively} to a large number (larger than 100),
-Emacs will never center point as result of scrolling, even if point
-moves far away from the text previously displayed in the window.  With
-such a large value, Emacs will always scroll text just enough for
-bringing point into view, so point will end up at the top or bottom of
-the window, depending on the scroll direction.
+  If you set @code{scroll-conservatively} to a small number @var{n},
+then moving point just a little off the screen (no more than @var{n}
+lines) causes Emacs to scroll just enough to bring point back on
+screen; if doing so fails to make point visible, Emacs scrolls just
+far enough to center point in the window.  If you set
+@code{scroll-conservatively} to a large number (larger than 100),
+automatic scrolling never centers point, no matter how far point
+moves; Emacs always scrolls text just enough to bring point into view,
+either at the top or bottom of the window depending on the scroll
+direction.  By default, @code{scroll-conservatively} is@tie{}0, which
+means to always center point in the window.
 
 @vindex scroll-step
-  The variable @code{scroll-step} determines how many lines to scroll
-the window when point moves off the screen.  If moving by that number
-of lines fails to bring point back into view, point is centered
-instead.  The default value is zero, which causes point to always be
-centered after scrolling.
+  Another way to control automatic scrolling is to customize the
+variable @code{scroll-step}.  Its value determines the number of lines
+by which to automatically scroll, when point moves off the screen.  If
+scrolling by that number of lines fails to bring point back into view,
+point is centered instead.  The default value is zero, which (by
+default) causes point to always be centered after scrolling.
 
 @cindex aggressive scrolling
 @vindex scroll-up-aggressively
 @vindex scroll-down-aggressively
-  When the window does scroll by a distance longer than
-@code{scroll-step}, you can control how aggressively it scrolls by
-setting the variables @code{scroll-up-aggressively} and
-@code{scroll-down-aggressively}.  The value of
-@code{scroll-up-aggressively} should be either @code{nil}, or a
-fraction @var{f} between 0 and 1.  A fraction specifies where on the
-screen to put point when scrolling upward, i.e.@: forward.  When point
-goes off the window end, the new start position is chosen to put point
-@var{f} parts of the window height from the bottom margin.  Thus,
-larger @var{f} means more aggressive scrolling: more new text is
-brought into view.  The default value, @code{nil}, is equivalent to
-0.5.
-
-  Likewise, @code{scroll-down-aggressively} is used for scrolling
-down, i.e.@: backward.  The value specifies how far point should be
-placed from the top margin of the window; thus, as with
-@code{scroll-up-aggressively}, a larger value is more aggressive.
-
-  These two variables are ignored if either @code{scroll-step} or
-@code{scroll-conservatively} are set to a non-zero value.
+  A third way to control automatic scrolling is to customize the
+variables @code{scroll-up-aggressively} and
+@code{scroll-down-aggressively}, which directly specify the vertical
+position of point after scrolling.  The value of
+@code{scroll-up-aggressively} should be either @code{nil} (the
+default), or a floating point number @var{f} between 0 and 1.  The
+latter means that when point goes below the bottom window edge (i.e.,
+scrolling forward), Emacs scrolls the window so that point is @var{f}
+parts of the window height from the bottom window edge.  Thus, larger
+@var{f} means more aggressive scrolling: more new text is brought into
+view.  The default value, @code{nil}, is equivalent to 0.5.
+
+  Likewise, @code{scroll-down-aggressively} is used when point goes
+above the bottom window edge (i.e., scrolling backward).  The value
+specifies how far point should be from the top margin of the window
+after scrolling.  Thus, as with @code{scroll-up-aggressively}, a
+larger value is more aggressive.
+
+  Note that the variables @code{scroll-conservatively},
+@code{scroll-step}, and @code{scroll-up-aggressively} /
+@code{scroll-down-aggressively} control automatic scrolling in
+contradictory ways.  Therefore, you should pick no more than one of
+these methods to customize automatic scrolling.  In case you customize
+multiple variables, the order of priority is:
+@code{scroll-conservatively}, then @code{scroll-step}, and finally
+@code{scroll-up-aggressively} / @code{scroll-down-aggressively}.
 
 @vindex scroll-margin
   The variable @code{scroll-margin} restricts how close point can come
@@ -288,10 +298,10 @@ the cursor is left at the edge instead.)
 
 @vindex hscroll-margin
   The variable @code{hscroll-margin} controls how close point can get
-to the window's edges before automatic scrolling occurs.  It is
-measured in columns.  For example, if the value is 5, then moving
-point within 5 columns of an edge causes horizontal scrolling away
-from that edge.
+to the window's left and right edges before automatic scrolling
+occurs.  It is measured in columns.  For example, if the value is 5,
+then moving point within 5 columns of an edge causes horizontal
+scrolling away from that edge.
 
 @vindex hscroll-step
   The variable @code{hscroll-step} determines how many columns to
@@ -475,18 +485,26 @@ 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 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
@@ -692,6 +710,17 @@ This face determines the color of tool bar icons.  @xref{Tool Bars}.
 @cindex customization of @code{menu} face
 This face determines the colors and font of Emacs's menus.  @xref{Menu
 Bars}.
+@item tty-menu-enabled-face
+@cindex faces for text-mode menus
+@cindex TTY menu faces
+This face is used to display enabled menu items on text-mode
+terminals.
+@item tty-menu-disabled-face
+This face is used to display disabled menu items on text-mode
+terminals.
+@item tty-menu-selected-face
+This face is used to display on text-mode terminals the menu item that
+would be selected if you click a mouse or press @key{RET}.
 @end table
 
 @node Text Scale
@@ -714,9 +743,9 @@ determine which action to take.
 @kbd{C-x}.  For instance, @kbd{C-x C-= C-= C-=} increases the face
 height by three steps.  Each step scales the text height by a factor
 of 1.2; to change this factor, customize the variable
-@code{text-scale-mode-step}.  As an exception, a numeric argument of 0
+@code{text-scale-mode-step}.  A numeric argument of 0
 to the @code{text-scale-adjust} command restores the default height,
-similar to typing @kbd{C-x C-0}.
+the same as typing @kbd{C-x C-0}.
 
 @cindex increase buffer face height
 @findex text-scale-increase
@@ -885,14 +914,16 @@ 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}
+@item M-s h r @var{regexp} @key{RET} @var{face} @key{RET}
+@itemx C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
+@kindex M-s h r
 @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
+@kbd{M-s h r 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 list of default values.  While being prompted
 for a face use @kbd{M-n} and @kbd{M-p} to cycle through them.
@@ -900,7 +931,9 @@ for a face use @kbd{M-n} and @kbd{M-p} 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}
+@item M-s h u @var{regexp} @key{RET}
+@itemx C-x w r @var{regexp} @key{RET}
+@kindex M-s h u
 @kindex C-x w r
 @findex unhighlight-regexp
 Unhighlight @var{regexp} (@code{unhighlight-regexp}).
@@ -908,13 +941,15 @@ 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; use @kbd{M-n} to show the next older expression and
+@kbd{M-p} 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}
+@item M-s h l @var{regexp} @key{RET} @var{face} @key{RET}
+@itemx C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
+@kindex M-s h l
 @kindex C-x w l
 @findex highlight-lines-matching-regexp
 @cindex lines, highlighting
@@ -922,7 +957,31 @@ the minibuffer and unhighlight it.
 Highlight entire lines containing a match for @var{regexp}, using face
 @var{face} (@code{highlight-lines-matching-regexp}).
 
-@item C-x w b
+@item M-s h p @var{phrase} @key{RET} @var{face} @key{RET}
+@itemx C-x w p @var{phrase} @key{RET} @var{face} @key{RET}
+@kindex M-s h p
+@kindex C-x w p
+@findex highlight-phrase
+@cindex phrase, highlighting
+@cindex highlighting phrase
+Highlight matches of @var{phrase}, using face @var{face}
+(@code{highlight-phrase}).  @var{phrase} can be any regexp,
+but spaces will be replaced by matches to whitespace and
+initial lower-case letters will become case insensitive.
+
+@item M-s h .
+@itemx C-x w .
+@kindex M-s h .
+@kindex C-x w .
+@findex highlight-symbol-at-point
+@cindex symbol, highlighting
+@cindex highlighting symbol at point
+Highlight the symbol found near point without prompting, using the next
+available face automatically (@code{highlight-symbol-at-point}).
+
+@item M-s h w
+@itemx C-x w b
+@kindex M-s h w
 @kindex C-x w b
 @findex hi-lock-write-interactive-patterns
 Insert all the current highlighting regexp/face pairs into the buffer
@@ -934,7 +993,9 @@ These patterns are extracted from the comments, if appropriate, if you
 invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while
 Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}).
 
-@item C-x w i
+@item M-s h f
+@itemx C-x w i
+@kindex M-s h f
 @kindex C-x w i
 @findex hi-lock-find-patterns
 Extract regexp/face pairs from comments in the current buffer
@@ -967,12 +1028,15 @@ mode's symbol is a member of the list @code{hi-lock-exclude-modes}.
 
 @findex set-fringe-style
 @findex fringe-mode
+@vindex fringe-mode @r{(variable)}
   On graphical displays, each Emacs window normally has narrow
 @dfn{fringes} on the left and right edges.  The fringes are used to
 display symbols that provide information about the text in the window.
 You can type @kbd{M-x fringe-mode} to disable the fringes, or modify
 their width.  This command affects fringes in all frames; to modify
 fringes on the selected frame only, use @kbd{M-x set-fringe-style}.
+You can make your changes to the fringes permanent by customizing the
+variable @code{fringe-mode}.
 
   The most common use of the fringes is to indicate a continuation
 line (@pxref{Continuation Lines}).  When one line of text is split
@@ -1036,9 +1100,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
@@ -1053,9 +1117,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
@@ -1067,7 +1135,7 @@ buffer text, so blank lines at the end of the buffer stand out because
 they lack this image.  To enable this feature, set the buffer-local
 variable @code{indicate-empty-lines} to a non-@code{nil} value.  You
 can enable or disable this feature for all new buffers by setting the
-default value of this variable, e.g.@: @code{(setq-default
+default value of this variable, e.g., @code{(setq-default
 indicate-empty-lines t)}.
 
 @cindex Whitespace mode
@@ -1236,7 +1304,7 @@ line looks like this:
 Here @var{hh} and @var{mm} are the hour and minute, followed always by
 @samp{am} or @samp{pm}.  @var{l.ll} is the average number, collected
 for the last few minutes, of processes in the whole system that were
-either running or ready to run (i.e.@: were waiting for an available
+either running or ready to run (i.e., were waiting for an available
 processor).  (Some fields may be missing if your operating system
 cannot support them.)  If you prefer time display in 24-hour format,
 set the variable @code{display-time-24hr-format} to @code{t}.
@@ -1347,7 +1415,7 @@ as octal escape sequences instead of caret escape sequences.
   Some non-@acronym{ASCII} characters have the same appearance as an
 @acronym{ASCII} space or hyphen (minus) character.  Such characters
 can cause problems if they are entered into a buffer without your
-realization, e.g.@: by yanking; for instance, source code compilers
+realization, e.g., by yanking; for instance, source code compilers
 typically do not treat non-@acronym{ASCII} spaces as whitespace
 characters.  To deal with this problem, Emacs displays such characters
 specially: it displays @code{U+00A0} (no-break space) with the
@@ -1481,6 +1549,7 @@ attempts to wrap the line at word boundaries near the right window
 edge.  This makes the text easier to read, as wrapping does not occur
 in the middle of words.
 
+@cindex mode, Visual Line
 @cindex Visual Line mode
 @findex visual-line-mode
 @findex global-visual-line-mode