aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-07-14 15:55:32 +0000
committerRichard M. Stallman2003-07-14 15:55:32 +0000
commit4ff1926ee8e70170eadd1e6c1759a75aef31c226 (patch)
treeca3675ca5f201a79b82dd21f523d1c8f7acebc06
parente598a60dc3f957b685eb26dbb83b4e544261e412 (diff)
downloademacs-4ff1926ee8e70170eadd1e6c1759a75aef31c226.tar.gz
emacs-4ff1926ee8e70170eadd1e6c1759a75aef31c226.zip
(Basic Completion): Add lazy-completion-table.
(Programmed Completion): Add dynamic-completion-table.
-rw-r--r--lispref/minibuf.texi29
1 files changed, 27 insertions, 2 deletions
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index 8229442fdfc..4c78e021f7f 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -84,7 +84,7 @@ completion commands (@pxref{Completion}).
84 84
85@item 85@item
86@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits 86@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits
87just like @key{RET}. This is used mainly for Mocklisp compatibility. 87just like @key{RET}.
88 88
89@item 89@item
90@code{minibuffer-local-completion-map} is for permissive completion. 90@code{minibuffer-local-completion-map} is for permissive completion.
@@ -520,7 +520,7 @@ for reading certain kinds of names with completion.
520* High-Level Completion:: Convenient special cases of completion 520* High-Level Completion:: Convenient special cases of completion
521 (reading buffer name, file name, etc.) 521 (reading buffer name, file name, etc.)
522* Reading File Names:: Using completion to read file names. 522* Reading File Names:: Using completion to read file names.
523* Programmed Completion:: Finding the completions for a given file name. 523* Programmed Completion:: Writing your own completion-function.
524@end menu 524@end menu
525 525
526@node Basic Completion 526@node Basic Completion
@@ -662,6 +662,22 @@ If the value of this variable is
662non-@code{nil}, Emacs does not consider case significant in completion. 662non-@code{nil}, Emacs does not consider case significant in completion.
663@end defvar 663@end defvar
664 664
665@defmac lazy-completion-table var fun &rest args
666This macro provides a way to initialize the variable @var{var} as a
667completion table in a lazy way, not computing its actual contents
668until they are first needed. You use this macro to produce a value
669that you store in @var{var}. The actual computation of the proper
670value is done the first time you do completion using @var{var}. It is
671done by calling @var{fun} with the arguments @var{args}. The value
672@var{fun} returns becomes the permanent value of @var{var}.
673
674@example
675(defvar foo (lazy-completion-table foo make-my-alist 'global))
676(make-local-variable 'bar)
677(setq bar (lazy-completion-table foo make-my-alist 'local)
678@end example
679@end defmac
680
665@node Minibuffer Completion 681@node Minibuffer Completion
666@subsection Completion and the Minibuffer 682@subsection Completion and the Minibuffer
667 683
@@ -1219,6 +1235,15 @@ to use for completion to be encapsulated in a symbol.
1219 Emacs uses programmed completion when completing file names. 1235 Emacs uses programmed completion when completing file names.
1220@xref{File Name Completion}. 1236@xref{File Name Completion}.
1221 1237
1238@defmac dynamic-completion-table function
1239This macro is a convenient way to write a function that can act as
1240programmed completion function. The argument @var{function} should be
1241a function that takes one argument, a string, and returns an alist of
1242possible completions of it. You can think of
1243@code{dynamic-completion-table} as a transducer between that interface
1244and the interface for programmed completion functions.
1245@end defmac
1246
1222@node Yes-or-No Queries 1247@node Yes-or-No Queries
1223@section Yes-or-No Queries 1248@section Yes-or-No Queries
1224@cindex asking the user questions 1249@cindex asking the user questions