comparison lispref/text.texi @ 90195:a1b34dec1104

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-63 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 358-423) - Update from CVS - Remove "-face" suffix from widget faces - Remove "-face" suffix from custom faces - Remove "-face" suffix from change-log faces - Remove "-face" suffix from compilation faces - Remove "-face" suffix from diff-mode faces - lisp/longlines.el (longlines-visible-face): Face removed - Remove "-face" suffix from woman faces - Remove "-face" suffix from whitespace-highlight face - Remove "-face" suffix from ruler-mode faces - Remove "-face" suffix from show-paren faces - Remove "-face" suffix from log-view faces - Remove "-face" suffix from smerge faces - Remove "-face" suffix from show-tabs faces - Remove "-face" suffix from highlight-changes faces - Remove "-face" suffix from and downcase info faces - Remove "-face" suffix from pcvs faces - Update uses of renamed pcvs faces - Tweak ChangeLog - Remove "-face" suffix from strokes-char face - Remove "-face" suffix from compare-windows face - Remove "-face" suffix from calendar faces - Remove "-face" suffix from diary-button face - Remove "-face" suffix from testcover faces - Remove "-face" suffix from viper faces - Remove "-face" suffix from org faces - Remove "-face" suffix from sgml-namespace face - Remove "-face" suffix from table-cell face - Remove "-face" suffix from tex-mode faces - Remove "-face" suffix from texinfo-heading face - Remove "-face" suffix from flyspell faces - Remove "-face" suffix from gomoku faces - Remove "-face" suffix from mpuz faces - Merge from gnus--rel--5.10 - Remove "-face" suffix from Buffer-menu-buffer face - Remove "-face" suffix from antlr-mode faces - Remove "-face" suffix from ebrowse faces - Remove "-face" suffix from flymake faces - Remove "-face" suffix from idlwave faces - Remove "-face" suffix from sh-script faces - Remove "-face" suffix from vhdl-mode faces - Remove "-face" suffix from which-func face - Remove "-face" suffix from cperl-mode faces - Remove "-face" suffix from ld-script faces - Fix cperl-mode font-lock problem - Tweak which-func face * gnus--rel--5.10 (patch 80-82) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 15 Jun 2005 23:32:15 +0000
parents 4da4a09e8b1b 138377d5ea9f
children b7da78284d4c
comparison
equal deleted inserted replaced
90194:d940db5a66b9 90195:a1b34dec1104
1665 1665
1666 @node Adaptive Fill 1666 @node Adaptive Fill
1667 @section Adaptive Fill Mode 1667 @section Adaptive Fill Mode
1668 @cindex Adaptive Fill mode 1668 @cindex Adaptive Fill mode
1669 1669
1670 Adaptive Fill mode chooses a fill prefix automatically from the text 1670 When @dfn{Adaptive Fill Mode} is enabled, Emacs determines the fill
1671 in each paragraph being filled. 1671 prefix automatically from the text in each paragraph being filled
1672 rather than using a predetermined value. During filling, this fill
1673 prefix gets inserted at the start of the second and subsequent lines
1674 of the paragraph as described in @ref{Filling}, and in @ref{Auto
1675 Filling}.
1672 1676
1673 @defopt adaptive-fill-mode 1677 @defopt adaptive-fill-mode
1674 Adaptive Fill mode is enabled when this variable is non-@code{nil}. 1678 Adaptive Fill mode is enabled when this variable is non-@code{nil}.
1675 It is @code{t} by default. 1679 It is @code{t} by default.
1676 @end defopt 1680 @end defopt
1677 1681
1678 @defun fill-context-prefix from to 1682 @defun fill-context-prefix from to
1679 This function implements the heart of Adaptive Fill mode; it chooses a 1683 This function implements the heart of Adaptive Fill mode; it chooses a
1680 fill prefix based on the text between @var{from} and @var{to}. It does 1684 fill prefix based on the text between @var{from} and @var{to},
1681 this by looking at the first two lines of the paragraph, based on the 1685 typically the start and end of a paragraph. It does this by looking
1682 variables described below. 1686 at the first two lines of the paragraph, based on the variables
1687 described below.
1683 @c The optional argument first-line-regexp is not documented 1688 @c The optional argument first-line-regexp is not documented
1684 @c because it exists for internal purposes and might be eliminated 1689 @c because it exists for internal purposes and might be eliminated
1685 @c in the future. 1690 @c in the future.
1691
1692 Usually, this function returns the fill prefix, a string. However,
1693 before doing this, the function makes a final check (not specially
1694 mentioned in the following) that a line starting with this prefix
1695 wouldn't look like the start of a paragraph. Should this happen, the
1696 function signals the anomaly by returning @code{nil} instead.
1697
1698 In detail, @code{fill-context-prefix} does this:
1699
1700 @enumerate
1701 @item
1702 It takes a candidate for the fill prefix from the first line---it
1703 tries first the function in @code{adaptive-fill-function} (if any),
1704 then the regular expression @code{adaptive-fill-regexp} (see below).
1705 The first non-@code{nil} result of these, or the empty string if
1706 they're both @code{nil}, becomes the first line's candidate.
1707 @item
1708 If the paragraph has as yet only one line, the function tests the
1709 validity of the prefix candidate just found. The function then
1710 returns the candidate if it's valid, or a string of spaces otherwise.
1711 (see the description of @code{adaptive-fill-first-line-regexp} below).
1712 @item
1713 When the paragraph already has two lines, the function next looks for
1714 a prefix candidate on the second line, in just the same way it did for
1715 the first line. If it doesn't find one, it returns @code{nil}.
1716 @item
1717 The function now compares the two candidate prefixes heuristically: if
1718 the non-whitespace characters in the line 2 candidate occur in the
1719 same order in the line 1 candidate, the function returns the line 2
1720 candidate. Otherwise, it returns the largest initial substring which
1721 is common to both candidates (which might be the empty string).
1722 @end enumerate
1686 @end defun 1723 @end defun
1687 1724
1688 @defopt adaptive-fill-regexp 1725 @defopt adaptive-fill-regexp
1689 This variable holds a regular expression to control Adaptive Fill mode.
1690 Adaptive Fill mode matches this regular expression against the text 1726 Adaptive Fill mode matches this regular expression against the text
1691 starting after the left margin whitespace (if any) on a line; the 1727 starting after the left margin whitespace (if any) on a line; the
1692 characters it matches are that line's candidate for the fill prefix. 1728 characters it matches are that line's candidate for the fill prefix.
1729
1730 The default value of this variable is
1731 @w{@samp{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}}. This
1732 matches a number enclosed in parentheses or followed by a period,
1733 or certain punctuation characters, or any sequence of these
1734 intermingled with whitespace. In particular, it matches a sequence of
1735 whitespace, possibly empty.
1693 @end defopt 1736 @end defopt
1694 1737
1695 @defopt adaptive-fill-first-line-regexp 1738 @defopt adaptive-fill-first-line-regexp
1696 In a one-line paragraph, if the candidate fill prefix matches this 1739 Used only in one-line paragraphs, this regular expression acts as an
1697 regular expression, or if it matches @code{comment-start-skip}, then it 1740 additional check of the validity of the one available candidate fill
1698 is used---otherwise, spaces amounting to the same width are used 1741 prefix: the candidate must match this regular expression, or match
1699 instead. 1742 @code{comment-start-skip}. If it doesn't, @code{fill-context-prefix}
1700 1743 replaces the candidate with a string of spaces ``of the same width''
1701 However, the fill prefix is never taken from a one-line paragraph 1744 as it.
1702 if it would act as a paragraph starter on subsequent lines. 1745
1746 The default value of this variable is @w{@samp{"\\`[ \t]*\\'"}}, which
1747 matches only a string of whitespace. The effect of this default is to
1748 force the fill prefixes found in one-line paragraphs always to be pure
1749 whitespace.
1703 @end defopt 1750 @end defopt
1704 1751
1705 @defopt adaptive-fill-function 1752 @defopt adaptive-fill-function
1706 You can specify more complex ways of choosing a fill prefix 1753 You can specify more complex ways of choosing a fill prefix
1707 automatically by setting this variable to a function. The function is 1754 automatically by setting this variable to a function. The function is
1708 called when @code{adaptive-fill-regexp} does not match, with point after 1755 called with point after the left margin (if any) of a line, and it
1709 the left margin of a line, and it should return the appropriate fill 1756 must preserve point. It should return either ``that line's'' fill
1710 prefix based on that line. If it returns @code{nil}, that means it sees 1757 prefix or @code{nil}, meaning it has failed to determine a prefix.
1711 no fill prefix in that line.
1712 @end defopt 1758 @end defopt
1713 1759
1714 @node Auto Filling 1760 @node Auto Filling
1715 @comment node-name, next, previous, up 1761 @comment node-name, next, previous, up
1716 @section Auto Filling 1762 @section Auto Filling
3076 that character a non-@code{nil} @var{cursor} text property. 3122 that character a non-@code{nil} @var{cursor} text property.
3077 3123
3078 @item pointer 3124 @item pointer
3079 @kindex pointer @r{(text property)} 3125 @kindex pointer @r{(text property)}
3080 This specifies a specific pointer shape when the mouse pointer is over 3126 This specifies a specific pointer shape when the mouse pointer is over
3081 this text or image. See the variable @var{void-area-text-pointer} 3127 this text or image. @xref{Pointer Shape}, for possible pointer
3082 for possible pointer shapes. 3128 shapes.
3083 3129
3084 @item line-spacing 3130 @item line-spacing
3085 @kindex line-spacing @r{(text property)} 3131 @kindex line-spacing @r{(text property)}
3086 A newline can have a @code{line-spacing} text or overlay property that 3132 A newline can have a @code{line-spacing} text or overlay property that
3087 controls the height of the display line ending with that newline. The 3133 controls the height of the display line ending with that newline. The