comparison lispref/minibuf.texi @ 51914:9cd313749c97

(Basic Completion): Add lazy-completion-table. (Programmed Completion): Add dynamic-completion-table.
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Jul 2003 15:55:32 +0000
parents b8860fc285cb
children 13ba58726a52
comparison
equal deleted inserted replaced
51913:3abc365e9d90 51914:9cd313749c97
82 @item 82 @item
83 @code{minibuffer-local-map} is for ordinary input (no completion). 83 @code{minibuffer-local-map} is for ordinary input (no 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
87 just like @key{RET}. This is used mainly for Mocklisp compatibility. 87 just 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.
91 91
92 @item 92 @item
518 * Minibuffer Completion:: Invoking the minibuffer with completion. 518 * Minibuffer Completion:: Invoking the minibuffer with completion.
519 * Completion Commands:: Minibuffer commands that do completion. 519 * Completion Commands:: Minibuffer commands that do 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
527 @subsection Basic Completion Functions 527 @subsection Basic Completion Functions
528 528
659 659
660 @defvar completion-ignore-case 660 @defvar completion-ignore-case
661 If the value of this variable is 661 If the value of this variable is
662 non-@code{nil}, Emacs does not consider case significant in completion. 662 non-@code{nil}, Emacs does not consider case significant in completion.
663 @end defvar 663 @end defvar
664
665 @defmac lazy-completion-table var fun &rest args
666 This macro provides a way to initialize the variable @var{var} as a
667 completion table in a lazy way, not computing its actual contents
668 until they are first needed. You use this macro to produce a value
669 that you store in @var{var}. The actual computation of the proper
670 value is done the first time you do completion using @var{var}. It is
671 done 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
664 680
665 @node Minibuffer Completion 681 @node Minibuffer Completion
666 @subsection Completion and the Minibuffer 682 @subsection Completion and the Minibuffer
667 683
668 This section describes the basic interface for reading from the 684 This section describes the basic interface for reading from the
1217 to use for completion to be encapsulated in a symbol. 1233 to use for completion to be encapsulated in a symbol.
1218 1234
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
1239 This macro is a convenient way to write a function that can act as
1240 programmed completion function. The argument @var{function} should be
1241 a function that takes one argument, a string, and returns an alist of
1242 possible completions of it. You can think of
1243 @code{dynamic-completion-table} as a transducer between that interface
1244 and 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
1225 @cindex querying the user 1250 @cindex querying the user
1226 @cindex yes-or-no questions 1251 @cindex yes-or-no questions