aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-05-30 17:18:35 -0400
committerStefan Monnier2010-05-30 17:18:35 -0400
commit637821cd30f9bd3b523d032e2dda22ffee853d51 (patch)
tree0d51cb7269db234f29cff8d3816134b925572a44
parentfcb5280844c862467b547eaafee54284a34be837 (diff)
downloademacs-637821cd30f9bd3b523d032e2dda22ffee853d51.tar.gz
emacs-637821cd30f9bd3b523d032e2dda22ffee853d51.zip
* doc/lispref/minibuf.texi (Basic Completion): Document completion-boundaries.
(Programmed Completion): Document the new fourth method for boundaries. * .bzrignore: Ignore new files from trunk, which appear if you use colocated branches (i.e. "bzr switch").
-rw-r--r--ChangeLog5
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/minibuf.texi44
3 files changed, 47 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index b218314d2ae..5317cbeb7ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12010-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * .bzrignore: Ignore new files from trunk, which appear if you use
4 colocated branches (i.e. "bzr switch").
5
12010-05-10 Miles Bader <miles@gnu.org> 62010-05-10 Miles Bader <miles@gnu.org>
2 7
3 * configure.in: Get rid of "unix" pre-defined macro when 8 * configure.in: Get rid of "unix" pre-defined macro when
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 93e958c0746..f07fb257a35 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12010-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuf.texi (Basic Completion): Document completion-boundaries.
4 (Programmed Completion): Document the new fourth method for boundaries.
5
12010-05-07 Chong Yidong <cyd@stupidchicken.com> 62010-05-07 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * Version 23.2 released. 8 * Version 23.2 released.
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 66b4cb096cc..841c8823188 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -812,6 +812,24 @@ unpredictable.
812If @var{collection} is a function, it is called with three arguments, 812If @var{collection} is a function, it is called with three arguments,
813the values @var{string}, @var{predicate} and @code{lambda}; whatever 813the values @var{string}, @var{predicate} and @code{lambda}; whatever
814it returns, @code{test-completion} returns in turn. 814it returns, @code{test-completion} returns in turn.
815
816@defun completion-boundaries string collection predicate suffix
817This function returns the boundaries of the field on which @var{collection}
818will operate, assuming that @var{string} holds the text before point
819and @var{suffix} holds the text after point.
820
821Normally completion operates on the whole string, so for all normal
822collections, this will always return @code{(0 . (length
823@var{suffix}))}. But more complex completion such as completion on
824files is done one field at a time. For example, completion of
825@code{"/usr/sh"} will include @code{"/usr/share/"} but not
826@code{"/usr/share/doc"} even if @code{"/usr/share/doc"} exists.
827Also @code{all-completions} on @code{"/usr/sh"} will not include
828@code{"/usr/share/"} but only @code{"share/"}. So if @var{string} is
829@code{"/usr/sh"} and @var{suffix} is @code{"e/doc"},
830@code{completion-boundaries} will return @code{(5 . 1)} which tells us
831that the @var{collection} will only return completion information that
832pertains to the area after @code{"/usr/"} and before @code{"/doc"}.
815@end defun 833@end defun
816 834
817If you store a completion alist in a variable, you should mark the 835If you store a completion alist in a variable, you should mark the
@@ -1618,13 +1636,14 @@ containing all the intended possible completions. In such a case, you
1618can supply your own function to compute the completion of a given 1636can supply your own function to compute the completion of a given
1619string. This is called @dfn{programmed completion}. Emacs uses 1637string. This is called @dfn{programmed completion}. Emacs uses
1620programmed completion when completing file names (@pxref{File Name 1638programmed completion when completing file names (@pxref{File Name
1621Completion}). 1639Completion}), among many other cases.
1622 1640
1623 To use this feature, pass a symbol with a function definition as the 1641 To use this feature, pass a function as the @var{collection}
1624@var{collection} argument to @code{completing-read}. The function 1642argument to @code{completing-read}. The function
1625@code{completing-read} arranges to pass your completion function along 1643@code{completing-read} arranges to pass your completion function along
1626to @code{try-completion} and @code{all-completions}, which will then let 1644to @code{try-completion}, @code{all-completions}, and other basic
1627your function do all the work. 1645completion functions, which will then let your function do all
1646the work.
1628 1647
1629 The completion function should accept three arguments: 1648 The completion function should accept three arguments:
1630 1649
@@ -1638,10 +1657,14 @@ none. Your function should call the predicate for each possible match,
1638and ignore the possible match if the predicate returns @code{nil}. 1657and ignore the possible match if the predicate returns @code{nil}.
1639 1658
1640@item 1659@item
1641A flag specifying the type of operation. 1660A flag specifying the type of operation. The best way to think about
1661it is that the function stands for an object (in the
1662``object-oriented'' sense of the word), and this third argument
1663specifies which method to run.
1642@end itemize 1664@end itemize
1643 1665
1644 There are three flag values for three operations: 1666 There are currently four methods, i.e. four flag values, one for
1667 each of the four different basic operations:
1645 1668
1646@itemize @bullet 1669@itemize @bullet
1647@item 1670@item
@@ -1663,6 +1686,13 @@ string.
1663@code{lambda} specifies @code{test-completion}. The completion 1686@code{lambda} specifies @code{test-completion}. The completion
1664function should return @code{t} if the specified string is an exact 1687function should return @code{t} if the specified string is an exact
1665match for some possibility; @code{nil} otherwise. 1688match for some possibility; @code{nil} otherwise.
1689
1690@item
1691@code{(boundaries . SUFFIX)} specifies @code{completion-boundaries}.
1692The function should return a value of the form @code{(boundaries
1693START . END)} where START is the position of the beginning boundary in
1694in the string to complete, and END is the position of the end boundary
1695in SUFFIX.
1666@end itemize 1696@end itemize
1667 1697
1668 It would be consistent and clean for completion functions to allow 1698 It would be consistent and clean for completion functions to allow