diff options
| author | Stefan Monnier | 2011-03-21 11:30:01 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-21 11:30:01 -0400 |
| commit | fd5a8ae8a3750faaae9bee1deb303d8f8d2800c4 (patch) | |
| tree | a1c59d1bbd870c151bd15ee168297419d323fdd2 | |
| parent | c1bcd0d5d11ee1e2a72461069b4e39f3ee369955 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 34 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-03-19 Chong Yidong <cyd@stupidchicken.com> | 8 | 2011-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 |
| 648 | This function returns the longest common substring of all possible | 648 | This function returns the longest common substring of all possible |
| 649 | completions of @var{string} in @var{collection}. The value of | 649 | completions 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 |
| 651 | obarray, a hash table, or a completion function (@pxref{Programmed | 651 | strings or symbols, an obarray, a hash table, or a completion function |
| 652 | Completion}). | 652 | (@pxref{Programmed Completion}). |
| 653 | 653 | ||
| 654 | Completion compares @var{string} against each of the permissible | 654 | Completion compares @var{string} against each of the permissible |
| 655 | completions specified by @var{collection}. If no permissible | 655 | completions specified by @var{collection}. If no permissible |
| @@ -660,11 +660,11 @@ to all possible matching completions. | |||
| 660 | 660 | ||
| 661 | If @var{collection} is an alist (@pxref{Association Lists}), the | 661 | If @var{collection} is an alist (@pxref{Association Lists}), the |
| 662 | permissible completions are the elements of the alist that are either | 662 | permissible completions are the elements of the alist that are either |
| 663 | strings, symbols, or conses whose @sc{car} is a string or symbol. | 663 | strings, or conses whose @sc{car} is a string or symbol. |
| 664 | Symbols are converted to strings using @code{symbol-name}. Other | 664 | Symbols are converted to strings using @code{symbol-name}. Other |
| 665 | elements of the alist are ignored. (Remember that in Emacs Lisp, the | 665 | elements of the alist are ignored. (Remember that in Emacs Lisp, the |
| 666 | elements of alists do not @emph{have} to be conses.) In particular, a | 666 | elements of alists do not @emph{have} to be conses.) In particular, a |
| 667 | list of strings or symbols is allowed, even though we usually do not | 667 | list of strings is allowed, even though we usually do not |
| 668 | think of such lists as alists. | 668 | think 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. | |||
| 680 | If @var{collection} is a hash table, then the keys that are strings | 680 | If @var{collection} is a hash table, then the keys that are strings |
| 681 | are the possible completions. Other keys are ignored. | 681 | are the possible completions. Other keys are ignored. |
| 682 | 682 | ||
| 683 | You can also use a symbol that is a function as @var{collection}. | 683 | You can also use a function as @var{collection}. |
| 684 | Then the function is solely responsible for performing completion; | 684 | Then 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 |
| 686 | function is called with three arguments: @var{string}, @var{predicate} | 686 | function 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 |
| 1638 | containing all the intended possible completions. In such a case, you | 1638 | an obarray containing all the intended possible completions ahead |
| 1639 | can supply your own function to compute the completion of a given | 1639 | of time. In such a case, you can supply your own function to compute |
| 1640 | string. This is called @dfn{programmed completion}. Emacs uses | 1640 | the completion of a given string. This is called @dfn{programmed |
| 1641 | programmed completion when completing file names (@pxref{File Name | 1641 | completion}. Emacs uses programmed completion when completing file |
| 1642 | Completion}), among many other cases. | 1642 | names (@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} |
| 1645 | argument to @code{completing-read}. The function | 1645 | argument 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: | 1670 | each 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 | |||
| 1698 | in SUFFIX. | 1698 | in SUFFIX. |
| 1699 | @end itemize | 1699 | @end itemize |
| 1700 | 1700 | ||
| 1701 | It would be consistent and clean for completion functions to allow | ||
| 1702 | lambda expressions (lists that are functions) as well as function | ||
| 1703 | symbols as @var{collection}, but this is impossible. Lists as | ||
| 1704 | completion tables already have other meanings, and it would be | ||
| 1705 | unreliable to treat one differently just because it is also a possible | ||
| 1706 | function. So you must arrange for any function you wish to use for | ||
| 1707 | completion to be encapsulated in a symbol. | ||
| 1708 | |||
| 1709 | @defun completion-table-dynamic function | 1701 | @defun completion-table-dynamic function |
| 1710 | This function is a convenient way to write a function that can act as | 1702 | This function is a convenient way to write a function that can act as |
| 1711 | programmed completion function. The argument @var{function} should be | 1703 | programmed completion function. The argument @var{function} should be |