aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier2010-05-31 22:34:49 -0400
committerStefan Monnier2010-05-31 22:34:49 -0400
commitfd67a7000ee9e118b426df6ad779f3c86d4fe320 (patch)
tree9f39d84fb5eeee28ec6670794980c075ebe51b32 /doc
parent06ac62b4db7cf64c9d65ac55bdfcefdf478e20b5 (diff)
parentfeceda26100f1b5712a85aadf0c428a1507b538d (diff)
downloademacs-fd67a7000ee9e118b426df6ad779f3c86d4fe320.tar.gz
emacs-fd67a7000ee9e118b426df6ad779f3c86d4fe320.zip
Merge from emacs-23
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog9
-rw-r--r--doc/lispref/minibuf.texi45
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 @@
12010-05-30 Juanma Barranquero <lekktu@gmail.com>
2
3 * minibuf.texi (Basic Completion): Add missing "@end defun".
4
52010-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
12010-05-22 Chong Yidong <cyd@stupidchicken.com> 102010-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
814it returns, @code{test-completion} returns in turn. 814it returns, @code{test-completion} returns in turn.
815@end defun 815@end defun
816 816
817@defun completion-boundaries string collection predicate suffix
818This function returns the boundaries of the field on which @var{collection}
819will operate, assuming that @var{string} holds the text before point
820and @var{suffix} holds the text after point.
821
822Normally completion operates on the whole string, so for all normal
823collections, this will always return @code{(0 . (length
824@var{suffix}))}. But more complex completion such as completion on
825files 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.
828Also @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
832that the @var{collection} will only return completion information that
833pertains to the area after @code{"/usr/"} and before @code{"/doc"}.
834@end defun
835
817If you store a completion alist in a variable, you should mark the 836If you store a completion alist in a variable, you should mark the
818variable as ``risky'' with a non-@code{nil} 837variable 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
1618can supply your own function to compute the completion of a given 1637can supply your own function to compute the completion of a given
1619string. This is called @dfn{programmed completion}. Emacs uses 1638string. This is called @dfn{programmed completion}. Emacs uses
1620programmed completion when completing file names (@pxref{File Name 1639programmed completion when completing file names (@pxref{File Name
1621Completion}). 1640Completion}), 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 1643argument 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
1626to @code{try-completion} and @code{all-completions}, which will then let 1645to @code{try-completion}, @code{all-completions}, and other basic
1627your function do all the work. 1646completion functions, which will then let your function do all
1647the 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,
1638and ignore the possible match if the predicate returns @code{nil}. 1658and ignore the possible match if the predicate returns @code{nil}.
1639 1659
1640@item 1660@item
1641A flag specifying the type of operation. 1661A flag specifying the type of operation. The best way to think about
1662it is that the function stands for an object (in the
1663``object-oriented'' sense of the word), and this third argument
1664specifies 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
1664function should return @code{t} if the specified string is an exact 1688function should return @code{t} if the specified string is an exact
1665match for some possibility; @code{nil} otherwise. 1689match for some possibility; @code{nil} otherwise.
1690
1691@item
1692@code{(boundaries . SUFFIX)} specifies @code{completion-boundaries}.
1693The function should return a value of the form @code{(boundaries
1694START . END)} where START is the position of the beginning boundary in
1695in the string to complete, and END is the position of the end boundary
1696in 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