Mercurial > emacs
comparison doc/lispref/minibuf.texi @ 98897:3bc1332e6140
(Reading File Names): Document `read-shell-command' and
`minibuffer-local-shell-command-map'.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sun, 19 Oct 2008 16:09:24 +0000 |
parents | 0cd40c64e0f2 |
children | 3fcf0a4ef659 |
comparison
equal
deleted
inserted
replaced
98896:b04b1b0d5866 | 98897:3bc1332e6140 |
---|---|
630 (These are too low level to use the minibuffer.) | 630 (These are too low level to use the minibuffer.) |
631 * Minibuffer Completion:: Invoking the minibuffer with completion. | 631 * Minibuffer Completion:: Invoking the minibuffer with completion. |
632 * Completion Commands:: Minibuffer commands that do completion. | 632 * Completion Commands:: Minibuffer commands that do completion. |
633 * High-Level Completion:: Convenient special cases of completion | 633 * High-Level Completion:: Convenient special cases of completion |
634 (reading buffer name, file name, etc.) | 634 (reading buffer name, file name, etc.) |
635 * Reading File Names:: Using completion to read file names. | 635 * Reading File Names:: Using completion to read file names and |
636 shell commands. | |
636 * Programmed Completion:: Writing your own completion-function. | 637 * Programmed Completion:: Writing your own completion-function. |
637 @end menu | 638 @end menu |
638 | 639 |
639 @node Basic Completion | 640 @node Basic Completion |
640 @subsection Basic Completion Functions | 641 @subsection Basic Completion Functions |
1100 except that it does not bind @key{SPC}. This keymap is used by the | 1101 except that it does not bind @key{SPC}. This keymap is used by the |
1101 function @code{read-file-name}. | 1102 function @code{read-file-name}. |
1102 @end defvar | 1103 @end defvar |
1103 | 1104 |
1104 @node High-Level Completion | 1105 @node High-Level Completion |
1105 @subsection High-Level Completion Functions | 1106 @subsection High-Level Completion Functions |
1106 | 1107 |
1107 This section describes the higher-level convenient functions for | 1108 This section describes the higher-level convenient functions for |
1108 reading certain sorts of names with completion. | 1109 reading certain sorts of names with completion. |
1109 | 1110 |
1110 In most cases, you should not call these functions in the middle of a | 1111 In most cases, you should not call these functions in the middle of a |
1273 @node Reading File Names | 1274 @node Reading File Names |
1274 @subsection Reading File Names | 1275 @subsection Reading File Names |
1275 @cindex read file names | 1276 @cindex read file names |
1276 @cindex prompt for file name | 1277 @cindex prompt for file name |
1277 | 1278 |
1278 Here is another high-level completion function, designed for reading a | 1279 Here is a couple of other high-level completion function, designed |
1279 file name. It provides special features including automatic insertion | 1280 for reading file names and shell commands. They provide special |
1280 of the default directory. | 1281 features including automatic insertion of the default directory. |
1281 | 1282 |
1282 @defun read-file-name prompt &optional directory default existing initial predicate | 1283 @defun read-file-name prompt &optional directory default existing initial predicate |
1283 This function reads a file name in the minibuffer, prompting with | 1284 This function reads a file name in the minibuffer, prompting with |
1284 @var{prompt} and providing completion. | 1285 @var{prompt} and providing completion. |
1285 | 1286 |
1458 ---------- Buffer: Minibuffer ---------- | 1459 ---------- Buffer: Minibuffer ---------- |
1459 @end group | 1460 @end group |
1460 @end example | 1461 @end example |
1461 @end defopt | 1462 @end defopt |
1462 | 1463 |
1464 @defun read-shell-command prompt &optional initial-contents hist &rest args | |
1465 This function reads a shell command from the minibuffer, prompting | |
1466 with @var{prompt} and providing intelligent completion. It completes | |
1467 the first word of the command using candidates that are appropriate | |
1468 for command names. The rest of the shell command arguments are | |
1469 completed as file names. | |
1470 | |
1471 This function works by calling @code{read-from-minibuffer} | |
1472 (@pxref{Text from Minibuffer}), passing it | |
1473 @code{minibuffer-local-shell-command-map} as the @var{keymap} | |
1474 argument. The optional arguments @var{initial-contents} and | |
1475 @var{hist} are passed to @code{read-from-minibuffer} unaltered, except | |
1476 that if @var{hist} is omitted or @code{nil}, it defaults to | |
1477 @code{shell-command-history} (@pxref{Minibuffer History, | |
1478 shell-command-history}), and the @var{read} argument is passed as | |
1479 @code{nil}. The rest of @var{args}, if present, are used by | |
1480 @code{read-from-minibuffer} as its @var{default} and | |
1481 @var{inherit-input-method} arguments. | |
1482 @end defun | |
1483 | |
1484 @defvar minibuffer-local-shell-command-map | |
1485 This keymap is used by @code{read-shell-command} for completing | |
1486 command and file names that are part of a shell command. | |
1487 @end defvar | |
1488 | |
1463 @node Programmed Completion | 1489 @node Programmed Completion |
1464 @subsection Programmed Completion | 1490 @subsection Programmed Completion |
1465 @cindex programmed completion | 1491 @cindex programmed completion |
1466 | 1492 |
1467 Sometimes it is not possible to create an alist or an obarray | 1493 Sometimes it is not possible to create an alist or an obarray |