aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 11:30:01 -0400
committerStefan Monnier2011-03-21 11:30:01 -0400
commitfd5a8ae8a3750faaae9bee1deb303d8f8d2800c4 (patch)
treea1c59d1bbd870c151bd15ee168297419d323fdd2
parentc1bcd0d5d11ee1e2a72461069b4e39f3ee369955 (diff)
downloademacs-fd5a8ae8a3750faaae9bee1deb303d8f8d2800c4.tar.gz
emacs-fd5a8ae8a3750faaae9bee1deb303d8f8d2800c4.zip
* doc/lispref/minibuf.texi (Basic Completion): Be a bit more precise about the
valid kinds of completion tables. (Programmed Completion): Remove obsolete text about lambda expressions not being valid completion tables.
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/minibuf.texi34
2 files changed, 20 insertions, 21 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 26bb5888df5..440159a9a58 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,10 @@
12011-03-21 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuf.texi (Basic Completion): Be a bit more precise about the
4 valid kinds of completion tables.
5 (Programmed Completion): Remove obsolete text about lambda expressions
6 not being valid completion tables.
7
12011-03-19 Chong Yidong <cyd@stupidchicken.com> 82011-03-19 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * positions.texi (Excursions): Explain the "save-excursion 10 * positions.texi (Excursions): Explain the "save-excursion
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 0d907ea6532..9b09a304bd0 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -647,9 +647,9 @@ higher-level completion features that do use the minibuffer.
647@defun try-completion string collection &optional predicate 647@defun try-completion string collection &optional predicate
648This function returns the longest common substring of all possible 648This function returns the longest common substring of all possible
649completions of @var{string} in @var{collection}. The value of 649completions of @var{string} in @var{collection}. The value of
650@var{collection} must be a list of strings or symbols, an alist, an 650@var{collection} must be a list of strings, an alist whose keys are
651obarray, a hash table, or a completion function (@pxref{Programmed 651strings or symbols, an obarray, a hash table, or a completion function
652Completion}). 652(@pxref{Programmed Completion}).
653 653
654Completion compares @var{string} against each of the permissible 654Completion compares @var{string} against each of the permissible
655completions specified by @var{collection}. If no permissible 655completions specified by @var{collection}. If no permissible
@@ -660,11 +660,11 @@ to all possible matching completions.
660 660
661If @var{collection} is an alist (@pxref{Association Lists}), the 661If @var{collection} is an alist (@pxref{Association Lists}), the
662permissible completions are the elements of the alist that are either 662permissible completions are the elements of the alist that are either
663strings, symbols, or conses whose @sc{car} is a string or symbol. 663strings, or conses whose @sc{car} is a string or symbol.
664Symbols are converted to strings using @code{symbol-name}. Other 664Symbols are converted to strings using @code{symbol-name}. Other
665elements of the alist are ignored. (Remember that in Emacs Lisp, the 665elements of the alist are ignored. (Remember that in Emacs Lisp, the
666elements of alists do not @emph{have} to be conses.) In particular, a 666elements of alists do not @emph{have} to be conses.) In particular, a
667list of strings or symbols is allowed, even though we usually do not 667list of strings is allowed, even though we usually do not
668think of such lists as alists. 668think of such lists as alists.
669 669
670@cindex obarray in completion 670@cindex obarray in completion
@@ -680,7 +680,7 @@ Also, you cannot intern a given symbol in more than one obarray.
680If @var{collection} is a hash table, then the keys that are strings 680If @var{collection} is a hash table, then the keys that are strings
681are the possible completions. Other keys are ignored. 681are the possible completions. Other keys are ignored.
682 682
683You can also use a symbol that is a function as @var{collection}. 683You can also use a function as @var{collection}.
684Then the function is solely responsible for performing completion; 684Then the function is solely responsible for performing completion;
685@code{try-completion} returns whatever this function returns. The 685@code{try-completion} returns whatever this function returns. The
686function is called with three arguments: @var{string}, @var{predicate} 686function is called with three arguments: @var{string}, @var{predicate}
@@ -1634,12 +1634,12 @@ which performs completion according to the rules used in Emacs 21; and
1634@subsection Programmed Completion 1634@subsection Programmed Completion
1635@cindex programmed completion 1635@cindex programmed completion
1636 1636
1637 Sometimes it is not possible to create an alist or an obarray 1637 Sometimes it is not possible or convenient to create an alist or
1638containing all the intended possible completions. In such a case, you 1638an obarray containing all the intended possible completions ahead
1639can supply your own function to compute the completion of a given 1639of time. In such a case, you can supply your own function to compute
1640string. This is called @dfn{programmed completion}. Emacs uses 1640the completion of a given string. This is called @dfn{programmed
1641programmed completion when completing file names (@pxref{File Name 1641completion}. Emacs uses programmed completion when completing file
1642Completion}), among many other cases. 1642names (@pxref{File Name Completion}), among many other cases.
1643 1643
1644 To use this feature, pass a function as the @var{collection} 1644 To use this feature, pass a function as the @var{collection}
1645argument to @code{completing-read}. The function 1645argument to @code{completing-read}. The function
@@ -1667,7 +1667,7 @@ specifies which method to run.
1667@end itemize 1667@end itemize
1668 1668
1669 There are currently four methods, i.e. four flag values, one for 1669 There are currently four methods, i.e. four flag values, one for
1670 each of the four different basic operations: 1670each of the four different basic operations:
1671 1671
1672@itemize @bullet 1672@itemize @bullet
1673@item 1673@item
@@ -1698,14 +1698,6 @@ in the string to complete, and END is the position of the end boundary
1698in SUFFIX. 1698in SUFFIX.
1699@end itemize 1699@end itemize
1700 1700
1701 It would be consistent and clean for completion functions to allow
1702lambda expressions (lists that are functions) as well as function
1703symbols as @var{collection}, but this is impossible. Lists as
1704completion tables already have other meanings, and it would be
1705unreliable to treat one differently just because it is also a possible
1706function. So you must arrange for any function you wish to use for
1707completion to be encapsulated in a symbol.
1708
1709@defun completion-table-dynamic function 1701@defun completion-table-dynamic function
1710This function is a convenient way to write a function that can act as 1702This function is a convenient way to write a function that can act as
1711programmed completion function. The argument @var{function} should be 1703programmed completion function. The argument @var{function} should be