diff options
| author | Chong Yidong | 2011-10-22 09:17:33 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-10-22 09:17:33 +0800 |
| commit | a70e06c1173495696681f3230a4e98ee8ae8a82b (patch) | |
| tree | 4ec90c4e4c5e19aaeb845fb243f498768a4cf747 /doc | |
| parent | a7dee7e7732c1f8c0972994e19c1b2754f421e1a (diff) | |
| download | emacs-a70e06c1173495696681f3230a4e98ee8ae8a82b.tar.gz emacs-a70e06c1173495696681f3230a4e98ee8ae8a82b.zip | |
Reorganize confirm-nonexistent-file-or-buffer documentation in Emacs manual.
* doc/emacs/buffers.texi (Buffers): Tweak mention of mail buffer name.
(Select Buffer): Move confirmation discussion to Minibuffer Exit.
* doc/emacs/files.texi (File Names, Visiting): Move detailed discussion of
minibuffer confirmation to Minibuffer Exit.
* doc/emacs/mini.texi (Minibuffer Exit): Rename from Strict Completion.
Move confirm-nonexistent-file-or-buffer discussion here.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/emacs/buffers.texi | 96 | ||||
| -rw-r--r-- | doc/emacs/calendar.texi | 13 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 48 | ||||
| -rw-r--r-- | doc/emacs/mini.texi | 86 |
6 files changed, 137 insertions, 119 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 94b7bbe2432..06523d40d94 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-10-22 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * mini.texi (Minibuffer Exit): Rename from Strict Completion. | ||
| 4 | Move confirm-nonexistent-file-or-buffer discussion here. | ||
| 5 | |||
| 6 | * files.texi (File Names, Visiting): Move detailed discussion of | ||
| 7 | minibuffer confirmation to Minibuffer Exit. | ||
| 8 | |||
| 9 | * buffers.texi (Buffers): Tweak mention of mail buffer name. | ||
| 10 | (Select Buffer): Move confirmation discussion to Minibuffer Exit. | ||
| 11 | |||
| 1 | 2011-10-21 Chong Yidong <cyd@gnu.org> | 12 | 2011-10-21 Chong Yidong <cyd@gnu.org> |
| 2 | 13 | ||
| 3 | * files.texi (File Names, Visiting, Interlocking): Copyedits. | 14 | * files.texi (File Names, Visiting, Interlocking): Copyedits. |
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index 1108b501ee9..5eba954773c 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi | |||
| @@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | @cindex buffers | 8 | @cindex buffers |
| 9 | The text you are editing in Emacs resides in an object called a | 9 | The text you are editing in Emacs resides in an object called a |
| 10 | @dfn{buffer}. Each time you visit a file, a buffer is created to hold the | 10 | @dfn{buffer}. Each time you visit a file, a buffer is used to hold |
| 11 | file's text. Each time you invoke Dired, a buffer is created to hold the | 11 | the file's text. Each time you invoke Dired, a buffer is used to hold |
| 12 | directory listing. If you send a message with @kbd{C-x m}, a buffer named | 12 | the directory listing. If you send a message with @kbd{C-x m}, a |
| 13 | @samp{*mail*} is used to hold the text of the message. When you ask for a | 13 | buffer is used to hold the text of the message. When you ask for a |
| 14 | command's documentation, that appears in a buffer called @samp{*Help*}. | 14 | command's documentation, that appears in a buffer named @samp{*Help*}. |
| 15 | 15 | ||
| 16 | Each buffer has a unique name, which can be of any length. When a | 16 | Each buffer has a unique name, which can be of any length. When a |
| 17 | buffer is displayed in a window, its name is shown in the mode line | 17 | buffer is displayed in a window, its name is shown in the mode line |
| @@ -19,35 +19,34 @@ buffer is displayed in a window, its name is shown in the mode line | |||
| 19 | matters in buffer names. Most buffers are made by visiting files, and | 19 | matters in buffer names. Most buffers are made by visiting files, and |
| 20 | their names are derived from the files' names; however, you can also | 20 | their names are derived from the files' names; however, you can also |
| 21 | create an empty buffer with any name you want. A newly started Emacs | 21 | create an empty buffer with any name you want. A newly started Emacs |
| 22 | has a buffer named @samp{*scratch*}, which is not associated with any | 22 | has several buffers, including one named @samp{*scratch*}, which can |
| 23 | file and can be used for evaluating Lisp expressions in Emacs | 23 | be used for evaluating Lisp expressions and is not associated with any |
| 24 | (@pxref{Lisp Interaction}). | 24 | file (@pxref{Lisp Interaction}). |
| 25 | 25 | ||
| 26 | @cindex selected buffer | 26 | @cindex selected buffer |
| 27 | @cindex current buffer | 27 | @cindex current buffer |
| 28 | At any time, one and only one buffer is @dfn{current}. This is also | 28 | At any time, one and only one buffer is @dfn{selected}; we call it |
| 29 | called the @dfn{selected buffer}. We often say that a command | 29 | the @dfn{current buffer}. We sometimes say that a command operates on |
| 30 | operates on ``the buffer''; this really means that the command | 30 | ``the buffer''; this really means that it operates on the current |
| 31 | operates on the current buffer (most commands do). When there is only | 31 | buffer. When there is only one Emacs window, the buffer displayed in |
| 32 | one Emacs window, the buffer displayed in that window is current. | 32 | that window is current. When there are multiple windows, the buffer |
| 33 | When there are multiple windows present, the buffer displayed in the | 33 | displayed in the @dfn{selected window} is current. @xref{Windows}. |
| 34 | @dfn{selected window} is current. @xref{Windows}. | 34 | |
| 35 | 35 | Aside from its textual contents, each buffer records several pieces | |
| 36 | Each buffer records individually what file it is visiting (if any), | 36 | of information, such as what file it is visiting (if any), whether it |
| 37 | whether it is modified, and what major mode and minor modes are in | 37 | is modified, and what major mode and minor modes are in effect |
| 38 | effect (@pxref{Major Modes}). Any Emacs variable can be made | 38 | (@pxref{Modes}). These are stored in @dfn{buffer-local |
| 39 | @dfn{local to} a particular buffer, meaning its value in that buffer | 39 | variables}---variables that can have a different value in each buffer. |
| 40 | can be different from the value in other buffers. @xref{Locals}. | 40 | @xref{Locals}. |
| 41 | 41 | ||
| 42 | @cindex buffer size, maximum | 42 | @cindex buffer size, maximum |
| 43 | A buffer's size cannot be larger than some maximum, which is defined | 43 | A buffer's size cannot be larger than some maximum, which is defined |
| 44 | by the largest buffer position representable by the @dfn{Emacs | 44 | by the largest buffer position representable by @dfn{Emacs integers}. |
| 45 | integer} data type. This is because Emacs tracks buffer positions | 45 | This is because Emacs tracks buffer positions using that data type. |
| 46 | using that data type. For typical 64-bit machines, the maximum buffer size | 46 | For typical 64-bit machines, this maximum buffer size is @math{2^61 - |
| 47 | enforced by the data types is @math{2^61 - 2} bytes, or about 2 EiB. | 47 | 2} bytes, or about 2 EiB. For typical 32-bit machines, the maximum is |
| 48 | For typical 32-bit machines, the maximum is @math{2^29 - 2} bytes, or | 48 | usually @math{2^29 - 2} bytes, or about 512 MiB. Buffer sizes are |
| 49 | about 512 MiB. Buffer sizes are also limited by the size of Emacs's | 49 | also limited by the amount of memory present in the system. |
| 50 | virtual memory. | ||
| 51 | 50 | ||
| 52 | @menu | 51 | @menu |
| 53 | * Select Buffer:: Creating a new buffer or reselecting an old one. | 52 | * Select Buffer:: Creating a new buffer or reselecting an old one. |
| @@ -76,9 +75,9 @@ Similar, but select @var{buffer} in another window | |||
| 76 | Similar, but select @var{buffer} in a separate frame | 75 | Similar, but select @var{buffer} in a separate frame |
| 77 | (@code{switch-to-buffer-other-frame}). | 76 | (@code{switch-to-buffer-other-frame}). |
| 78 | @item C-x @key{LEFT} | 77 | @item C-x @key{LEFT} |
| 79 | Select the previous buffer in the list of existing buffers. | 78 | Select the previous buffer in the buffer list (@code{previous-buffer}). |
| 80 | @item C-x @key{RIGHT} | 79 | @item C-x @key{RIGHT} |
| 81 | Select the next buffer in the list of existing buffers. | 80 | Select the next buffer in the buffer list (@code{next-buffer}). |
| 82 | @item C-u M-g M-g | 81 | @item C-u M-g M-g |
| 83 | @itemx C-u M-g g | 82 | @itemx C-u M-g g |
| 84 | Read a number @var{n} and move to line @var{n} in the most recently | 83 | Read a number @var{n} and move to line @var{n} in the most recently |
| @@ -87,28 +86,21 @@ selected buffer other than the current buffer. | |||
| 87 | 86 | ||
| 88 | @kindex C-x b | 87 | @kindex C-x b |
| 89 | @findex switch-to-buffer | 88 | @findex switch-to-buffer |
| 90 | To select the buffer named @var{bufname}, type @kbd{C-x b | 89 | The @kbd{C-x b} (@code{switch-to-buffer}) command reads a buffer |
| 91 | @var{bufname} @key{RET}}. This runs the command | 90 | name using the minibuffer. Then it makes that buffer current, and |
| 92 | @code{switch-to-buffer} with argument @var{bufname}. While entering | 91 | displays it in the currently-selected window. An empty input |
| 93 | the buffer name, you can use the usual minibuffer completion and | 92 | specifies the buffer that was current most recently among those not |
| 94 | history commands (@pxref{Minibuffer}). An empty input specifies the | 93 | now displayed in any window. If you specify a buffer that does not |
| 95 | buffer that was current most recently among those not now displayed in | 94 | exist, @kbd{C-x b} creates a new, empty buffer that is not visiting |
| 96 | any window. | 95 | any file, and selects it for editing. |
| 97 | 96 | ||
| 98 | @cindex minibuffer confirmation | 97 | While entering the buffer name, you can use the usual completion and |
| 99 | @cindex confirming in the minibuffer | 98 | history commands (@pxref{Minibuffer}). Note that @kbd{C-x b}, and |
| 100 | If you specify a buffer that does not exist, @kbd{C-x b} creates a | 99 | related commands, use ``permissive completion with confirmation'' for |
| 101 | new, empty buffer that is not visiting any file, and selects it for | 100 | minibuffer completion: if you type @key{RET} immediately after |
| 102 | editing. First, however, Emacs might prompt you for confirmation, in | 101 | completing up to a nonexistent buffer name, Emacs prints |
| 103 | case you entered the wrong buffer name. Emacs asks for confirmation | 102 | @samp{[Confirm]} and you must type a second @key{RET} to submit that |
| 104 | only if the last key you typed, before submitting the minibuffer input | 103 | buffer name. @xref{Completion Exit}, for details. |
| 105 | with @key{RET}, was @key{TAB} (@code{minibuffer-complete}). This | ||
| 106 | catches a common mistake, in which one types @key{RET} before | ||
| 107 | realizing that @key{TAB} did not complete far enough to yield the | ||
| 108 | desired buffer name (@pxref{Completion}). Emacs asks for confirmation | ||
| 109 | by putting the message @samp{[Confirm]} in the minibuffer; type | ||
| 110 | @key{RET} again to confirm and visit the buffer. @xref{Visiting}, for | ||
| 111 | information about modifying this behavior. | ||
| 112 | 104 | ||
| 113 | One reason to create a new buffer is to use it for making temporary | 105 | One reason to create a new buffer is to use it for making temporary |
| 114 | notes. If you try to save it, Emacs asks for the file name to use. | 106 | notes. If you try to save it, Emacs asks for the file name to use. |
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 71a2dba7d08..4a09d6e3d9c 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi | |||
| @@ -893,11 +893,12 @@ Move to a date specified in the Ethiopic calendar | |||
| 893 | (@code{calendar-ethiopic-goto-date}). | 893 | (@code{calendar-ethiopic-goto-date}). |
| 894 | @end table | 894 | @end table |
| 895 | 895 | ||
| 896 | These commands ask you for a date on the other calendar, move point to | 896 | These commands ask you for a date on the other calendar, move point |
| 897 | the Gregorian calendar date equivalent to that date, and display the | 897 | to the Gregorian calendar date equivalent to that date, and display |
| 898 | other calendar's date in the echo area. Emacs uses strict completion | 898 | the other calendar's date in the echo area. Emacs uses strict |
| 899 | (@pxref{Strict Completion}) whenever it asks you to type a month name, so you | 899 | completion (@pxref{Completion Exit}) whenever it asks you to type a |
| 900 | don't have to worry about the spelling of Hebrew, Islamic, or French names. | 900 | month name, so you don't have to worry about the spelling of Hebrew, |
| 901 | Islamic, or French names. | ||
| 901 | 902 | ||
| 902 | @c FIXME move? | 903 | @c FIXME move? |
| 903 | @findex calendar-hebrew-list-yahrzeits | 904 | @findex calendar-hebrew-list-yahrzeits |
| @@ -993,7 +994,7 @@ occurrence of that combination. Use @kbd{g m n c} to move point to the | |||
| 993 | next occurrence of a combination. These commands signal an error if the | 994 | next occurrence of a combination. These commands signal an error if the |
| 994 | haab/tzolkin date combination you have typed is impossible. | 995 | haab/tzolkin date combination you have typed is impossible. |
| 995 | 996 | ||
| 996 | Emacs uses strict completion (@pxref{Strict Completion}) whenever it | 997 | Emacs uses strict completion (@pxref{Completion Exit}) whenever it |
| 997 | asks you to type a Mayan name, so you don't have to worry about | 998 | asks you to type a Mayan name, so you don't have to worry about |
| 998 | spelling. | 999 | spelling. |
| 999 | 1000 | ||
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 58136ce6730..cad0e4db3c0 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -281,7 +281,7 @@ Completion | |||
| 281 | 281 | ||
| 282 | * Completion Example:: Examples of using completion. | 282 | * Completion Example:: Examples of using completion. |
| 283 | * Completion Commands:: A list of completion commands. | 283 | * Completion Commands:: A list of completion commands. |
| 284 | * Strict Completion:: Different types of completion. | 284 | * Completion Exit:: Completion and minibuffer text submission. |
| 285 | * Completion Styles:: How completion matches are chosen. | 285 | * Completion Styles:: How completion matches are chosen. |
| 286 | * Completion Options:: Options for completion. | 286 | * Completion Options:: Options for completion. |
| 287 | 287 | ||
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index fdd977cf5ff..2317f876b08 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -49,11 +49,18 @@ on file directories. | |||
| 49 | 49 | ||
| 50 | @cindex default file name | 50 | @cindex default file name |
| 51 | Many Emacs commands that operate on a file require you to specify | 51 | Many Emacs commands that operate on a file require you to specify |
| 52 | the file name, using the minibuffer (@pxref{Minibuffer File}). You | 52 | the file name, using the minibuffer (@pxref{Minibuffer File}). |
| 53 | can use @dfn{completion} to specify long file names | 53 | |
| 54 | (@pxref{Completion}); note that file name completion ignores file | 54 | While in the minibuffer, you can use the usual completion and |
| 55 | names whose extensions appear in the variable | 55 | history commands (@pxref{Minibuffer}). Note that file name completion |
| 56 | ignores file names whose extensions appear in the variable | ||
| 56 | @code{completion-ignored-extensions} (@pxref{Completion Options}). | 57 | @code{completion-ignored-extensions} (@pxref{Completion Options}). |
| 58 | Note also that most commands use ``permissive completion with | ||
| 59 | confirmation'' for reading file names: you are allowed to submit a | ||
| 60 | nonexistent file name, but if you type @key{RET} immediately after | ||
| 61 | completing up to a nonexistent file name, Emacs prints | ||
| 62 | @samp{[Confirm]} and you must type a second @key{RET} to confirm. | ||
| 63 | @xref{Completion Exit}, for details. | ||
| 57 | 64 | ||
| 58 | @cindex default directory | 65 | @cindex default directory |
| 59 | @vindex default-directory | 66 | @vindex default-directory |
| @@ -152,9 +159,9 @@ that you visit. | |||
| 152 | @kindex C-x C-f | 159 | @kindex C-x C-f |
| 153 | @findex find-file | 160 | @findex find-file |
| 154 | To visit a file, type @kbd{C-x C-f} (@code{find-file}) and use the | 161 | To visit a file, type @kbd{C-x C-f} (@code{find-file}) and use the |
| 155 | minibuffer to enter the name of the desired file (@pxref{File Names}). | 162 | minibuffer to enter the name of the desired file. While in the |
| 156 | While in the minibuffer, you can abort the command by typing | 163 | minibuffer, you can abort the command by typing @kbd{C-g}. @xref{File |
| 157 | @kbd{C-g}. | 164 | Names}, for details about entering file names into minibuffers. |
| 158 | 165 | ||
| 159 | If the specified file exists but the system does not allow you to | 166 | If the specified file exists but the system does not allow you to |
| 160 | read it, an error message is displayed in the echo area. Otherwise, | 167 | read it, an error message is displayed in the echo area. Otherwise, |
| @@ -213,25 +220,6 @@ File Names}, for information on how to visit a file whose name | |||
| 213 | actually contains wildcard characters. You can disable the wildcard | 220 | actually contains wildcard characters. You can disable the wildcard |
| 214 | feature by customizing @code{find-file-wildcards}. | 221 | feature by customizing @code{find-file-wildcards}. |
| 215 | 222 | ||
| 216 | @cindex minibuffer confirmation | ||
| 217 | @cindex confirming in the minibuffer | ||
| 218 | @vindex confirm-nonexistent-file-or-buffer | ||
| 219 | When @key{TAB} completion results in a nonexistent file name and you | ||
| 220 | type @key{RET} immediately to visit it, Emacs asks for confirmation; | ||
| 221 | this is because it's possible that you expected completion to go | ||
| 222 | further and give you an existing file's name. The string | ||
| 223 | @samp{[Confirm]} appears for a short time after the file name to | ||
| 224 | indicate the need to confirm in this way. Type @key{RET} to confirm | ||
| 225 | and visit the nonexistent file. The variable | ||
| 226 | @code{confirm-nonexistent-file-or-buffer} controls whether Emacs asks | ||
| 227 | for confirmation before visiting a new file. The default value, | ||
| 228 | @code{after-completion}, gives the behavior we have just described. | ||
| 229 | If the value is @code{nil}, Emacs never asks for confirmation; for any | ||
| 230 | other non-@code{nil} value, Emacs always asks for confirmation. This | ||
| 231 | variable also affects the @code{switch-to-buffer} command | ||
| 232 | (@pxref{Select Buffer}). @xref{Completion}, for more information | ||
| 233 | about completion. | ||
| 234 | |||
| 235 | @kindex C-x C-v | 223 | @kindex C-x C-v |
| 236 | @findex find-alternate-file | 224 | @findex find-alternate-file |
| 237 | If you visit the wrong file unintentionally by typing its name | 225 | If you visit the wrong file unintentionally by typing its name |
| @@ -382,10 +370,10 @@ Wrote /u/rms/gnu/gnu.tasks | |||
| 382 | @end example | 370 | @end example |
| 383 | 371 | ||
| 384 | @noindent | 372 | @noindent |
| 385 | If the selected buffer is not modified (no changes have been made in it | 373 | If the current buffer is not modified (no changes have been made in it |
| 386 | since the buffer was created or last saved), saving is not really done, | 374 | since the buffer was created or last saved), saving is not really |
| 387 | because it would have no effect. Instead, @kbd{C-x C-s} displays a message | 375 | done, because it would have no effect. Instead, @kbd{C-x C-s} |
| 388 | like this in the echo area: | 376 | displays a message like this in the echo area: |
| 389 | 377 | ||
| 390 | @example | 378 | @example |
| 391 | (No changes need to be saved) | 379 | (No changes need to be saved) |
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index e84b4c9f080..bbe42551345 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi | |||
| @@ -219,11 +219,11 @@ is sometimes available in ordinary buffers too. @xref{Symbol | |||
| 219 | Completion}. | 219 | Completion}. |
| 220 | 220 | ||
| 221 | @menu | 221 | @menu |
| 222 | * Example: Completion Example. Examples of using completion. | 222 | * Completion Example:: Examples of using completion. |
| 223 | * Commands: Completion Commands. A list of completion commands. | 223 | * Completion Commands:: A list of completion commands. |
| 224 | * Strict Completion:: Different types of completion. | 224 | * Completion Exit:: Completion and minibuffer text submission. |
| 225 | * Completion Styles:: How completion matches are chosen. | 225 | * Completion Styles:: How completion matches are chosen. |
| 226 | * Options: Completion Options. Options for completion. | 226 | * Completion Options:: Options for completion. |
| 227 | @end menu | 227 | @end menu |
| 228 | 228 | ||
| 229 | @node Completion Example | 229 | @node Completion Example |
| @@ -274,7 +274,7 @@ Complete up to one word from the minibuffer text before point | |||
| 274 | arguments that often include spaces, such as file names. | 274 | arguments that often include spaces, such as file names. |
| 275 | @item @key{RET} | 275 | @item @key{RET} |
| 276 | Submit the text in the minibuffer as the argument, possibly completing | 276 | Submit the text in the minibuffer as the argument, possibly completing |
| 277 | first (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. | 277 | first (@code{minibuffer-complete-and-exit}). @xref{Completion Exit}. |
| 278 | @item ? | 278 | @item ? |
| 279 | Display a list of completions (@code{minibuffer-completion-help}). | 279 | Display a list of completions (@code{minibuffer-completion-help}). |
| 280 | @end table | 280 | @end table |
| @@ -337,42 +337,68 @@ While in the completion list buffer, this moves point to the previous | |||
| 337 | completion alternative (@code{previous-completion}). | 337 | completion alternative (@code{previous-completion}). |
| 338 | @end table | 338 | @end table |
| 339 | 339 | ||
| 340 | @node Strict Completion | 340 | @node Completion Exit |
| 341 | @subsection Strict Completion | 341 | @subsection Completion Exit |
| 342 | 342 | ||
| 343 | There are three ways that the @key{RET} | 343 | @kindex RET @r{(completion in minibuffer)} |
| 344 | (@code{minibuffer-complete-and-exit}) completion command can act, | 344 | @findex minibuffer-complete-and-exit |
| 345 | depending on how the argument will be used. | 345 | When a command reads an argument using the minibuffer with |
| 346 | completion, it also controls what happens when you type @key{RET} | ||
| 347 | (@code{minibuffer-complete-and-exit}) to submit the argument. There | ||
| 348 | are four types of behavior: | ||
| 346 | 349 | ||
| 347 | @itemize @bullet | 350 | @itemize @bullet |
| 348 | @item | 351 | @item |
| 349 | @dfn{Strict} completion accepts only known completion candidates. For | 352 | @dfn{Strict completion} accepts only exact completion matches. Typing |
| 350 | example, when @kbd{C-x k} reads the name of a buffer to kill, only the | 353 | @key{RET} exits the minibuffer only if the minibuffer text is an exact |
| 351 | name of an existing buffer makes sense. In strict completion, | 354 | match, or completes to one. Otherwise, Emacs refuses to exit the |
| 352 | @key{RET} refuses to exit if the text in the minibuffer does not | 355 | minibuffer; instead it tries to complete, and if no completion can be |
| 353 | complete to an exact match. | 356 | done it momentarily displays @samp{[No match]} after the minibuffer |
| 357 | text. (You can still leave the minibuffer by typing @kbd{C-g} to | ||
| 358 | cancel the command.) | ||
| 359 | |||
| 360 | An example of a command that uses this behavior is @kbd{M-x}, since it | ||
| 361 | is meaningless for it to accept a non-existent command name. | ||
| 354 | 362 | ||
| 355 | @item | 363 | @item |
| 356 | @dfn{Cautious} completion is similar to strict completion, except that | 364 | @dfn{Cautious completion} is like strict completion, except @key{RET} |
| 357 | @key{RET} exits only if the text is an already exact match. | 365 | exits only if the text is already an exact match. If the text |
| 358 | Otherwise, @key{RET} does not exit, but it does complete the text. If | 366 | completes to an exact match, @key{RET} performs that completion but |
| 359 | that completes to an exact match, a second @key{RET} will exit. | 367 | does not exit yet; you must type a second @key{RET} to exit. |
| 360 | 368 | ||
| 361 | Cautious completion is used for reading file names for files that must | 369 | Cautious completion is used for reading file names for files that must |
| 362 | already exist, for example. | 370 | already exist, for example. |
| 363 | 371 | ||
| 364 | @item | 372 | @item |
| 365 | @dfn{Permissive} completion allows any input; the completion | 373 | @dfn{Permissive completion} allows any input; the completion |
| 366 | candidates are just suggestions. For example, when @kbd{C-x C-f} | 374 | candidates are just suggestions. Typing @key{RET} does not complete, |
| 367 | reads the name of a file to visit, any file name is allowed, including | 375 | it just submits the argument as you have entered it. |
| 368 | nonexistent file (in case you want to create a file). In permissive | ||
| 369 | completion, @key{RET} does not complete, it just submits the argument | ||
| 370 | as you have entered it. | ||
| 371 | @end itemize | ||
| 372 | 376 | ||
| 373 | Like the other completion commands, @key{RET} displays a list of all | 377 | @cindex minibuffer confirmation |
| 374 | possible completions whenever it is supposed to complete but is unable | 378 | @cindex confirming in the minibuffer |
| 375 | to complete any further. | 379 | @item |
| 380 | @dfn{Permissive completion with confirmation} is like permissive | ||
| 381 | completion, with an exception: if you typed @key{TAB} and this | ||
| 382 | completed the text up to some intermediate state (i.e. one that is not | ||
| 383 | yet an exact completion match), typing @key{RET} right afterward does | ||
| 384 | not submit the argument. Instead, Emacs asks for confirmation by | ||
| 385 | momentarily displaying @samp{[Confirm]} after the text; type @key{RET} | ||
| 386 | again to confirm and submit the text. This catches a common mistake, | ||
| 387 | in which one types @key{RET} before realizing that @key{TAB} did not | ||
| 388 | complete as far as desired. | ||
| 389 | |||
| 390 | @vindex confirm-nonexistent-file-or-buffer | ||
| 391 | You can tweak the confirmation behavior by customizing the variable | ||
| 392 | @code{confirm-nonexistent-file-or-buffer}. The default value, | ||
| 393 | @code{after-completion}, gives the behavior we have just described. | ||
| 394 | If you change it to @code{nil}, Emacs does not ask for confirmation, | ||
| 395 | falling back on permissive completion. If you change it to any other | ||
| 396 | non-@code{nil} value, Emacs asks for confirmation whether or not the | ||
| 397 | preceding command was @key{TAB}. | ||
| 398 | |||
| 399 | This behavior is used by most commands that read file names, like | ||
| 400 | @kbd{C-x C-f}, and commands that read buffer names, like @kbd{C-x b}. | ||
| 401 | @end itemize | ||
| 376 | 402 | ||
| 377 | @node Completion Styles | 403 | @node Completion Styles |
| 378 | @subsection How Completion Alternatives Are Chosen | 404 | @subsection How Completion Alternatives Are Chosen |