aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChong Yidong2011-10-22 09:17:33 +0800
committerChong Yidong2011-10-22 09:17:33 +0800
commita70e06c1173495696681f3230a4e98ee8ae8a82b (patch)
tree4ec90c4e4c5e19aaeb845fb243f498768a4cf747 /doc
parenta7dee7e7732c1f8c0972994e19c1b2754f421e1a (diff)
downloademacs-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/ChangeLog11
-rw-r--r--doc/emacs/buffers.texi96
-rw-r--r--doc/emacs/calendar.texi13
-rw-r--r--doc/emacs/emacs.texi2
-rw-r--r--doc/emacs/files.texi48
-rw-r--r--doc/emacs/mini.texi86
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 @@
12011-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
12011-10-21 Chong Yidong <cyd@gnu.org> 122011-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
11file's text. Each time you invoke Dired, a buffer is created to hold the 11the file's text. Each time you invoke Dired, a buffer is used to hold
12directory listing. If you send a message with @kbd{C-x m}, a buffer named 12the 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 13buffer is used to hold the text of the message. When you ask for a
14command's documentation, that appears in a buffer called @samp{*Help*}. 14command'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
17buffer is displayed in a window, its name is shown in the mode line 17buffer 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
19matters in buffer names. Most buffers are made by visiting files, and 19matters in buffer names. Most buffers are made by visiting files, and
20their names are derived from the files' names; however, you can also 20their names are derived from the files' names; however, you can also
21create an empty buffer with any name you want. A newly started Emacs 21create an empty buffer with any name you want. A newly started Emacs
22has a buffer named @samp{*scratch*}, which is not associated with any 22has several buffers, including one named @samp{*scratch*}, which can
23file and can be used for evaluating Lisp expressions in Emacs 23be used for evaluating Lisp expressions and is not associated with any
24(@pxref{Lisp Interaction}). 24file (@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
29called the @dfn{selected buffer}. We often say that a command 29the @dfn{current buffer}. We sometimes say that a command operates on
30operates on ``the buffer''; this really means that the command 30``the buffer''; this really means that it operates on the current
31operates on the current buffer (most commands do). When there is only 31buffer. When there is only one Emacs window, the buffer displayed in
32one Emacs window, the buffer displayed in that window is current. 32that window is current. When there are multiple windows, the buffer
33When there are multiple windows present, the buffer displayed in the 33displayed 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), 36of information, such as what file it is visiting (if any), whether it
37whether it is modified, and what major mode and minor modes are in 37is modified, and what major mode and minor modes are in effect
38effect (@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 39variables}---variables that can have a different value in each buffer.
40can 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
44by the largest buffer position representable by the @dfn{Emacs 44by the largest buffer position representable by @dfn{Emacs integers}.
45integer} data type. This is because Emacs tracks buffer positions 45This is because Emacs tracks buffer positions using that data type.
46using that data type. For typical 64-bit machines, the maximum buffer size 46For typical 64-bit machines, this maximum buffer size is @math{2^61 -
47enforced by the data types is @math{2^61 - 2} bytes, or about 2 EiB. 472} bytes, or about 2 EiB. For typical 32-bit machines, the maximum is
48For typical 32-bit machines, the maximum is @math{2^29 - 2} bytes, or 48usually @math{2^29 - 2} bytes, or about 512 MiB. Buffer sizes are
49about 512 MiB. Buffer sizes are also limited by the size of Emacs's 49also limited by the amount of memory present in the system.
50virtual 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
76Similar, but select @var{buffer} in a separate frame 75Similar, 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}
79Select the previous buffer in the list of existing buffers. 78Select the previous buffer in the buffer list (@code{previous-buffer}).
80@item C-x @key{RIGHT} 79@item C-x @key{RIGHT}
81Select the next buffer in the list of existing buffers. 80Select 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
84Read a number @var{n} and move to line @var{n} in the most recently 83Read 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 90name using the minibuffer. Then it makes that buffer current, and
92@code{switch-to-buffer} with argument @var{bufname}. While entering 91displays it in the currently-selected window. An empty input
93the buffer name, you can use the usual minibuffer completion and 92specifies the buffer that was current most recently among those not
94history commands (@pxref{Minibuffer}). An empty input specifies the 93now displayed in any window. If you specify a buffer that does not
95buffer that was current most recently among those not now displayed in 94exist, @kbd{C-x b} creates a new, empty buffer that is not visiting
96any window. 95any 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 98history 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 99related commands, use ``permissive completion with confirmation'' for
101new, empty buffer that is not visiting any file, and selects it for 100minibuffer completion: if you type @key{RET} immediately after
102editing. First, however, Emacs might prompt you for confirmation, in 101completing up to a nonexistent buffer name, Emacs prints
103case you entered the wrong buffer name. Emacs asks for confirmation 102@samp{[Confirm]} and you must type a second @key{RET} to submit that
104only if the last key you typed, before submitting the minibuffer input 103buffer name. @xref{Completion Exit}, for details.
105with @key{RET}, was @key{TAB} (@code{minibuffer-complete}). This
106catches a common mistake, in which one types @key{RET} before
107realizing that @key{TAB} did not complete far enough to yield the
108desired buffer name (@pxref{Completion}). Emacs asks for confirmation
109by putting the message @samp{[Confirm]} in the minibuffer; type
110@key{RET} again to confirm and visit the buffer. @xref{Visiting}, for
111information 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
114notes. If you try to save it, Emacs asks for the file name to use. 106notes. 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
897the Gregorian calendar date equivalent to that date, and display the 897to the Gregorian calendar date equivalent to that date, and display
898other calendar's date in the echo area. Emacs uses strict completion 898the 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 899completion (@pxref{Completion Exit}) whenever it asks you to type a
900don't have to worry about the spelling of Hebrew, Islamic, or French names. 900month name, so you don't have to worry about the spelling of Hebrew,
901Islamic, 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
993next occurrence of a combination. These commands signal an error if the 994next occurrence of a combination. These commands signal an error if the
994haab/tzolkin date combination you have typed is impossible. 995haab/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
997asks you to type a Mayan name, so you don't have to worry about 998asks you to type a Mayan name, so you don't have to worry about
998spelling. 999spelling.
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
52the file name, using the minibuffer (@pxref{Minibuffer File}). You 52the file name, using the minibuffer (@pxref{Minibuffer File}).
53can 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
55names whose extensions appear in the variable 55history commands (@pxref{Minibuffer}). Note that file name completion
56ignores file names whose extensions appear in the variable
56@code{completion-ignored-extensions} (@pxref{Completion Options}). 57@code{completion-ignored-extensions} (@pxref{Completion Options}).
58Note also that most commands use ``permissive completion with
59confirmation'' for reading file names: you are allowed to submit a
60nonexistent file name, but if you type @key{RET} immediately after
61completing 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
155minibuffer to enter the name of the desired file (@pxref{File Names}). 162minibuffer to enter the name of the desired file. While in the
156While in the minibuffer, you can abort the command by typing 163minibuffer, you can abort the command by typing @kbd{C-g}. @xref{File
157@kbd{C-g}. 164Names}, 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
160read it, an error message is displayed in the echo area. Otherwise, 167read 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
213actually contains wildcard characters. You can disable the wildcard 220actually contains wildcard characters. You can disable the wildcard
214feature by customizing @code{find-file-wildcards}. 221feature 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
220type @key{RET} immediately to visit it, Emacs asks for confirmation;
221this is because it's possible that you expected completion to go
222further and give you an existing file's name. The string
223@samp{[Confirm]} appears for a short time after the file name to
224indicate the need to confirm in this way. Type @key{RET} to confirm
225and visit the nonexistent file. The variable
226@code{confirm-nonexistent-file-or-buffer} controls whether Emacs asks
227for confirmation before visiting a new file. The default value,
228@code{after-completion}, gives the behavior we have just described.
229If the value is @code{nil}, Emacs never asks for confirmation; for any
230other non-@code{nil} value, Emacs always asks for confirmation. This
231variable also affects the @code{switch-to-buffer} command
232(@pxref{Select Buffer}). @xref{Completion}, for more information
233about 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
385If the selected buffer is not modified (no changes have been made in it 373If the current buffer is not modified (no changes have been made in it
386since the buffer was created or last saved), saving is not really done, 374since the buffer was created or last saved), saving is not really
387because it would have no effect. Instead, @kbd{C-x C-s} displays a message 375done, because it would have no effect. Instead, @kbd{C-x C-s}
388like this in the echo area: 376displays 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
219Completion}. 219Completion}.
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
274arguments that often include spaces, such as file names. 274arguments that often include spaces, such as file names.
275@item @key{RET} 275@item @key{RET}
276Submit the text in the minibuffer as the argument, possibly completing 276Submit the text in the minibuffer as the argument, possibly completing
277first (@code{minibuffer-complete-and-exit}). @xref{Strict Completion}. 277first (@code{minibuffer-complete-and-exit}). @xref{Completion Exit}.
278@item ? 278@item ?
279Display a list of completions (@code{minibuffer-completion-help}). 279Display 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
337completion alternative (@code{previous-completion}). 337completion 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
345depending on how the argument will be used. 345 When a command reads an argument using the minibuffer with
346completion, it also controls what happens when you type @key{RET}
347(@code{minibuffer-complete-and-exit}) to submit the argument. There
348are 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
350example, 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
351name of an existing buffer makes sense. In strict completion, 354match, or completes to one. Otherwise, Emacs refuses to exit the
352@key{RET} refuses to exit if the text in the minibuffer does not 355minibuffer; instead it tries to complete, and if no completion can be
353complete to an exact match. 356done it momentarily displays @samp{[No match]} after the minibuffer
357text. (You can still leave the minibuffer by typing @kbd{C-g} to
358cancel the command.)
359
360An example of a command that uses this behavior is @kbd{M-x}, since it
361is 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. 365exits only if the text is already an exact match. If the text
358Otherwise, @key{RET} does not exit, but it does complete the text. If 366completes to an exact match, @key{RET} performs that completion but
359that completes to an exact match, a second @key{RET} will exit. 367does not exit yet; you must type a second @key{RET} to exit.
360 368
361Cautious completion is used for reading file names for files that must 369Cautious completion is used for reading file names for files that must
362already exist, for example. 370already 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
366candidates are just suggestions. For example, when @kbd{C-x C-f} 374candidates are just suggestions. Typing @key{RET} does not complete,
367reads the name of a file to visit, any file name is allowed, including 375it just submits the argument as you have entered it.
368nonexistent file (in case you want to create a file). In permissive
369completion, @key{RET} does not complete, it just submits the argument
370as 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
374possible completions whenever it is supposed to complete but is unable 378@cindex confirming in the minibuffer
375to complete any further. 379@item
380@dfn{Permissive completion with confirmation} is like permissive
381completion, with an exception: if you typed @key{TAB} and this
382completed the text up to some intermediate state (i.e. one that is not
383yet an exact completion match), typing @key{RET} right afterward does
384not submit the argument. Instead, Emacs asks for confirmation by
385momentarily displaying @samp{[Confirm]} after the text; type @key{RET}
386again to confirm and submit the text. This catches a common mistake,
387in which one types @key{RET} before realizing that @key{TAB} did not
388complete as far as desired.
389
390@vindex confirm-nonexistent-file-or-buffer
391You 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.
394If you change it to @code{nil}, Emacs does not ask for confirmation,
395falling back on permissive completion. If you change it to any other
396non-@code{nil} value, Emacs asks for confirmation whether or not the
397preceding command was @key{TAB}.
398
399This 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