diff options
| author | Glenn Morris | 2012-04-19 21:37:14 -0400 |
|---|---|---|
| committer | Glenn Morris | 2012-04-19 21:37:14 -0400 |
| commit | b58b1df840de3b14a8a4231396c7881fcb5ae15e (patch) | |
| tree | 6d27c003490f614764982cce91ab420763678fd5 | |
| parent | b668fa6eb0d46a8f3c675954dfd8ce79e6441129 (diff) | |
| download | emacs-b58b1df840de3b14a8a4231396c7881fcb5ae15e.tar.gz emacs-b58b1df840de3b14a8a4231396c7881fcb5ae15e.zip | |
More small edits for doc/lispref/minibuf.texi
* doc/lispref/elisp.texi, doc/lispref/vol1.texi, doc/lispref/vol2.texi:
* doc/lispref/minibuf.texi (Completion):
Update "High-Level Completion" description.
* doc/lispref/minibuf.texi (Basic Completion):
No need to describe obarrays here.
Don't mention obsolete `nospace' argument of all-completions.
(Minibuffer Completion, Completion Commands, Reading File Names)
(Completion Variables): Copyedits.
(Completion Commands): Mention parent keymaps.
Remove obsolete minibuffer-local-filename-must-match-map.
(High-Level Completion): Remove read-variable's almost
word-for-word duplication of read-command.
| -rw-r--r-- | doc/lispref/ChangeLog | 13 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 186 | ||||
| -rw-r--r-- | doc/lispref/vol1.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/vol2.texi | 2 |
5 files changed, 90 insertions, 115 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 33aa40d816e..167539aa450 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2012-04-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * minibuf.texi (Basic Completion): No need to describe obarrays here. | ||
| 4 | Don't mention obsolete `nospace' argument of all-completions. | ||
| 5 | (Minibuffer Completion, Completion Commands, Reading File Names) | ||
| 6 | (Completion Variables): Copyedits. | ||
| 7 | (Completion Commands): Mention parent keymaps. | ||
| 8 | Remove obsolete minibuffer-local-filename-must-match-map. | ||
| 9 | (High-Level Completion): Remove read-variable's almost | ||
| 10 | word-for-word duplication of read-command. | ||
| 11 | * elisp.texi, vol1.texi, vol2.texi, minibuf.texi (Completion): | ||
| 12 | Update "High-Level Completion" description. | ||
| 13 | |||
| 1 | 2012-04-19 Glenn Morris <rgm@gnu.org> | 14 | 2012-04-19 Glenn Morris <rgm@gnu.org> |
| 2 | 15 | ||
| 3 | * minibuf.texi (Minibuffers): | 16 | * minibuf.texi (Minibuffers): |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index fd20bed16ae..4319d5eddda 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -648,7 +648,7 @@ Completion | |||
| 648 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 648 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 649 | * Completion Commands:: Minibuffer commands that do completion. | 649 | * Completion Commands:: Minibuffer commands that do completion. |
| 650 | * High-Level Completion:: Convenient special cases of completion | 650 | * High-Level Completion:: Convenient special cases of completion |
| 651 | (reading buffer name, file name, etc.). | 651 | (reading buffer names, variable names, etc.). |
| 652 | * Reading File Names:: Using completion to read file names and | 652 | * Reading File Names:: Using completion to read file names and |
| 653 | shell commands. | 653 | shell commands. |
| 654 | * Completion Variables:: Variables controlling completion behavior. | 654 | * Completion Variables:: Variables controlling completion behavior. |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index c856f0f6663..dbbf1da7490 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -620,6 +620,7 @@ starting from an abbreviation for it. Completion works by comparing the | |||
| 620 | user's input against a list of valid names and determining how much of | 620 | user's input against a list of valid names and determining how much of |
| 621 | the name is determined uniquely by what the user has typed. For | 621 | the name is determined uniquely by what the user has typed. For |
| 622 | example, when you type @kbd{C-x b} (@code{switch-to-buffer}) and then | 622 | example, when you type @kbd{C-x b} (@code{switch-to-buffer}) and then |
| 623 | @c "This is the sort of English up with which I will not put." | ||
| 623 | type the first few letters of the name of the buffer to which you wish | 624 | type the first few letters of the name of the buffer to which you wish |
| 624 | to switch, and then type @key{TAB} (@code{minibuffer-complete}), Emacs | 625 | to switch, and then type @key{TAB} (@code{minibuffer-complete}), Emacs |
| 625 | extends the name as far as it can. | 626 | extends the name as far as it can. |
| @@ -644,7 +645,7 @@ for reading certain kinds of names with completion. | |||
| 644 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 645 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 645 | * Completion Commands:: Minibuffer commands that do completion. | 646 | * Completion Commands:: Minibuffer commands that do completion. |
| 646 | * High-Level Completion:: Convenient special cases of completion | 647 | * High-Level Completion:: Convenient special cases of completion |
| 647 | (reading buffer name, file name, etc.). | 648 | (reading buffer names, variable names, etc.). |
| 648 | * Reading File Names:: Using completion to read file names and | 649 | * Reading File Names:: Using completion to read file names and |
| 649 | shell commands. | 650 | shell commands. |
| 650 | * Completion Variables:: Variables controlling completion behavior. | 651 | * Completion Variables:: Variables controlling completion behavior. |
| @@ -686,13 +687,7 @@ think of such lists as alists. | |||
| 686 | 687 | ||
| 687 | @cindex obarray in completion | 688 | @cindex obarray in completion |
| 688 | If @var{collection} is an obarray (@pxref{Creating Symbols}), the names | 689 | If @var{collection} is an obarray (@pxref{Creating Symbols}), the names |
| 689 | of all symbols in the obarray form the set of permissible completions. The | 690 | of all symbols in the obarray form the set of permissible completions. |
| 690 | global variable @code{obarray} holds an obarray containing the names of | ||
| 691 | all interned Lisp symbols. | ||
| 692 | |||
| 693 | Note that the only valid way to make a new obarray is to create it | ||
| 694 | empty and then add symbols to it one by one using @code{intern}. | ||
| 695 | Also, you cannot intern a given symbol in more than one obarray. | ||
| 696 | 691 | ||
| 697 | If @var{collection} is a hash table, then the keys that are strings | 692 | If @var{collection} is a hash table, then the keys that are strings |
| 698 | are the possible completions. Other keys are ignored. | 693 | are the possible completions. Other keys are ignored. |
| @@ -773,16 +768,20 @@ too short). Both of those begin with the string @samp{foobar}. | |||
| 773 | @end smallexample | 768 | @end smallexample |
| 774 | @end defun | 769 | @end defun |
| 775 | 770 | ||
| 776 | @defun all-completions string collection &optional predicate nospace | 771 | @c Removed obsolete argument nospace. |
| 772 | @defun all-completions string collection &optional predicate | ||
| 777 | This function returns a list of all possible completions of | 773 | This function returns a list of all possible completions of |
| 778 | @var{string}. The arguments to this function (aside from | 774 | @var{string}. The arguments to this function |
| 779 | @var{nospace}) are the same as those of @code{try-completion}. Also, | 775 | @c (aside from @var{nospace}) |
| 780 | this function uses @code{completion-regexp-list} in the same way that | 776 | are the same as those of @code{try-completion}, and it |
| 777 | uses @code{completion-regexp-list} in the same way that | ||
| 781 | @code{try-completion} does. | 778 | @code{try-completion} does. |
| 782 | 779 | ||
| 780 | @ignore | ||
| 783 | The optional argument @var{nospace} is obsolete. If it is | 781 | The optional argument @var{nospace} is obsolete. If it is |
| 784 | non-@code{nil}, completions that start with a space are ignored unless | 782 | non-@code{nil}, completions that start with a space are ignored unless |
| 785 | @var{string} starts with a space. | 783 | @var{string} starts with a space. |
| 784 | @end ignore | ||
| 786 | 785 | ||
| 787 | If @var{collection} is a function, it is called with three arguments: | 786 | If @var{collection} is a function, it is called with three arguments: |
| 788 | @var{string}, @var{predicate} and @code{t}; then @code{all-completions} | 787 | @var{string}, @var{predicate} and @code{t}; then @code{all-completions} |
| @@ -852,7 +851,7 @@ pertains to the area after @code{"/usr/"} and before @code{"/doc"}. | |||
| 852 | @end defun | 851 | @end defun |
| 853 | 852 | ||
| 854 | If you store a completion alist in a variable, you should mark the | 853 | If you store a completion alist in a variable, you should mark the |
| 855 | variable as ``risky'' with a non-@code{nil} | 854 | variable as ``risky'' by giving it a non-@code{nil} |
| 856 | @code{risky-local-variable} property. @xref{File Local Variables}. | 855 | @code{risky-local-variable} property. @xref{File Local Variables}. |
| 857 | 856 | ||
| 858 | @defvar completion-ignore-case | 857 | @defvar completion-ignore-case |
| @@ -881,7 +880,7 @@ proper value is done the first time you do completion using @var{var}. | |||
| 881 | It is done by calling @var{fun} with no arguments. The | 880 | It is done by calling @var{fun} with no arguments. The |
| 882 | value @var{fun} returns becomes the permanent value of @var{var}. | 881 | value @var{fun} returns becomes the permanent value of @var{var}. |
| 883 | 882 | ||
| 884 | Here is a usage example: | 883 | Here is an example: |
| 885 | 884 | ||
| 886 | @smallexample | 885 | @smallexample |
| 887 | (defvar foo (lazy-completion-table foo make-my-alist)) | 886 | (defvar foo (lazy-completion-table foo make-my-alist)) |
| @@ -966,7 +965,7 @@ Methods}) and the setting of @code{enable-multibyte-characters} | |||
| 966 | (@pxref{Text Representations}) from whichever buffer was current before | 965 | (@pxref{Text Representations}) from whichever buffer was current before |
| 967 | entering the minibuffer. | 966 | entering the minibuffer. |
| 968 | 967 | ||
| 969 | If the built-in variable @code{completion-ignore-case} is | 968 | If the variable @code{completion-ignore-case} is |
| 970 | non-@code{nil}, completion ignores case when comparing the input | 969 | non-@code{nil}, completion ignores case when comparing the input |
| 971 | against the possible matches. @xref{Basic Completion}. In this mode | 970 | against the possible matches. @xref{Basic Completion}. In this mode |
| 972 | of operation, @var{predicate} must also ignore case, or you will get | 971 | of operation, @var{predicate} must also ignore case, or you will get |
| @@ -1099,8 +1098,8 @@ uses this to highlight text in the completion list for better visual | |||
| 1099 | feedback. This is not needed in the minibuffer; for minibuffer | 1098 | feedback. This is not needed in the minibuffer; for minibuffer |
| 1100 | completion, you can pass @code{nil}. | 1099 | completion, you can pass @code{nil}. |
| 1101 | 1100 | ||
| 1102 | This function is called by @code{minibuffer-completion-help}. The | 1101 | This function is called by @code{minibuffer-completion-help}. A |
| 1103 | most common way to use it is together with | 1102 | common way to use it is together with |
| 1104 | @code{with-output-to-temp-buffer}, like this: | 1103 | @code{with-output-to-temp-buffer}, like this: |
| 1105 | 1104 | ||
| 1106 | @example | 1105 | @example |
| @@ -1134,7 +1133,7 @@ keymap makes the following bindings: | |||
| 1134 | @end table | 1133 | @end table |
| 1135 | 1134 | ||
| 1136 | @noindent | 1135 | @noindent |
| 1137 | with other characters bound as in @code{minibuffer-local-map} | 1136 | and uses @code{minibuffer-local-map} as its parent keymap |
| 1138 | (@pxref{Definition of minibuffer-local-map}). | 1137 | (@pxref{Definition of minibuffer-local-map}). |
| 1139 | @end defvar | 1138 | @end defvar |
| 1140 | 1139 | ||
| @@ -1146,15 +1145,6 @@ minibuffer unconditionally. By default, this keymap makes the following | |||
| 1146 | bindings: | 1145 | bindings: |
| 1147 | 1146 | ||
| 1148 | @table @asis | 1147 | @table @asis |
| 1149 | @item @kbd{?} | ||
| 1150 | @code{minibuffer-completion-help} | ||
| 1151 | |||
| 1152 | @item @key{SPC} | ||
| 1153 | @code{minibuffer-complete-word} | ||
| 1154 | |||
| 1155 | @item @key{TAB} | ||
| 1156 | @code{minibuffer-complete} | ||
| 1157 | |||
| 1158 | @item @kbd{C-j} | 1148 | @item @kbd{C-j} |
| 1159 | @code{minibuffer-complete-and-exit} | 1149 | @code{minibuffer-complete-and-exit} |
| 1160 | 1150 | ||
| @@ -1163,25 +1153,21 @@ bindings: | |||
| 1163 | @end table | 1153 | @end table |
| 1164 | 1154 | ||
| 1165 | @noindent | 1155 | @noindent |
| 1166 | with other characters bound as in @code{minibuffer-local-map}. | 1156 | and uses @code{minibuffer-local-completion-map} as its parent keymap. |
| 1167 | @end defvar | 1157 | @end defvar |
| 1168 | 1158 | ||
| 1169 | @defvar minibuffer-local-filename-completion-map | 1159 | @defvar minibuffer-local-filename-completion-map |
| 1170 | This is like @code{minibuffer-local-completion-map} | 1160 | This is a sparse keymap that simply unbinds @key{SPC}; because |
| 1171 | except that it does not bind @key{SPC}. This keymap is used by the | 1161 | filenames can contain spaces. The function @code{read-file-name} |
| 1172 | function @code{read-file-name}. | 1162 | combines this keymap with either @code{minibuffer-local-completion-map} |
| 1163 | or @code{minibuffer-local-must-match-map}. | ||
| 1173 | @end defvar | 1164 | @end defvar |
| 1174 | 1165 | ||
| 1175 | @defvar minibuffer-local-filename-must-match-map | ||
| 1176 | This is like @code{minibuffer-local-must-match-map} | ||
| 1177 | except that it does not bind @key{SPC}. This keymap is used by the | ||
| 1178 | function @code{read-file-name}. | ||
| 1179 | @end defvar | ||
| 1180 | 1166 | ||
| 1181 | @node High-Level Completion | 1167 | @node High-Level Completion |
| 1182 | @subsection High-Level Completion Functions | 1168 | @subsection High-Level Completion Functions |
| 1183 | 1169 | ||
| 1184 | This section describes the higher-level convenient functions for | 1170 | This section describes the higher-level convenience functions for |
| 1185 | reading certain sorts of names with completion. | 1171 | reading certain sorts of names with completion. |
| 1186 | 1172 | ||
| 1187 | In most cases, you should not call these functions in the middle of a | 1173 | In most cases, you should not call these functions in the middle of a |
| @@ -1255,7 +1241,7 @@ for which @code{commandp} returns @code{t}. @xref{Interactive Call}. | |||
| 1255 | The argument @var{default} specifies what to return if the user enters | 1241 | The argument @var{default} specifies what to return if the user enters |
| 1256 | null input. It can be a symbol, a string or a list of strings. If it | 1242 | null input. It can be a symbol, a string or a list of strings. If it |
| 1257 | is a string, @code{read-command} interns it before returning it. | 1243 | is a string, @code{read-command} interns it before returning it. |
| 1258 | If it is a list, @code{read-command} returns the first element of this list. | 1244 | If it is a list, @code{read-command} interns the first element of this list. |
| 1259 | If @var{default} is @code{nil}, that means no default has been | 1245 | If @var{default} is @code{nil}, that means no default has been |
| 1260 | specified; then if the user enters null input, the return value is | 1246 | specified; then if the user enters null input, the return value is |
| 1261 | @code{(intern "")}, that is, a symbol whose name is an empty string. | 1247 | @code{(intern "")}, that is, a symbol whose name is an empty string. |
| @@ -1298,50 +1284,9 @@ complete in the set of extant Lisp symbols, and it uses the | |||
| 1298 | @defun read-variable prompt &optional default | 1284 | @defun read-variable prompt &optional default |
| 1299 | @anchor{Definition of read-variable} | 1285 | @anchor{Definition of read-variable} |
| 1300 | This function reads the name of a user variable and returns it as a | 1286 | This function reads the name of a user variable and returns it as a |
| 1301 | symbol. | 1287 | symbol. Its arguments have the same form as those of @code{read-command}. |
| 1302 | 1288 | In general, this function is similar to @code{read-command}, but uses | |
| 1303 | The argument @var{default} specifies the default value to return if | 1289 | the predicate @code{user-variable-p} instead of @code{commandp}. |
| 1304 | the user enters null input. It can be a symbol, a string, or a list | ||
| 1305 | of strings. If it is a string, @code{read-variable} interns it to | ||
| 1306 | make the default value. If it is a list, @code{read-variable} interns | ||
| 1307 | the first element. If @var{default} is @code{nil}, that means no | ||
| 1308 | default has been specified; then if the user enters null input, the | ||
| 1309 | return value is @code{(intern "")}. | ||
| 1310 | |||
| 1311 | @example | ||
| 1312 | @group | ||
| 1313 | (read-variable "Variable name? ") | ||
| 1314 | |||
| 1315 | ;; @r{After evaluation of the preceding expression,} | ||
| 1316 | ;; @r{the following prompt appears,} | ||
| 1317 | ;; @r{with an empty minibuffer:} | ||
| 1318 | @end group | ||
| 1319 | |||
| 1320 | @group | ||
| 1321 | ---------- Buffer: Minibuffer ---------- | ||
| 1322 | Variable name? @point{} | ||
| 1323 | ---------- Buffer: Minibuffer ---------- | ||
| 1324 | @end group | ||
| 1325 | @end example | ||
| 1326 | |||
| 1327 | @noindent | ||
| 1328 | If the user then types @kbd{fill-p @key{RET}}, @code{read-variable} | ||
| 1329 | returns @code{fill-prefix}. | ||
| 1330 | |||
| 1331 | In general, @code{read-variable} is similar to @code{read-command}, | ||
| 1332 | but uses the predicate @code{user-variable-p} instead of | ||
| 1333 | @code{commandp}: | ||
| 1334 | |||
| 1335 | @cindex @code{user-variable-p} example | ||
| 1336 | @example | ||
| 1337 | @group | ||
| 1338 | (read-variable @var{prompt}) | ||
| 1339 | @equiv{} | ||
| 1340 | (intern | ||
| 1341 | (completing-read @var{prompt} obarray | ||
| 1342 | 'user-variable-p t nil)) | ||
| 1343 | @end group | ||
| 1344 | @end example | ||
| 1345 | @end defun | 1290 | @end defun |
| 1346 | 1291 | ||
| 1347 | @deffn Command read-color &optional prompt convert allow-empty display | 1292 | @deffn Command read-color &optional prompt convert allow-empty display |
| @@ -1359,7 +1304,7 @@ minibuffer. However, when called interactively or if the optional | |||
| 1359 | argument @var{convert} is non-@code{nil}, it converts any input color | 1304 | argument @var{convert} is non-@code{nil}, it converts any input color |
| 1360 | name into the corresponding RGB value string and instead returns that. | 1305 | name into the corresponding RGB value string and instead returns that. |
| 1361 | This function requires a valid color specification to be input. | 1306 | This function requires a valid color specification to be input. |
| 1362 | Empty color names are allowed when @code{allow-empty} is | 1307 | Empty color names are allowed when @var{allow-empty} is |
| 1363 | non-@code{nil} and the user enters null input. | 1308 | non-@code{nil} and the user enters null input. |
| 1364 | 1309 | ||
| 1365 | Interactively, or when @var{display} is non-@code{nil}, the return | 1310 | Interactively, or when @var{display} is non-@code{nil}, the return |
| @@ -1377,7 +1322,7 @@ and @code{read-input-method-name}, in @ref{Input Methods}. | |||
| 1377 | 1322 | ||
| 1378 | The high-level completion functions @code{read-file-name}, | 1323 | The high-level completion functions @code{read-file-name}, |
| 1379 | @code{read-directory-name}, and @code{read-shell-command} are designed | 1324 | @code{read-directory-name}, and @code{read-shell-command} are designed |
| 1380 | to read file names, directory names, and shell commands respectively. | 1325 | to read file names, directory names, and shell commands, respectively. |
| 1381 | They provide special features, including automatic insertion of the | 1326 | They provide special features, including automatic insertion of the |
| 1382 | default directory. | 1327 | default directory. |
| 1383 | 1328 | ||
| @@ -1386,15 +1331,29 @@ This function reads a file name, prompting with @var{prompt} and | |||
| 1386 | providing completion. | 1331 | providing completion. |
| 1387 | 1332 | ||
| 1388 | As an exception, this function reads a file name using a graphical | 1333 | As an exception, this function reads a file name using a graphical |
| 1389 | file dialog instead of the minibuffer, if (i) it is invoked via a | 1334 | file dialog instead of the minibuffer, if all of the following are |
| 1390 | mouse command, and (ii) the selected frame is on a graphical display | 1335 | true: |
| 1391 | supporting such dialogs, and (iii) the variable @code{use-dialog-box} | 1336 | |
| 1392 | is non-@code{nil} (@pxref{Dialog Boxes,, Dialog Boxes, emacs, The GNU | 1337 | @enumerate |
| 1393 | Emacs Manual}), and (iv) the @var{directory} argument, described | 1338 | @item |
| 1394 | below, does not specify a remote file (@pxref{Remote Files,, Remote | 1339 | It is invoked via a mouse command. |
| 1395 | Files, emacs, The GNU Emacs Manual}). The exact behavior when using a | 1340 | |
| 1396 | graphical file dialog is platform-dependent. Here, we simply document | 1341 | @item |
| 1397 | the behavior when using the minibuffer. | 1342 | The selected frame is on a graphical display supporting such dialogs. |
| 1343 | |||
| 1344 | @item | ||
| 1345 | The variable @code{use-dialog-box} is non-@code{nil}. | ||
| 1346 | @xref{Dialog Boxes,, Dialog Boxes, emacs, The GNU Emacs Manual}. | ||
| 1347 | |||
| 1348 | @item | ||
| 1349 | The @var{directory} argument, described below, does not specify a | ||
| 1350 | remote file. @xref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual}. | ||
| 1351 | @end enumerate | ||
| 1352 | |||
| 1353 | @noindent | ||
| 1354 | The exact behavior when using a graphical file dialog is | ||
| 1355 | platform-dependent. Here, we simply document the behavior when using | ||
| 1356 | the minibuffer. | ||
| 1398 | 1357 | ||
| 1399 | @code{read-file-name} does not automatically expand the returned file | 1358 | @code{read-file-name} does not automatically expand the returned file |
| 1400 | name. You must call @code{expand-file-name} yourself if an absolute | 1359 | name. You must call @code{expand-file-name} yourself if an absolute |
| @@ -1405,7 +1364,7 @@ The optional argument @var{require-match} has the same meaning as in | |||
| 1405 | 1364 | ||
| 1406 | The argument @var{directory} specifies the directory to use for | 1365 | The argument @var{directory} specifies the directory to use for |
| 1407 | completing relative file names. It should be an absolute directory | 1366 | completing relative file names. It should be an absolute directory |
| 1408 | name. If @code{insert-default-directory} is non-@code{nil}, | 1367 | name. If the variable @code{insert-default-directory} is non-@code{nil}, |
| 1409 | @var{directory} is also inserted in the minibuffer as initial input. | 1368 | @var{directory} is also inserted in the minibuffer as initial input. |
| 1410 | It defaults to the current buffer's value of @code{default-directory}. | 1369 | It defaults to the current buffer's value of @code{default-directory}. |
| 1411 | 1370 | ||
| @@ -1413,9 +1372,9 @@ If you specify @var{initial}, that is an initial file name to insert | |||
| 1413 | in the buffer (after @var{directory}, if that is inserted). In this | 1372 | in the buffer (after @var{directory}, if that is inserted). In this |
| 1414 | case, point goes at the beginning of @var{initial}. The default for | 1373 | case, point goes at the beginning of @var{initial}. The default for |
| 1415 | @var{initial} is @code{nil}---don't insert any file name. To see what | 1374 | @var{initial} is @code{nil}---don't insert any file name. To see what |
| 1416 | @var{initial} does, try the command @kbd{C-x C-v}. @strong{Please | 1375 | @var{initial} does, try the command @kbd{C-x C-v} in a buffer visiting |
| 1417 | note:} we recommend using @var{default} rather than @var{initial} in | 1376 | a file. @strong{Please note:} we recommend using @var{default} rather |
| 1418 | most cases. | 1377 | than @var{initial} in most cases. |
| 1419 | 1378 | ||
| 1420 | If @var{default} is non-@code{nil}, then the function returns | 1379 | If @var{default} is non-@code{nil}, then the function returns |
| 1421 | @var{default} if the user exits the minibuffer with the same non-empty | 1380 | @var{default} if the user exits the minibuffer with the same non-empty |
| @@ -1518,7 +1477,7 @@ use the code letters @samp{f} or @samp{F} in their interactive form. | |||
| 1518 | @xref{Interactive Codes,, Code Characters for interactive}.) Its | 1477 | @xref{Interactive Codes,, Code Characters for interactive}.) Its |
| 1519 | value controls whether @code{read-file-name} starts by placing the | 1478 | value controls whether @code{read-file-name} starts by placing the |
| 1520 | name of the default directory in the minibuffer, plus the initial file | 1479 | name of the default directory in the minibuffer, plus the initial file |
| 1521 | name if any. If the value of this variable is @code{nil}, then | 1480 | name, if any. If the value of this variable is @code{nil}, then |
| 1522 | @code{read-file-name} does not place any initial input in the | 1481 | @code{read-file-name} does not place any initial input in the |
| 1523 | minibuffer (unless you specify initial input with the @var{initial} | 1482 | minibuffer (unless you specify initial input with the @var{initial} |
| 1524 | argument). In that case, the default directory is still used for | 1483 | argument). In that case, the default directory is still used for |
| @@ -1580,20 +1539,22 @@ Input}). The rest of @var{args}, if present, are used as the | |||
| 1580 | 1539 | ||
| 1581 | @defvar minibuffer-local-shell-command-map | 1540 | @defvar minibuffer-local-shell-command-map |
| 1582 | This keymap is used by @code{read-shell-command} for completing | 1541 | This keymap is used by @code{read-shell-command} for completing |
| 1583 | command and file names that are part of a shell command. | 1542 | command and file names that are part of a shell command. It uses |
| 1543 | @code{minibuffer-local-map} as its parent keymap, and binds @key{TAB} | ||
| 1544 | to @code{completion-at-point}. | ||
| 1584 | @end defvar | 1545 | @end defvar |
| 1585 | 1546 | ||
| 1586 | @node Completion Variables | 1547 | @node Completion Variables |
| 1587 | @subsection Completion Variables | 1548 | @subsection Completion Variables |
| 1588 | 1549 | ||
| 1589 | Here are some variables which can be used to alter the default | 1550 | Here are some variables that can be used to alter the default |
| 1590 | completion behavior. | 1551 | completion behavior. |
| 1591 | 1552 | ||
| 1592 | @cindex completion styles | 1553 | @cindex completion styles |
| 1593 | @defopt completion-styles | 1554 | @defopt completion-styles |
| 1594 | The value of this variable is a list of completion style (symbols) to | 1555 | The value of this variable is a list of completion style (symbols) to |
| 1595 | use for performing completion. A @dfn{completion style} is a set of | 1556 | use for performing completion. A @dfn{completion style} is a set of |
| 1596 | rules for generating completions. Each symbol in occurring this list | 1557 | rules for generating completions. Each symbol occurring this list |
| 1597 | must have a corresponding entry in @code{completion-styles-alist}. | 1558 | must have a corresponding entry in @code{completion-styles-alist}. |
| 1598 | @end defopt | 1559 | @end defopt |
| 1599 | 1560 | ||
| @@ -1640,13 +1601,14 @@ description of the available completion styles. | |||
| 1640 | @defopt completion-category-overrides | 1601 | @defopt completion-category-overrides |
| 1641 | This variable specifies special completion styles and other completion | 1602 | This variable specifies special completion styles and other completion |
| 1642 | behaviors to use when completing certain types of text. Its value | 1603 | behaviors to use when completing certain types of text. Its value |
| 1643 | should be a list of the form @code{(@var{category} . @var{alist})}. | 1604 | should be an alist with elements of the form @code{(@var{category} |
| 1644 | @var{category} is a symbol describing what is being completed; | 1605 | . @var{alist})}. @var{category} is a symbol describing what is being |
| 1645 | currently, the @code{buffer} and @code{file} categories are defined, | 1606 | completed; currently, the @code{buffer}, @code{file}, and |
| 1646 | but others can be defined via specialized completion functions | 1607 | @code{unicode-name} categories are defined, but others can be defined |
| 1647 | (@pxref{Programmed Completion}). @var{alist} is an association list | 1608 | via specialized completion functions (@pxref{Programmed Completion}). |
| 1648 | describing how completion should behave for the corresponding | 1609 | @var{alist} is an association list describing how completion should |
| 1649 | category. The following alist keys are supported: | 1610 | behave for the corresponding category. The following alist keys are |
| 1611 | supported: | ||
| 1650 | 1612 | ||
| 1651 | @table @code | 1613 | @table @code |
| 1652 | @item styles | 1614 | @item styles |
| @@ -1679,7 +1641,7 @@ the completion. | |||
| 1679 | The value should be a function to run after performing completion. | 1641 | The value should be a function to run after performing completion. |
| 1680 | The function should accept two arguments, @var{string} and | 1642 | The function should accept two arguments, @var{string} and |
| 1681 | @var{status}, where @var{string} is the text to which the field was | 1643 | @var{status}, where @var{string} is the text to which the field was |
| 1682 | completed and @var{status} indicates what kind of operation happened: | 1644 | completed, and @var{status} indicates what kind of operation happened: |
| 1683 | @code{finished} if text is now complete, @code{sole} if the text | 1645 | @code{finished} if text is now complete, @code{sole} if the text |
| 1684 | cannot be further completed but completion is not finished, or | 1646 | cannot be further completed but completion is not finished, or |
| 1685 | @code{exact} if the text is a valid completion but may be further | 1647 | @code{exact} if the text is a valid completion but may be further |
| @@ -1791,7 +1753,7 @@ the same as for @code{display-sort-function}. | |||
| 1791 | 1753 | ||
| 1792 | @defun completion-table-dynamic function | 1754 | @defun completion-table-dynamic function |
| 1793 | This function is a convenient way to write a function that can act as | 1755 | This function is a convenient way to write a function that can act as |
| 1794 | programmed completion function. The argument @var{function} should be | 1756 | a programmed completion function. The argument @var{function} should be |
| 1795 | a function that takes one argument, a string, and returns an alist of | 1757 | a function that takes one argument, a string, and returns an alist of |
| 1796 | possible completions of it. You can think of | 1758 | possible completions of it. You can think of |
| 1797 | @code{completion-table-dynamic} as a transducer between that interface | 1759 | @code{completion-table-dynamic} as a transducer between that interface |
| @@ -1845,7 +1807,7 @@ satisfy. | |||
| 1845 | 1807 | ||
| 1846 | @item :exclusive | 1808 | @item :exclusive |
| 1847 | If the value is @code{no}, then if the completion table fails to match | 1809 | If the value is @code{no}, then if the completion table fails to match |
| 1848 | the text at point, then @code{completion-at-point} moves on to the | 1810 | the text at point, @code{completion-at-point} moves on to the |
| 1849 | next function in @code{completion-at-point-functions} instead of | 1811 | next function in @code{completion-at-point-functions} instead of |
| 1850 | reporting a completion failure. | 1812 | reporting a completion failure. |
| 1851 | @end table | 1813 | @end table |
| @@ -1859,7 +1821,7 @@ old code to using @code{completion-at-point}. | |||
| 1859 | The first function in @code{completion-at-point-functions} to return a | 1821 | The first function in @code{completion-at-point-functions} to return a |
| 1860 | non-@code{nil} value is used by @code{completion-at-point}. The | 1822 | non-@code{nil} value is used by @code{completion-at-point}. The |
| 1861 | remaining functions are not called. The exception to this is when | 1823 | remaining functions are not called. The exception to this is when |
| 1862 | there is a @code{:exclusive} specification, as described above. | 1824 | there is an @code{:exclusive} specification, as described above. |
| 1863 | @end defvar | 1825 | @end defvar |
| 1864 | 1826 | ||
| 1865 | The following function provides a convenient way to perform | 1827 | The following function provides a convenient way to perform |
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index c16947692e4..25ea8577467 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi | |||
| @@ -670,7 +670,7 @@ Completion | |||
| 670 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 670 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 671 | * Completion Commands:: Minibuffer commands that do completion. | 671 | * Completion Commands:: Minibuffer commands that do completion. |
| 672 | * High-Level Completion:: Convenient special cases of completion | 672 | * High-Level Completion:: Convenient special cases of completion |
| 673 | (reading buffer name, file name, etc.). | 673 | (reading buffer names, variable names, etc.). |
| 674 | * Reading File Names:: Using completion to read file names and | 674 | * Reading File Names:: Using completion to read file names and |
| 675 | shell commands. | 675 | shell commands. |
| 676 | * Completion Variables:: Variables controlling completion behavior. | 676 | * Completion Variables:: Variables controlling completion behavior. |
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index b7dc8366f97..2fd2a8d8224 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi | |||
| @@ -669,7 +669,7 @@ Completion | |||
| 669 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 669 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 670 | * Completion Commands:: Minibuffer commands that do completion. | 670 | * Completion Commands:: Minibuffer commands that do completion. |
| 671 | * High-Level Completion:: Convenient special cases of completion | 671 | * High-Level Completion:: Convenient special cases of completion |
| 672 | (reading buffer name, file name, etc.). | 672 | (reading buffer names, variable names, etc.). |
| 673 | * Reading File Names:: Using completion to read file names and | 673 | * Reading File Names:: Using completion to read file names and |
| 674 | shell commands. | 674 | shell commands. |
| 675 | * Completion Variables:: Variables controlling completion behavior. | 675 | * Completion Variables:: Variables controlling completion behavior. |