Doc improvements for face remapping.
[bpt/emacs.git] / doc / lispref / text.texi
index 1ba0cae..63a6d2c 100644 (file)
@@ -1,9 +1,8 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-2012  Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-2012 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
-@setfilename ../../info/text
-@node Text, Non-ASCII Characters, Markers, Top
+@node Text
 @chapter Text
 @cindex text
 
@@ -556,7 +555,7 @@ error; if some of the text in it is read-only, it signals a
 asking for any confirmation.  It returns @code{nil}.
 
 Normally, deleting a large amount of text from a buffer inhibits further
-auto-saving of that buffer ``because it has shrunk.''  However,
+auto-saving of that buffer ``because it has shrunk''.  However,
 @code{erase-buffer} does not do this, the idea being that the future
 text is not really related to the former text, and its size should not
 be compared with that of the former text.
@@ -807,7 +806,7 @@ that treat it as a ring.
 
   Some people think this use of the word ``kill'' is unfortunate, since
 it refers to operations that specifically @emph{do not} destroy the
-entities ``killed.''  This is in sharp contrast to ordinary life, in
+entities ``killed''.  This is in sharp contrast to ordinary life, in
 which death is permanent and ``killed'' entities do not come back to
 life.  Therefore, other metaphors have been proposed.  For example, the
 term ``cut ring'' makes sense to people who, in pre-computer days, used
@@ -824,7 +823,6 @@ would be difficult to change the terminology now.
 @end menu
 
 @node Kill Ring Concepts
-@comment  node-name,  next,  previous,  up
 @subsection Kill Ring Concepts
 
   The kill ring records killed text as strings in a list, most recent
@@ -846,12 +844,11 @@ the entry made by the first one.
 
   For yanking, one entry in the kill ring is designated the ``front'' of
 the ring.  Some yank commands ``rotate'' the ring by designating a
-different element as the ``front.''  But this virtual rotation doesn't
+different element as the ``front''.  But this virtual rotation doesn't
 change the list itself---the most recent entry always comes first in the
 list.
 
 @node Kill Functions
-@comment  node-name,  next,  previous,  up
 @subsection Functions for Killing
 
   @code{kill-region} is the usual subroutine for killing text.  Any
@@ -968,7 +965,6 @@ specifying key bindings.
 @end defopt
 
 @node Yank Commands
-@comment  node-name,  next,  previous,  up
 @subsection Functions for Yanking
 
   This section describes higher-level commands for yanking, which are
@@ -1094,8 +1090,8 @@ programs, when you are using a window system.  Its value should be
 @code{nil} or a function of no arguments.
 
 If the value is a function, @code{current-kill} calls it to get the
-``most recent kill.''  If the function returns a non-@code{nil} value,
-then that value is used as the ``most recent kill.''  If it returns
+``most recent kill''.  If the function returns a non-@code{nil} value,
+then that value is used as the ``most recent kill''.  If it returns
 @code{nil}, then the front of the kill ring is used.
 
 To facilitate support for window systems that support multiple
@@ -1124,7 +1120,6 @@ window system's clipboard.  @xref{Window System Selections}.
 @end defvar
 
 @node Internals of Kill Ring
-@comment  node-name,  next,  previous,  up
 @subsection Internals of the Kill Ring
 
   The variable @code{kill-ring} holds the kill ring contents, in the
@@ -1197,7 +1192,6 @@ value for @code{kill-ring-max} is 60.
 @end defopt
 
 @node Undo
-@comment  node-name,  next,  previous,  up
 @section Undo
 @cindex redo
 
@@ -1400,7 +1394,6 @@ leak memory if the user waits too long before answering the question.
 @end defopt
 
 @node Filling
-@comment  node-name,  next,  previous,  up
 @section Filling
 @cindex filling text
 
@@ -1778,7 +1771,6 @@ prefix or @code{nil}, meaning it has failed to determine a prefix.
 @end defopt
 
 @node Auto Filling
-@comment  node-name,  next,  previous,  up
 @section Auto Filling
 @cindex filling, automatic
 @cindex Auto Fill mode
@@ -1800,12 +1792,6 @@ special is done in that case.
 The value of @code{auto-fill-function} is @code{do-auto-fill} when
 Auto-Fill mode is enabled.  That is a function whose sole purpose is to
 implement the usual strategy for breaking a line.
-
-@quotation
-In older Emacs versions, this variable was named @code{auto-fill-hook},
-but since it is not called with the standard convention for hooks, it
-was renamed to @code{auto-fill-function} in version 19.
-@end quotation
 @end defvar
 
 @defvar normal-auto-fill-function
@@ -2079,7 +2065,6 @@ utility program.
 @end deffn
 
 @node Columns
-@comment  node-name,  next,  previous,  up
 @section Counting Columns
 @cindex columns
 @cindex counting columns
@@ -2422,7 +2407,6 @@ column, this command does nothing.
 @end deffn
 
 @node Indent Tabs
-@comment  node-name,  next,  previous,  up
 @subsection Adjustable ``Tab Stops''
 @cindex tabs stops for indentation
 
@@ -2481,7 +2465,6 @@ If @var{arg} is omitted or @code{nil}, it defaults to 1.
 @end deffn
 
 @node Case Changes
-@comment  node-name,  next,  previous,  up
 @section Case Changes
 @cindex case conversion in buffers
 
@@ -3021,7 +3004,11 @@ time you want to specify a particular attribute for certain text.
 @xref{Face Attributes}.
 
 @item
-A list, where each element uses one of the two forms listed above.
+A list of faces.  This specifies a face which is an aggregate of the
+attributes of each of the listed faces.  Faces occurring earlier in
+the list have higher priority.  Each list element must have one of the
+two above forms (i.e.@: either a face name or a property list of face
+attributes).
 @end itemize
 
 Font Lock mode (@pxref{Font Lock Mode}) works in most buffers by
@@ -3179,21 +3166,41 @@ Consecutive characters with the same @code{field} property constitute a
 
 @item cursor
 @kindex cursor @r{(text property)}
-Normally, the cursor is displayed at the end of any overlay and text
-property strings present at the current buffer position.  You can
-place the cursor on any desired character of these strings by giving
-that character a non-@code{nil} @code{cursor} text property.  In
-addition, if the value of the @code{cursor} property of an overlay
-string is an integer number, it specifies the number of buffer's
-character positions associated with the overlay string; this way,
-Emacs will display the cursor on the character with that property
-regardless of whether the current buffer position is actually covered
-by the overlay.  Specifically, if the value of the @code{cursor}
-property of a character is the number @var{n}, the cursor will be
-displayed on this character for any buffer position in the range
-@code{[@var{ovpos}..@var{ovpos}+@var{n}]}, where @var{ovpos} is the
-starting buffer position covered by the overlay (@pxref{Managing
-Overlays}).
+Normally, the cursor is displayed at the beginning or the end of any
+overlay and text property strings present at the current buffer
+position.  You can place the cursor on any desired character of these
+strings by giving that character a non-@code{nil} @code{cursor} text
+property.  In addition, if the value of the @code{cursor} property is
+an integer number, it specifies the number of buffer's character
+positions, starting with the position where the overlay or the
+@code{display} property begins, for which the cursor should be
+displayed on that character.  Specifically, if the value of the
+@code{cursor} property of a character is the number @var{n}, the
+cursor will be displayed on this character for any buffer position in
+the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos}
+is the overlay's starting position given by @code{overlay-start}
+(@pxref{Managing Overlays}), or the position where the @code{display}
+text property begins in the buffer.
+
+In other words, the string character with the @code{cursor} property
+of any non-@code{nil} value is the character where to display the
+cursor.  The value of the property says for which buffer positions to
+display the cursor there.  If the value is an integer number @var{n},
+the cursor is displayed there when point is anywhere between the
+beginning of the overlay or @code{display} property and @var{n}
+positions after that.  If the value is anything else and
+non-@code{nil}, the cursor is displayed there only when point is at
+the beginning of the @code{display} property or at
+@code{overlay-start}.
+
+@cindex cursor position for @code{display} properties and overlays
+When the buffer has many overlay strings (e.g., @pxref{Overlay
+Properties, before-string}) or @code{display} properties that are
+strings, it is a good idea to use the @code{cursor} property on these
+strings to cue the Emacs display about the places where to put the
+cursor while traversing these strings.  This directly communicates to
+the display engine where the Lisp program wants to put the cursor, or
+where the user would expect the cursor.
 
 @item pointer
 @kindex pointer @r{(text property)}
@@ -3485,7 +3492,7 @@ once for the same part of the buffer, you can use the variable
 If this variable's value is non-@code{nil}, it is a symbol which is used
 as a text property name.  A non-@code{nil} value for that text property
 means, ``the other text properties for this character have already been
-computed.''
+computed''.
 
 If all the characters in the range specified for @code{buffer-substring}
 have a non-@code{nil} value for this property, @code{buffer-substring}
@@ -3517,7 +3524,7 @@ properties.  For simplicity, we will refer to the clickable text as a
 @dfn{link}.
 
   Implementing a link involves three separate steps: (1) indicating
-clickability when the mouse moves over the link; (2) making @kbd{RET}
+clickability when the mouse moves over the link; (2) making @key{RET}
 or @kbd{Mouse-2} on that link do something; and (3) setting up a
 @code{follow-link} condition so that the link obeys
 @code{mouse-1-click-follows-link}.
@@ -3789,7 +3796,7 @@ after @var{old-pos}.)  If @var{escape-from-edge} is non-@code{nil},
 @var{new-pos} can be anywhere in the two adjacent fields.
 Additionally, if two fields are separated by another field with the
 special value @code{boundary}, then any point within this special
-field is also considered to be ``on the boundary.''
+field is also considered to be ``on the boundary''.
 
 Commands like @kbd{C-a} with no argument, that normally move backward
 to a specific kind of location and stay there once there, probably
@@ -4055,7 +4062,7 @@ text, to avoid overlong lines.  However, if the optional argument
 the output is just one long line.
 @end deffn
 
-@deffn Command base64-encode-string string &optional no-line-break
+@defun base64-encode-string string &optional no-line-break
 This function converts the string @var{string} into base 64 code.  It
 returns a string containing the encoded text.  As for
 @code{base64-encode-region}, an error is signaled if a character in the
@@ -4065,15 +4072,15 @@ Normally, this function inserts newline characters into the encoded
 text, to avoid overlong lines.  However, if the optional argument
 @var{no-line-break} is non-@code{nil}, these newlines are not added, so
 the result string is just one long line.
-@end deffn
+@end defun
 
-@defun base64-decode-region beg end
+@deffn Command base64-decode-region beg end
 This function converts the region from @var{beg} to @var{end} from base
 64 code into the corresponding decoded text.  It returns the length of
 the decoded text.
 
 The decoding functions ignore newline characters in the encoded text.
-@end defun
+@end deffn
 
 @defun base64-decode-string string
 This function converts the string @var{string} from base 64 code into
@@ -4314,18 +4321,18 @@ buffer that is about to change is always the current buffer.
 
 @defvar after-change-functions
 This variable holds a list of functions to call after any buffer
-modification.  Each function receives three arguments: the beginning and
-end of the region just changed, and the length of the text that existed
-before the change.  All three arguments are integers.  The buffer that's
-about to change is always the current buffer.
-
-The length of the old text is the difference between the buffer positions
-before and after that text as it was before the change.  As for the
-changed text, its length is simply the difference between the first two
-arguments.
+modification.  Each function receives three arguments: the beginning
+and end of the region just changed, and the length of the text that
+existed before the change.  All three arguments are integers.  The
+buffer has been changed is always the current buffer.
+
+The length of the old text is the difference between the buffer
+positions before and after that text as it was before the change.  As
+for the changed text, its length is simply the difference between the
+first two arguments.
 @end defvar
 
-  Output of messages into the @samp{*Messages*} buffer does not
+  Output of messages into the @file{*Messages*} buffer does not
 call these functions.
 
 @defmac combine-after-change-calls body@dots{}