]> code.delx.au - gnu-emacs/blobdiff - lispref/text.texi
(xscheme-insert-expression): Use add-to-history.
[gnu-emacs] / lispref / text.texi
index caa3f21b7b1cd3b72b1a0a9016ce949d04cbeed6..d506341f0d52fb2c183a4eda24273206a468c902 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001,
+@c   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/text
 @node Text, Non-ASCII Characters, Markers, Top
@@ -191,12 +191,11 @@ This is the contents of buffer foo
 
 @group
 (buffer-substring 1 10)
-@result{} "This is t"
+     @result{} "This is t"
 @end group
 @group
 (buffer-substring (point-max) 10)
-@result{} "he contents of buffer foo
-"
+     @result{} "he contents of buffer foo\n"
 @end group
 @end example
 @end defun
@@ -206,6 +205,46 @@ This is like @code{buffer-substring}, except that it does not copy text
 properties, just the characters themselves.  @xref{Text Properties}.
 @end defun
 
+@defun filter-buffer-substring start end &optional delete noprops
+This function passes the buffer text between @var{start} and @var{end}
+through the filter functions specified by the variable
+@code{buffer-substring-filters}, and returns the value from the last
+filter function.  If @code{buffer-substring-filters} is @code{nil},
+the value is the unaltered text from the buffer, what
+@code{buffer-substring} would return.
+
+If @var{delete} is non-@code{nil}, this function deletes the text
+between @var{start} and @var{end} after copying it, like
+@code{delete-and-extract-region}.
+
+If @var{noprops} is non-@code{nil}, the final string returned does not
+include text properties, while the string passed through the filters
+still includes text properties from the buffer text.
+
+Lisp code should use this function instead of @code{buffer-substring},
+@code{buffer-substring-no-properties},
+or @code{delete-and-extract-region} when copying into user-accessible
+data structures such as the kill-ring, X clipboard, and registers.
+Major and minor modes can add functions to
+@code{buffer-substring-filters} to alter such text as it is copied out
+of the buffer.
+@end defun
+
+@defvar buffer-substring-filters
+This variable should be a list of functions that accept a single
+argument, a string, and return a string.
+@code{filter-buffer-substring} passes the buffer substring to the
+first function in this list, and the return value of each function is
+passed to the next function.  The return value of the last function is
+used as the return value of @code{filter-buffer-substring}.
+
+As a special convention, point is set to the start of the buffer text
+being operated on (i.e., the @var{start} argument for
+@code{filter-buffer-substring}) before these functions are called.
+
+If this variable is @code{nil}, no filtering is performed.
+@end defvar
+
 @defun buffer-string
 This function returns the contents of the entire accessible portion of
 the current buffer as a string.  It is equivalent to
@@ -222,8 +261,7 @@ This is the contents of buffer foo
 ---------- Buffer: foo ----------
 
 (buffer-string)
-     @result{} "This is the contents of buffer foo
-"
+     @result{} "This is the contents of buffer foo\n"
 @end group
 @end example
 @end defun
@@ -362,8 +400,8 @@ overlay.
 
 @defun insert-char character count &optional inherit
 This function inserts @var{count} instances of @var{character} into the
-current buffer before point.  The argument @var{count} should be a
-number, and @var{character} must be a character.  The value is @code{nil}.
+current buffer before point.  The argument @var{count} should be an
+integer, and @var{character} must be a character.  The value is @code{nil}.
 
 This function does not convert unibyte character codes 128 through 255
 to multibyte characters, not even if the current buffer is a multibyte
@@ -437,6 +475,9 @@ it except to install it on a keymap.
 
 In an interactive call, @var{count} is the numeric prefix argument.
 
+Self-insertion translates the input character through
+@code{translation-table-for-input}.  @xref{Translation of Characters}.
+
 This command calls @code{auto-fill-function} whenever that is
 non-@code{nil} and the character inserted is in the table
 @code{auto-fill-chars} (@pxref{Auto Filling}).
@@ -444,10 +485,9 @@ non-@code{nil} and the character inserted is in the table
 @c Cross refs reworded to prevent overfull hbox.  --rjc 15mar92
 This command performs abbrev expansion if Abbrev mode is enabled and
 the inserted character does not have word-constituent
-syntax. (@xref{Abbrevs}, and @ref{Syntax Class Table}.)
-
-This is also responsible for calling @code{blink-paren-function} when
-the inserted character has close parenthesis syntax (@pxref{Blinking}).
+syntax. (@xref{Abbrevs}, and @ref{Syntax Class Table}.)  It is also
+responsible for calling @code{blink-paren-function} when the inserted
+character has close parenthesis syntax (@pxref{Blinking}).
 
 Do not try substituting your own definition of
 @code{self-insert-command} for the standard one.  The editor command
@@ -719,10 +759,11 @@ This has too many spaces at the start of (this list)
 @end smallexample
 @end deffn
 
-@deffn Command just-one-space
+@deffn Command just-one-space &optional n
 @comment !!SourceFile simple.el
 This command replaces any spaces and tabs around point with a single
-space.  It returns @code{nil}.
+space, or @var{n} spaces if @var{n} is specified.  It returns
+@code{nil}.
 @end deffn
 
 @deffn Command delete-blank-lines
@@ -1166,8 +1207,8 @@ text in the buffer automatically add elements to the front of the undo
 list, which is in the variable @code{buffer-undo-list}.
 
 @defvar buffer-undo-list
-This variable's value is the undo list of the current buffer.
-A value of @code{t} disables the recording of undo information.
+This buffer-local variable's value is the undo list of the current
+buffer. A value of @code{t} disables the recording of undo information.
 @end defvar
 
 Here are the kinds of elements an undo list can have:
@@ -1213,6 +1254,19 @@ relocated due to deletion of surrounding text, and that it moved
 @var{adjustment} character positions.  Undoing this element moves
 @var{marker} @minus{} @var{adjustment} characters.
 
+@item (apply @var{funname} . @var{args})
+This is an extensible undo item, which is undone by calling
+@var{funname} with arguments @var{args}.
+
+@item (apply @var{delta} @var{beg} @var{end} @var{funname} . @var{args})
+This is an extensible undo item, which records a change limited to the
+range @var{beg} to @var{end}, which increased the size of the buffer
+by @var{delta}.  It is undone by calling @var{funname} with arguments
+@var{args}.
+
+This kind of element enables undo limited to a region to determine
+whether the element pertains to that region.
+
 @item nil
 This element is a boundary.  The elements between two boundaries are
 called a @dfn{change group}; normally, each change group corresponds to
@@ -1243,6 +1297,12 @@ calls @code{undo-boundary} after each replacement, so that the user can
 undo individual replacements one by one.
 @end defun
 
+@defvar undo-in-progress
+This variable is normally @code{nil}, but the undo commands bind it to
+@code{t}.  This is so that various kinds of change hooks can tell when
+they're being called for the sake of undoing.
+@end defvar
+
 @defun primitive-undo count list
 This is the basic function for undoing elements of an undo list.
 It undoes the first @var{count} elements of @var{list}, returning
@@ -1255,6 +1315,8 @@ list value at the beginning of a sequence of undo operations.  Then the
 undo operations use and update the saved value.  The new elements added
 by undoing are not part of this saved value, so they don't interfere with
 continuing to undo.
+
+This function does not bind @code{undo-in-progress}.
 @end defun
 
 @node Maintaining Undo
@@ -1282,7 +1344,6 @@ You cannot specify any other buffer.
 @end deffn
 
 @deffn Command buffer-disable-undo &optional buffer-or-name
-@deffnx Command buffer-flush-undo &optional buffer-or-name
 @cindex disable undo
 This function discards the undo list of @var{buffer-or-name}, and disables
 further recording of undo information.  As a result, it is no longer
@@ -1291,29 +1352,33 @@ the undo list of @var{buffer-or-name} is already disabled, this function
 has no effect.
 
 This function returns @code{nil}.
-
-The name @code{buffer-flush-undo} is not considered obsolete, but the
-preferred name is @code{buffer-disable-undo}.
 @end deffn
 
   As editing continues, undo lists get longer and longer.  To prevent
 them from using up all available memory space, garbage collection trims
 them back to size limits you can set.  (For this purpose, the ``size''
 of an undo list measures the cons cells that make up the list, plus the
-strings of deleted text.)  Two variables control the range of acceptable
-sizes: @code{undo-limit} and @code{undo-strong-limit}.
+strings of deleted text.)  Three variables control the range of acceptable
+sizes: @code{undo-limit}, @code{undo-strong-limit} and
+@code{undo-outer-limit}.
 
-@defvar undo-limit
+@defopt undo-limit
 This is the soft limit for the acceptable size of an undo list.  The
 change group at which this size is exceeded is the last one kept.
-@end defvar
+@end defopt
 
-@defvar undo-strong-limit
+@defopt undo-strong-limit
 This is the upper limit for the acceptable size of an undo list.  The
 change group at which this size is exceeded is discarded itself (along
 with all older change groups).  There is one exception: the very latest
-change group is never discarded no matter how big it is.
-@end defvar
+change group is only discarded if it exceeds @code{undo-outer-limit}.
+@end defopt
+
+@defopt undo-outer-limit
+If at garbage collection time the undo info for the current command
+exceeds this limit, Emacs discards the info and displays a warning.
+This is a last ditch limit to prevent memory overflow.
+@end defopt
 
 @node Filling
 @comment  node-name,  next,  previous,  up
@@ -1426,10 +1491,10 @@ of justification.  It can be @code{left}, @code{right}, @code{full},
 follow specified justification style (see @code{current-justification},
 below).  @code{nil} means to do full justification.
 
-If @var{eop} is non-@code{nil}, that means do left-justification if
-@code{current-justification} specifies full justification.  This is used
-for the last line of a paragraph; even if the paragraph as a whole is
-fully justified, the last line should not be.
+If @var{eop} is non-@code{nil}, that means do only left-justification
+if @code{current-justification} specifies full justification.  This is
+used for the last line of a paragraph; even if the paragraph as a
+whole is fully justified, the last line should not be.
 
 If @var{nosqueeze} is non-@code{nil}, that means do not change interior
 whitespace.
@@ -1448,11 +1513,23 @@ the text around point.
 @end defun
 
 @defopt sentence-end-double-space
+@anchor{Definition of sentence-end-double-space}
 If this variable is non-@code{nil}, a period followed by just one space
 does not count as the end of a sentence, and the filling functions
 avoid breaking the line at such a place.
 @end defopt
 
+@defopt sentence-end-without-period
+If this variable is non-@code{nil}, a sentence can end without a
+period.  This is used for languages like Thai, where sentences end
+with a double space but without a period.
+@end defopt
+
+@defopt sentence-end-without-space
+If this variable is non-@code{nil}, it should be a string of
+characters that can end a sentence without following spaces.
+@end defopt
+
 @defvar fill-paragraph-function
 This variable provides a way for major modes to override the filling of
 paragraphs.  If the value is non-@code{nil}, @code{fill-paragraph} calls
@@ -1571,19 +1648,25 @@ becomes buffer-local when set in any fashion.
 @end defvar
 
 @defvar fill-nobreak-predicate
-This variable gives major modes a way to specify not to break a line at
-certain places.  Its value should be a function.  This function is
-called during filling, with no arguments and with point located at the
-place where a break is being considered.  If the function returns
-non-@code{nil}, then the line won't be broken there.
+This variable gives major modes a way to specify not to break a line
+at certain places.  Its value should be a list of functions, but a
+single function is also supported for compatibility.  Whenever filling
+considers breaking the line at a certain place in the buffer, it calls
+each of these functions with no arguments and with point located at
+that place.  If any of the functions returns non-@code{nil}, then the
+line won't be broken there.
 @end defvar
 
 @node Adaptive Fill
 @section Adaptive Fill Mode
 @cindex Adaptive Fill mode
 
-  Adaptive Fill mode chooses a fill prefix automatically from the text
-in each paragraph being filled.
+  When @dfn{Adaptive Fill Mode} is enabled, Emacs determines the fill
+prefix automatically from the text in each paragraph being filled
+rather than using a predetermined value.  During filling, this fill
+prefix gets inserted at the start of the second and subsequent lines
+of the paragraph as described in @ref{Filling}, and in @ref{Auto
+Filling}.
 
 @defopt adaptive-fill-mode
 Adaptive Fill mode is enabled when this variable is non-@code{nil}.
@@ -1592,38 +1675,79 @@ It is @code{t} by default.
 
 @defun fill-context-prefix from to
 This function implements the heart of Adaptive Fill mode; it chooses a
-fill prefix based on the text between @var{from} and @var{to}.  It does
-this by looking at the first two lines of the paragraph, based on the
-variables described below.
+fill prefix based on the text between @var{from} and @var{to},
+typically the start and end of a paragraph.  It does this by looking
+at the first two lines of the paragraph, based on the variables
+described below.
 @c The optional argument first-line-regexp is not documented
 @c because it exists for internal purposes and might be eliminated
 @c in the future.
+
+Usually, this function returns the fill prefix, a string.  However,
+before doing this, the function makes a final check (not specially
+mentioned in the following) that a line starting with this prefix
+wouldn't look like the start of a paragraph.  Should this happen, the
+function signals the anomaly by returning @code{nil} instead.
+
+In detail, @code{fill-context-prefix} does this:
+
+@enumerate
+@item
+It takes a candidate for the fill prefix from the first line---it
+tries first the function in @code{adaptive-fill-function} (if any),
+then the regular expression @code{adaptive-fill-regexp} (see below).
+The first non-@code{nil} result of these, or the empty string if
+they're both @code{nil}, becomes the first line's candidate.
+@item
+If the paragraph has as yet only one line, the function tests the
+validity of the prefix candidate just found.  The function then
+returns the candidate if it's valid, or a string of spaces otherwise.
+(see the description of @code{adaptive-fill-first-line-regexp} below).
+@item
+When the paragraph already has two lines, the function next looks for
+a prefix candidate on the second line, in just the same way it did for
+the first line.  If it doesn't find one, it returns @code{nil}.
+@item
+The function now compares the two candidate prefixes heuristically: if
+the non-whitespace characters in the line 2 candidate occur in the
+same order in the line 1 candidate, the function returns the line 2
+candidate.  Otherwise, it returns the largest initial substring which
+is common to both candidates (which might be the empty string).
+@end enumerate
 @end defun
 
 @defopt adaptive-fill-regexp
-This variable holds a regular expression to control Adaptive Fill mode.
 Adaptive Fill mode matches this regular expression against the text
 starting after the left margin whitespace (if any) on a line; the
 characters it matches are that line's candidate for the fill prefix.
+
+@w{@code{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the
+default value.  This matches a number enclosed in parentheses or
+followed by a period, or certain punctuation characters, or any
+sequence of these intermingled with whitespace.  In particular, it
+matches a sequence of whitespace, possibly empty.
 @end defopt
 
 @defopt adaptive-fill-first-line-regexp
-In a one-line paragraph, if the candidate fill prefix matches this
-regular expression, or if it matches @code{comment-start-skip}, then it
-is used---otherwise, spaces amounting to the same width are used
-instead.
-
-However, the fill prefix is never taken from a one-line paragraph
-if it would act as a paragraph starter on subsequent lines.
+Used only in one-line paragraphs, this regular expression acts as an
+additional check of the validity of the one available candidate fill
+prefix: the candidate must match this regular expression, or match
+@code{comment-start-skip}.  If it doesn't, @code{fill-context-prefix}
+replaces the candidate with a string of spaces ``of the same width''
+as it.
+
+The default value of this variable is @w{@code{"\\`[ \t]*\\'"}}, which
+matches only a string of whitespace.  The effect of this default is to
+force the fill prefixes found in one-line paragraphs always to be pure
+whitespace.
 @end defopt
 
 @defopt adaptive-fill-function
 You can specify more complex ways of choosing a fill prefix
 automatically by setting this variable to a function.  The function is
-called when @code{adaptive-fill-regexp} does not match, with point after
-the left margin of a line, and it should return the appropriate fill
-prefix based on that line.  If it returns @code{nil}, that means it sees
-no fill prefix in that line.
+called with point after the left margin (if any) of a line, and it
+must preserve point.  It should return either ``that line's'' fill
+prefix or @code{nil}, meaning it has failed to determine a prefix.
 @end defopt
 
 @node Auto Filling
@@ -1641,8 +1765,8 @@ justify existing text, see @ref{Filling}.
 justification style to refill portions of the text.  @xref{Margins}.
 
 @defvar auto-fill-function
-The value of this variable should be a function (of no arguments) to be
-called after self-inserting a character from the table
+The value of this buffer-local variable should be a function (of no
+arguments) to be called after self-inserting a character from the table
 @code{auto-fill-chars}.  It may be @code{nil}, in which case nothing
 special is done in that case.
 
@@ -1679,7 +1803,7 @@ a buffer.  This is in contrast to the function @code{sort}, which
 rearranges the order of the elements of a list (@pxref{Rearrangement}).
 The values returned by these functions are not meaningful.
 
-@defun sort-subr reverse nextrecfun endrecfun &optional startkeyfun endkeyfun
+@defun sort-subr reverse nextrecfun endrecfun &optional startkeyfun endkeyfun predicate
 This function is the general text-sorting routine that subdivides a
 buffer into records and then sorts them.  Most of the commands in this
 section use this function.
@@ -1733,6 +1857,10 @@ is no need for @var{endkeyfun} if @var{startkeyfun} returns a
 non-@code{nil} value.
 @end enumerate
 
+The argument @var{predicate} is the function to use to compare keys.
+If keys are numbers, it defaults to @code{<}; otherwise it defaults to
+@code{string<}.
+
 As an example of @code{sort-subr}, here is the complete function
 definition for @code{sort-lines}:
 
@@ -1886,19 +2014,27 @@ is useful for sorting tables.
 
 @deffn Command sort-numeric-fields field start end
 This command sorts lines in the region between @var{start} and
-@var{end}, comparing them numerically by the @var{field}th field of each
-line.  The specified field must contain a number in each line of the
-region.  Fields are separated by whitespace and numbered starting from
-1.  If @var{field} is negative, sorting is by the
-@w{@minus{}@var{field}th} field from the end of the line.  This command
-is useful for sorting tables.
+@var{end}, comparing them numerically by the @var{field}th field of
+each line.  Fields are separated by whitespace and numbered starting
+from 1.  The specified field must contain a number in each line of the
+region.  Numbers starting with 0 are treated as octal, and numbers
+starting with @samp{0x} are treated as hexadecimal.
+
+If @var{field} is negative, sorting is by the
+@w{@minus{}@var{field}th} field from the end of the line.  This
+command is useful for sorting tables.
 @end deffn
 
+@defopt sort-numeric-base
+This variable specifies the default radix for
+@code{sort-numeric-fields} to parse numbers.
+@end defopt
+
 @deffn Command sort-columns reverse &optional beg end
 This command sorts the lines in the region between @var{beg} and
-@var{end}, comparing them alphabetically by a certain range of columns.
-The column positions of @var{beg} and @var{end} bound the range of
-columns to sort on.
+@var{end}, comparing them alphabetically by a certain range of
+columns.  The column positions of @var{beg} and @var{end} bound the
+range of columns to sort on.
 
 If @var{reverse} is non-@code{nil}, the sort is in reverse order.
 
@@ -2421,6 +2557,7 @@ along with the characters; this includes such diverse functions as
                              only when text is examined.
 * Clickable Text::         Using text properties to make regions of text
                              do something when you click on them.
+* Links and Mouse-1::      How to make @key{Mouse-1} follow a link.
 * Fields::                 The @code{field} property defines
                              fields within the buffer.
 * Not Intervals::         Why text properties do not use
@@ -2581,9 +2718,9 @@ list.
 @end defun
 
 @defun remove-list-of-text-properties start end list-of-properties &optional object
-Like @code{remove-list-properties} except that
-@var{list-of-properties} is a list property names only, not an
-alternating list of property values.
+Like @code{remove-text-properties} except that
+@var{list-of-properties} is a list of property names only, not an
+alternating list of property names and values.
 @end defun
 
 @defun set-text-properties start end props &optional object
@@ -2603,6 +2740,8 @@ from the specified range of text.  Here's an example:
 @example
 (set-text-properties @var{start} @var{end} nil)
 @end example
+
+Do not rely on the return value of this function.
 @end defun
 
   The easiest way to make a string with text properties
@@ -2816,7 +2955,7 @@ then each element can be any of these possibilities;
 A face name (a symbol or string).
 
 @item
-Starting in Emacs 21, a property list of face attributes.  This has the
+A property list of face attributes.  This has the
 form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a
 face attribute name and @var{value} is a meaningful value for that
 attribute.  With this feature, you do not need to create a face each
@@ -2829,7 +2968,8 @@ A cons cell of the form @code{(foreground-color . @var{color-name})} or
 just the foreground color or just the background color.
 
 @code{(foreground-color . @var{color-name})} is equivalent to
-@code{(:foreground @var{color-name})}, and likewise for the background.
+specifying @code{(:foreground @var{color-name})}, and likewise for the
+background.
 @end itemize
 
 You can use Font Lock Mode (@pxref{Font Lock Mode}), to dynamically
@@ -2848,7 +2988,7 @@ Strictly speaking, @code{font-lock-face} is not a built-in text
 property; rather, it is implemented in Font Lock mode using
 @code{char-property-alias-alist}.  @xref{Examining Properties}.
 
-This property is new in Emacs 21.4.
+This property is new in Emacs 22.1.
 
 @item mouse-face
 @kindex mouse-face @r{(text property)}
@@ -2859,9 +2999,25 @@ that all text between the character and where the mouse is have the same
 
 @item fontified
 @kindex fontified @r{(text property)}
-This property, if non-@code{nil}, says that text in the buffer has
-had faces assigned automatically by a feature such as Font-Lock mode.
-@xref{Auto Faces}.
+This property says whether the text has had faces assigned to it by
+font locking.  The display engine tests it to decide whether a buffer
+portion needs refontifying before display.  @xref{Auto Faces}.  It
+takes one of these three values---other values are invalid:
+
+@table @asis
+@item @code{nil}
+Font locking is disabled, or the @code{face} properties on the text,
+if any, are invalid.
+
+@item The symbol @code{defer}
+This value states that the text's @code{face} properties are invalid
+and marks it for deferred fontification.  It is used only when ``just
+in time'' font locking is enabled.
+
+@item @code{t}
+The @code{face} properties, or lack of them, on the text are currently
+valid.
+@end table
 
 @item display
 @kindex display @r{(text property)}
@@ -2881,10 +3037,10 @@ Manual}).
 
 If the value of the @code{help-echo} property is a function, that
 function is called with three arguments, @var{window}, @var{object} and
-@var{position} and should return a help string or @var{nil} for
+@var{pos} and should return a help string or @code{nil} for
 none.  The first argument, @var{window} is the window in which
 the help was found.  The second, @var{object}, is the buffer, overlay or
-string which had the @code{help-echo} property.  The @var{position}
+string which had the @code{help-echo} property.  The @var{pos}
 argument is as follows:
 
 @itemize @bullet{}
@@ -2984,53 +3140,21 @@ that character a non-@code{nil} @var{cursor} text property.
 @item pointer
 @kindex pointer @r{(text property)}
 This specifies a specific pointer shape when the mouse pointer is over
-this text or image.  See the variable @var{void-area-text-pointer}
-for possible pointer shapes.
+this text or image.  @xref{Pointer Shape}, for possible pointer
+shapes.
 
 @item line-spacing
 @kindex line-spacing @r{(text property)}
 A newline can have a @code{line-spacing} text or overlay property that
 controls the height of the display line ending with that newline.  The
 property value overrides the default frame line spacing and the buffer
-local @code{line-spacing} variable.  We will call the property value
-@var{line-spacing}.
-
-If @var{line-spacing} is a positive integer, the value specifies
-additional vertical space, below the display line, in pixels.
-
-If @var{line-spacing} is a floating point number or cons, the
-additional vertical space is the product of @var{line-spacing} and the
-default frame line height.
-
-If the @var{line-spacing} value is a cons @code{(total .
-@var{spacing})} where @var{spacing} is any of the forms described
-above, the value of @var{spacing} specifies the total displayed height
-of the line, regardless of the height of the characters in it.  This
-is equivalent to using the @code{line-height} property.
+local @code{line-spacing} variable.  @xref{Line Height}.
 
 @item line-height
 @kindex line-height @r{(text property)}
 A newline can have a @code{line-height} text or overlay property that
 controls the total height of the display line ending in that newline.
-We will call the property value @var{line-height}.
-
-If @var{line-height} is 0, the height of the line is determined solely
-from its contents; nothing is added.  Any @code{line-spacing} property
-on this newline is ignored.  This case is useful for tiling small
-images or image slices without adding blank areas between the images.
-
-If @var{line-height} is a positive integer, the value specifies the
-minimum line height in pixels.  The line's ascent height is
-increased as necessary to achieve the specified height.
-
-If @var{line-height} is a floating point number, the minimum line
-height is the product of @var{line-height} and the default frame line
-height.
-
-If @var{line-height} is a cons @code{(@var{ratio} . @var{face})}, the
-minimum line height is calculated as @var{ratio} times the height of
-face @var{face}.  The @var{ratio} is an integer or a floating point
-number.  If @var{face} is @code{t}, it refers to the current face.
+@xref{Line Height}.
 
 @item modification-hooks
 @cindex change hooks for a character
@@ -3044,6 +3168,10 @@ particular modification hook function appears on several characters
 being modified by a single primitive, you can't predict how many times
 the function will be called.
 
+If these functions modify the buffer, they should bind
+@code{inhibit-modification-hooks} to @code{t} around doing so, to
+avoid confusing the internal mechanism that calls these hooks.
+
 @item insert-in-front-hooks
 @itemx insert-behind-hooks
 @kindex insert-in-front-hooks @r{(text property)}
@@ -3121,8 +3249,9 @@ are used for representing formatted text.  @xref{Filling}, and
 @item hard
 If a newline character has this property, it is a ``hard'' newline.
 The fill commands do not alter hard newlines and do not move words
-across them.  However, this property takes effect only if the variable
-@code{use-hard-newlines} is non-@code{nil}.
+across them.  However, this property takes effect only if the
+@code{use-hard-newlines} minor mode is enabled.  @xref{Hard and Soft
+Newlines,, Hard and Soft Newlines, emacs, The GNU Emacs Manual}.
 
 @item right-margin
 This property specifies an extra right margin for filling this part of the
@@ -3410,6 +3539,125 @@ clickable pieces of text.  Also, the major mode definition (or the
 global definition) remains available for the rest of the text in the
 buffer.
 
+@node Links and Mouse-1
+@subsection Links and Mouse-1
+@cindex follow links
+@cindex mouse-1
+
+  The normal Emacs command for activating text in read-only buffers is
+@key{Mouse-2}, which includes following textual links.  However, most
+graphical applications use @key{Mouse-1} for following links.  For
+compatibility, @key{Mouse-1} follows links in Emacs too, when you
+click on a link quickly without moving the mouse.  The user can
+customize this behavior through the variable
+@code{mouse-1-click-follows-link}.
+
+  To define text as a link at the Lisp level, you should bind the
+@code{mouse-2} event to a command to follow the link.  Then, to indicate that
+@key{Mouse-1} should also follow the link, you should specify a
+@code{follow-link} condition either as a text property or as a key
+binding:
+
+@table @asis
+@item @code{follow-link} property
+If the clickable text has a non-@code{nil} @code{follow-link} text or overlay
+property, that specifies the condition.
+
+@item @code{follow-link} event
+If there is a binding for the @code{follow-link} event, either on the
+clickable text or in the local keymap, the binding is the condition.
+@end table
+
+  Regardless of how you set the @code{follow-link} condition, its
+value is used as follows to determine whether the given position is
+inside a link, and (if so) to compute an @dfn{action code} saying how
+@key{Mouse-1} should handle the link.
+
+@table @asis
+@item @code{mouse-face}
+If the condition is @code{mouse-face}, a position is inside a link if
+there is a non-@code{nil} @code{mouse-face} property at that position.
+The action code is always @code{t}.
+
+For example, here is how Info mode handles @key{Mouse-1}:
+
+@smallexample
+(define-key Info-mode-map [follow-link] 'mouse-face)
+@end smallexample
+
+@item a function
+If the condition is a valid function, @var{func}, then a position
+@var{pos} is inside a link if @code{(@var{func} @var{pos})} evaluates
+to non-@code{nil}.  The value returned by @var{func} serves as the
+action code.
+
+For example, here is how pcvs enables @key{Mouse-1} to follow links on
+file names only:
+
+@smallexample
+(define-key map [follow-link]
+  (lambda (pos)
+    (eq (get-char-property pos 'face) 'cvs-filename-face)))
+@end smallexample
+
+@item anything else
+If the condition value is anything else, then the position is inside a
+link and the condition itself is the action code.  Clearly you should
+only specify this kind of condition on the text that constitutes a
+link.
+@end table
+
+@noindent
+The action code tells @key{Mouse-1} how to follow the link:
+
+@table @asis
+@item a string or vector
+If the action code is a string or vector, the @key{Mouse-1} event is
+translated into the first element of the string or vector; i.e., the
+action of the @key{Mouse-1} click is the local or global binding of
+that character or symbol.  Thus, if the action code is @code{"foo"},
+@key{Mouse-1} translates into @kbd{f}.  If it is @code{[foo]},
+@key{Mouse-1} translates into @key{foo}.
+
+@item anything else
+For any other non-@code{nil} action code, the @code{mouse-1} event is
+translated into a @code{mouse-2} event at the same position.
+@end table
+
+  To define @key{Mouse-1} to activate a button defined with
+@code{define-button-type}, give the button a @code{follow-link}
+property with a value as specified above to determine how to follow
+the link.  For example, here is how Help mode handles @key{Mouse-1}:
+
+@smallexample
+(define-button-type 'help-xref
+  'follow-link t
+  'action #'help-button-action)
+@end smallexample
+
+  To define @key{Mouse-1} on a widget defined with
+@code{define-widget}, give the widget a @code{:follow-link} property
+with a value as specified above to determine how to follow the link.
+
+For example, here is how the @code{link} widget specifies that
+a @key{Mouse-1} click shall be translated to @key{RET}:
+
+@smallexample
+(define-widget 'link 'item
+  "An embedded link."
+  :button-prefix 'widget-link-prefix
+  :button-suffix 'widget-link-suffix
+  :follow-link "\C-m"
+  :help-echo "Follow the link."
+  :format "%[%t%]")
+@end smallexample
+
+@defun mouse-on-link-p pos
+@tindex mouse-on-link-p
+This function returns non-@code{nil} if position @var{pos} in the
+current buffer is on a link.
+@end defun
+
 @node Fields
 @subsection Defining and Using Fields
 @cindex fields
@@ -3618,9 +3866,9 @@ ThXs Xs the contents of the buffer before.
 This function applies a translation table to the characters in the
 buffer between positions @var{start} and @var{end}.
 
-The translation table @var{table} is a string; @code{(aref @var{table}
-@var{ochar})} gives the translated character corresponding to
-@var{ochar}.  If the length of @var{table} is less than 256, any
+The translation table @var{table} is a string or a char-table;
+@code{(aref @var{table} @var{ochar})} gives the translated character
+corresponding to @var{ochar}.  If @var{table} is a string, any
 characters with codes larger than the length of @var{table} are not
 altered by the translation.
 
@@ -4036,7 +4284,7 @@ arguments.
   Output of messages into the @samp{*Messages*} buffer does not
 call these functions.
 
-@defmac combine-after-change-calls body...
+@defmac combine-after-change-calls body@dots{}
 The macro executes @var{body} normally, but arranges to call the
 after-change functions just once for a series of several changes---if
 that seems safe.
@@ -4099,8 +4347,6 @@ disabled; none of them run.  This affects all the hook variables
 described above in this section, as well as the hooks attached to
 certain special text properties (@pxref{Special Properties}) and overlay
 properties (@pxref{Overlay Properties}).
-
-This variable is available starting in Emacs 21.
 @end defvar
 
 @ignore