aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/minibuf.texi87
2 files changed, 80 insertions, 14 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 86f0a91a33f..afd6700ef61 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,9 +1,12 @@
12012-04-06 Chong Yidong <cyd@gnu.org>
2
3 * minibuf.texi (Programmed Completion): Document metadata method.
4 (Completion Variables): Document completion-category-overrides.
5
12012-04-05 Chong Yidong <cyd@gnu.org> 62012-04-05 Chong Yidong <cyd@gnu.org>
2 7
3 * anti.texi (Antinews): Rewrite for Emacs 23. 8 * anti.texi (Antinews): Rewrite for Emacs 23.
4 9
5 * minibuf.texi (Programmed Completion): Document metadata method.
6
72012-04-04 Chong Yidong <cyd@gnu.org> 102012-04-04 Chong Yidong <cyd@gnu.org>
8 11
9 * minibuf.texi (Programmed Completion): Remove obsolete variable 12 * minibuf.texi (Programmed Completion): Remove obsolete variable
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 8e1bd4bf5ee..4e11bc30d49 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1575,12 +1575,10 @@ completion behavior.
1575 1575
1576@cindex completion styles 1576@cindex completion styles
1577@defopt completion-styles 1577@defopt completion-styles
1578The value of this variable is a list of completion styles to use for 1578The value of this variable is a list of completion style (symbols) to
1579performing completion. A @dfn{completion style} is a set of rules for 1579use for performing completion. A @dfn{completion style} is a set of
1580generating completions. 1580rules for generating completions. Each symbol in occurring this list
1581 1581must have a corresponding entry in @code{completion-styles-alist}.
1582Each style listed in this variable must be one of those defined in
1583@code{completion-styles-alist}.
1584@end defopt 1582@end defopt
1585 1583
1586@defvar completion-styles-alist 1584@defvar completion-styles-alist
@@ -1588,15 +1586,16 @@ This variable stores a list of available completion styles. Each
1588element in the list has the form 1586element in the list has the form
1589 1587
1590@example 1588@example
1591(@var{name} @var{try-completion} @var{all-completions} @var{doc}) 1589(@var{style} @var{try-completion} @var{all-completions} @var{doc})
1592@end example 1590@end example
1593 1591
1594@noindent 1592@noindent
1595Here, @var{name} is the name of the completion style (a symbol), which 1593Here, @var{style} is the name of the completion style (a symbol),
1596may be used in @code{completion-styles-alist} to refer to this style; 1594which may be used in the @code{completion-styles} variable to refer to
1597@var{try-completion} is the function that does the completion; 1595this style; @var{try-completion} is the function that does the
1598@var{all-completions} is the function that lists the completions; and 1596completion; @var{all-completions} is the function that lists the
1599@var{doc} is a string describing the completion style. 1597completions; and @var{doc} is a string describing the completion
1598style.
1600 1599
1601The @var{try-completion} and @var{all-completions} functions should 1600The @var{try-completion} and @var{all-completions} functions should
1602each accept four arguments: @var{string}, @var{collection}, 1601each accept four arguments: @var{string}, @var{collection},
@@ -1622,6 +1621,31 @@ listing completions, via the @var{all-completions} functions.
1622description of the available completion styles. 1621description of the available completion styles.
1623@end defvar 1622@end defvar
1624 1623
1624@defopt completion-category-overrides
1625This variable specifies special completion styles and other completion
1626behaviors to use when completing certain types of text. Its value
1627should be a list of the form @code{(@var{category} . @var{alist})}.
1628@var{category} is a symbol describing what is being completed;
1629currently, the @code{buffer} and @code{file} categories are defined,
1630but others can be defined via specialized completion functions
1631(@pxref{Programmed Completion}). @var{alist} is an association list
1632describing how completion should behave for the corresponding
1633category. The following alist keys are supported:
1634
1635@table @code
1636@item styles
1637The value should be a list of completion styles (symbols).
1638
1639@item cycle
1640The value should be a value for @code{completion-cycle-threshold}
1641(@pxref{Completion Options,,, emacs, The GNU Emacs Manual}) for this
1642category.
1643@end table
1644
1645@noindent
1646Additional alist entries may be defined in the future.
1647@end defopt
1648
1625@defvar completion-extra-properties 1649@defvar completion-extra-properties
1626This variable is used to specify extra properties of the current 1650This variable is used to specify extra properties of the current
1627completion command. It is intended to be let-bound by specialized 1651completion command. It is intended to be let-bound by specialized
@@ -1706,9 +1730,48 @@ This specifies a @code{completion-boundaries} operation. The function
1706should return @code{(boundaries START . END)}, where START is the 1730should return @code{(boundaries START . END)}, where START is the
1707position of the beginning boundary in the specified string, and END is 1731position of the beginning boundary in the specified string, and END is
1708the position of the end boundary in SUFFIX. 1732the position of the end boundary in SUFFIX.
1733
1734@item metadata
1735This specifies a request for information about the state of the
1736current completion. The function should return an alist, as described
1737below. The alist may contain any number of elements.
1709@end table 1738@end table
1739
1740@noindent
1741If the flag has any other value, the completion function should return
1742@code{nil}.
1710@end itemize 1743@end itemize
1711 1744
1745The following is a list of metadata entries that a completion function
1746may return in response to a @code{metadata} flag argument:
1747
1748@table @code
1749@item category
1750The value should be a symbol describing what kind of text the
1751completion function is trying to complete. If the symbol matches one
1752of the keys in @code{completion-category-overrides}, the usual
1753completion behavior is overridden. @xref{Completion Variables}.
1754
1755@item annotation-function
1756The value should be a function for @dfn{annotating} completions. The
1757function should take one argument, @var{string}, which is a possible
1758completion. It should return a string, which is displayed after the
1759completion @var{string} in the @samp{*Completions*} buffer.
1760
1761@item display-sort-function
1762The value should be a function for sorting completions. The function
1763should take one argument, a list of completion strings, and return a
1764sorted list of completion strings. It is allowed to alter the input
1765list destructively.
1766
1767@item cycle-sort-function
1768The value should be a function for sorting completions, when
1769@code{completion-cycle-threshold} is non-@code{nil} and the user is
1770cycling through completion alternatives. @xref{Completion Options,,,
1771emacs, The GNU Emacs Manual}. Its argument list and return value are
1772the same as for @code{display-sort-function}.
1773@end table
1774
1712@defun completion-table-dynamic function 1775@defun completion-table-dynamic function
1713This function is a convenient way to write a function that can act as 1776This function is a convenient way to write a function that can act as
1714programmed completion function. The argument @var{function} should be 1777programmed completion function. The argument @var{function} should be