# HG changeset patch # User Chong Yidong # Date 1227557381 0 # Node ID ddb4dd7dc45fe2b31c317c04811ace7d07c1325f # Parent f19b82f26d027db4d6370674dc1871201ef0d7fc (Select Buffer): Document confirm-nonexistent-file-or-buffer. diff -r f19b82f26d02 -r ddb4dd7dc45f doc/emacs/buffers.texi --- a/doc/emacs/buffers.texi Mon Nov 24 20:08:16 2008 +0000 +++ b/doc/emacs/buffers.texi Mon Nov 24 20:09:41 2008 +0000 @@ -92,13 +92,34 @@ b} specifies the buffer that was current most recently among those not now displayed in any window. +@cindex minibuffer confirmation +@cindex confirming in the minibuffer If you specify a buffer that does not exist, @kbd{C-x b} creates a new, empty buffer that is not visiting any file, and selects it for -editing. You can use such a buffer for making temporary notes. If -you try to save it, you are asked for the file name to use. The new -buffer's major mode is determined by the variable -@code{default-major-mode}; the default value is Fundamental mode. -@xref{Major Modes}. +editing. First, however, Emacs might prompt you for confirmation, in +case you entered the wrong buffer name. Emacs asks for confirmation +only if the last key you typed, before submitting the minibuffer input +with @key{RET}, was @key{TAB} (@code{minibuffer-complete}). This +catches a common mistake, in which one types @key{RET} before +realizing that @key{TAB} did not complete far enough to yield the +desired buffer name (@pxref{Completion}). Emacs asks for confirmation +by putting the message @samp{[Confirm]} in the minibuffer; type +@key{RET} again to confirm and visit the buffer. + +@vindex confirm-nonexistent-file-or-buffer + The variable @code{confirm-nonexistent-file-or-buffer} controls +whether Emacs asks for confirmation before visiting a new buffer. The +default value, @code{after-completion}, gives the behavior we have +just described. If the value is @code{nil}, Emacs never asks for +confirmation; for any other non-@code{nil} value, Emacs always asks +for confirmation. This variable also affects the @code{find-file} +command (@pxref{Visiting}). + + One reason to switch to a new buffer is to use it for making +temporary notes. If you try to save it, you are asked for the file +name to use. The new buffer's major mode is determined by the +variable @code{default-major-mode}; the default value is Fundamental +mode. @xref{Major Modes}. @kindex C-x @key{LEFT} @kindex C-x @key{RIGHT}