diff options
| author | Stefan Monnier | 2010-05-31 22:34:49 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-05-31 22:34:49 -0400 |
| commit | fd67a7000ee9e118b426df6ad779f3c86d4fe320 (patch) | |
| tree | 9f39d84fb5eeee28ec6670794980c075ebe51b32 /doc | |
| parent | 06ac62b4db7cf64c9d65ac55bdfcefdf478e20b5 (diff) | |
| parent | feceda26100f1b5712a85aadf0c428a1507b538d (diff) | |
| download | emacs-fd67a7000ee9e118b426df6ad779f3c86d4fe320.tar.gz emacs-fd67a7000ee9e118b426df6ad779f3c86d4fe320.zip | |
Merge from emacs-23
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 9 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 45 |
2 files changed, 47 insertions, 7 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1ed5b7ea928..ca40b34b73b 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2010-05-30 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * minibuf.texi (Basic Completion): Add missing "@end defun". | ||
| 4 | |||
| 5 | 2010-05-30 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 6 | |||
| 7 | * minibuf.texi (Basic Completion): Document completion-boundaries. | ||
| 8 | (Programmed Completion): Document the new fourth method for boundaries. | ||
| 9 | |||
| 1 | 2010-05-22 Chong Yidong <cyd@stupidchicken.com> | 10 | 2010-05-22 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 11 | ||
| 3 | * display.texi (Image Cache): Update documentation about image | 12 | * display.texi (Image Cache): Update documentation about image |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 66b4cb096cc..bfe73ce27f4 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -814,6 +814,25 @@ the values @var{string}, @var{predicate} and @code{lambda}; whatever | |||
| 814 | it returns, @code{test-completion} returns in turn. | 814 | it returns, @code{test-completion} returns in turn. |
| 815 | @end defun | 815 | @end defun |
| 816 | 816 | ||
| 817 | @defun completion-boundaries string collection predicate suffix | ||
| 818 | This function returns the boundaries of the field on which @var{collection} | ||
| 819 | will operate, assuming that @var{string} holds the text before point | ||
| 820 | and @var{suffix} holds the text after point. | ||
| 821 | |||
| 822 | Normally completion operates on the whole string, so for all normal | ||
| 823 | collections, this will always return @code{(0 . (length | ||
| 824 | @var{suffix}))}. But more complex completion such as completion on | ||
| 825 | files is done one field at a time. For example, completion of | ||
| 826 | @code{"/usr/sh"} will include @code{"/usr/share/"} but not | ||
| 827 | @code{"/usr/share/doc"} even if @code{"/usr/share/doc"} exists. | ||
| 828 | Also @code{all-completions} on @code{"/usr/sh"} will not include | ||
| 829 | @code{"/usr/share/"} but only @code{"share/"}. So if @var{string} is | ||
| 830 | @code{"/usr/sh"} and @var{suffix} is @code{"e/doc"}, | ||
| 831 | @code{completion-boundaries} will return @code{(5 . 1)} which tells us | ||
| 832 | that the @var{collection} will only return completion information that | ||
| 833 | pertains to the area after @code{"/usr/"} and before @code{"/doc"}. | ||
| 834 | @end defun | ||
| 835 | |||
| 817 | If you store a completion alist in a variable, you should mark the | 836 | If you store a completion alist in a variable, you should mark the |
| 818 | variable as ``risky'' with a non-@code{nil} | 837 | variable as ``risky'' with a non-@code{nil} |
| 819 | @code{risky-local-variable} property. @xref{File Local Variables}. | 838 | @code{risky-local-variable} property. @xref{File Local Variables}. |
| @@ -1618,13 +1637,14 @@ containing all the intended possible completions. In such a case, you | |||
| 1618 | can supply your own function to compute the completion of a given | 1637 | can supply your own function to compute the completion of a given |
| 1619 | string. This is called @dfn{programmed completion}. Emacs uses | 1638 | string. This is called @dfn{programmed completion}. Emacs uses |
| 1620 | programmed completion when completing file names (@pxref{File Name | 1639 | programmed completion when completing file names (@pxref{File Name |
| 1621 | Completion}). | 1640 | Completion}), among many other cases. |
| 1622 | 1641 | ||
| 1623 | To use this feature, pass a symbol with a function definition as the | 1642 | To use this feature, pass a function as the @var{collection} |
| 1624 | @var{collection} argument to @code{completing-read}. The function | 1643 | argument to @code{completing-read}. The function |
| 1625 | @code{completing-read} arranges to pass your completion function along | 1644 | @code{completing-read} arranges to pass your completion function along |
| 1626 | to @code{try-completion} and @code{all-completions}, which will then let | 1645 | to @code{try-completion}, @code{all-completions}, and other basic |
| 1627 | your function do all the work. | 1646 | completion functions, which will then let your function do all |
| 1647 | the work. | ||
| 1628 | 1648 | ||
| 1629 | The completion function should accept three arguments: | 1649 | The completion function should accept three arguments: |
| 1630 | 1650 | ||
| @@ -1638,10 +1658,14 @@ none. Your function should call the predicate for each possible match, | |||
| 1638 | and ignore the possible match if the predicate returns @code{nil}. | 1658 | and ignore the possible match if the predicate returns @code{nil}. |
| 1639 | 1659 | ||
| 1640 | @item | 1660 | @item |
| 1641 | A flag specifying the type of operation. | 1661 | A flag specifying the type of operation. The best way to think about |
| 1662 | it is that the function stands for an object (in the | ||
| 1663 | ``object-oriented'' sense of the word), and this third argument | ||
| 1664 | specifies which method to run. | ||
| 1642 | @end itemize | 1665 | @end itemize |
| 1643 | 1666 | ||
| 1644 | There are three flag values for three operations: | 1667 | There are currently four methods, i.e. four flag values, one for |
| 1668 | each of the four different basic operations: | ||
| 1645 | 1669 | ||
| 1646 | @itemize @bullet | 1670 | @itemize @bullet |
| 1647 | @item | 1671 | @item |
| @@ -1663,6 +1687,13 @@ string. | |||
| 1663 | @code{lambda} specifies @code{test-completion}. The completion | 1687 | @code{lambda} specifies @code{test-completion}. The completion |
| 1664 | function should return @code{t} if the specified string is an exact | 1688 | function should return @code{t} if the specified string is an exact |
| 1665 | match for some possibility; @code{nil} otherwise. | 1689 | match for some possibility; @code{nil} otherwise. |
| 1690 | |||
| 1691 | @item | ||
| 1692 | @code{(boundaries . SUFFIX)} specifies @code{completion-boundaries}. | ||
| 1693 | The function should return a value of the form @code{(boundaries | ||
| 1694 | START . END)} where START is the position of the beginning boundary in | ||
| 1695 | in the string to complete, and END is the position of the end boundary | ||
| 1696 | in SUFFIX. | ||
| 1666 | @end itemize | 1697 | @end itemize |
| 1667 | 1698 | ||
| 1668 | It would be consistent and clean for completion functions to allow | 1699 | It would be consistent and clean for completion functions to allow |