Commit cee2e90d authored by Chong Yidong's avatar Chong Yidong
Browse files

Minor doc fix for switch-to-buffer.

* doc/lispref/windows.texi (Display Action Functions)
(Choosing Window Options): Remove obsolete variable
display-buffer-reuse-frames.
(Switching Buffers): Minor doc tweak for switch-to-buffer.

* lisp/window.el (switch-to-buffer): Doc fix.

Fixes: debbugs:12181
parent 4d64875a
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* windows.texi (Display Action Functions) * windows.texi (Display Action Functions)
(Choosing Window Options): Remove obsolete variable (Choosing Window Options): Remove obsolete variable
display-buffer-reuse-frames. display-buffer-reuse-frames.
(Switching Buffers): Minor doc tweak for switch-to-buffer.
* positions.texi (Narrowing): Document buffer-narrowed-p. * positions.texi (Narrowing): Document buffer-narrowed-p.
......
...@@ -1492,12 +1492,10 @@ to make a buffer current to modify it in Lisp, use ...@@ -1492,12 +1492,10 @@ to make a buffer current to modify it in Lisp, use
@code{set-buffer}. @xref{Current Buffer}. @code{set-buffer}. @xref{Current Buffer}.
@deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window
This function displays @var{buffer-or-name} in the selected window, This command attempts to display @var{buffer-or-name} in the selected
and makes it the current buffer. (In contrast, @code{set-buffer} window, and makes it the current buffer. It is often used
makes the buffer current but does not display it; @pxref{Current interactively (as the binding of @kbd{C-x b}), as well as in Lisp
Buffer}). It is often used interactively (as the binding of @kbd{C-x programs. The return value is the buffer switched to.
b}), as well as in Lisp programs. The return value is the buffer
switched to.
If @var{buffer-or-name} is @code{nil}, it defaults to the buffer If @var{buffer-or-name} is @code{nil}, it defaults to the buffer
returned by @code{other-buffer} (@pxref{The Buffer List}). If returned by @code{other-buffer} (@pxref{The Buffer List}). If
...@@ -1506,17 +1504,18 @@ buffer, this function creates a new buffer with that name; the new ...@@ -1506,17 +1504,18 @@ buffer, this function creates a new buffer with that name; the new
buffer's major mode is determined by the variable @code{major-mode} buffer's major mode is determined by the variable @code{major-mode}
(@pxref{Major Modes}). (@pxref{Major Modes}).
Normally the specified buffer is put at the front of the buffer Normally, the specified buffer is put at the front of the buffer
list---both the global buffer list and the selected frame's buffer list---both the global buffer list and the selected frame's buffer
list (@pxref{The Buffer List}). However, this is not done if the list (@pxref{The Buffer List}). However, this is not done if the
optional argument @var{norecord} is non-@code{nil}. optional argument @var{norecord} is non-@code{nil}.
If this function is unable to display the buffer in the selected Sometimes, @code{switch-to-buffer} may be unable to display the buffer
window---usually because the selected window is a minibuffer window or in the selected window. This happens if the selected window is a
is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then minibuffer window, or if the selected window is strongly dedicated to
it normally tries to display the buffer in some other window, in the its buffer (@pxref{Dedicated Windows}). In that case, the command
manner of @code{pop-to-buffer} (see below). However, if the optional normally tries to display the buffer in some other window, by invoking
argument @var{force-same-window} is non-@code{nil}, it signals an error @code{pop-to-buffer} (see below). However, if the optional argument
@var{force-same-window} is non-@code{nil}, it signals an error
instead. instead.
@end deffn @end deffn
......
2012-09-07 Chong Yidong <cyd@gnu.org> 2012-09-07 Chong Yidong <cyd@gnu.org>
   
* window.el (switch-to-buffer): Doc fix (Bug#12181).
* files.el (after-find-file): Don't fail on a read-only buffer if * files.el (after-find-file): Don't fail on a read-only buffer if
require-final-newline is `visit' or `visit-save' (Bug#11156). require-final-newline is `visit' or `visit-save' (Bug#11156).
   
......
...@@ -5642,26 +5642,28 @@ buffer with the name BUFFER-OR-NAME and return that buffer." ...@@ -5642,26 +5642,28 @@ buffer with the name BUFFER-OR-NAME and return that buffer."
(defun switch-to-buffer (buffer-or-name &optional norecord force-same-window) (defun switch-to-buffer (buffer-or-name &optional norecord force-same-window)
"Switch to buffer BUFFER-OR-NAME in the selected window. "Switch to buffer BUFFER-OR-NAME in the selected window.
If called interactively, prompt for the buffer name using the If the selected window cannot display the specified
buffer (e.g. if it is a minibuffer window or strongly dedicated
to another buffer), call `pop-to-buffer' to select the buffer in
another window.
If called interactively, read the buffer name using the
minibuffer. The variable `confirm-nonexistent-file-or-buffer' minibuffer. The variable `confirm-nonexistent-file-or-buffer'
determines whether to request confirmation before creating a new determines whether to request confirmation before creating a new
buffer. buffer.
BUFFER-OR-NAME may be a buffer, a string (a buffer name), or BUFFER-OR-NAME may be a buffer, a string (a buffer name), or nil.
nil. If BUFFER-OR-NAME is a string that does not identify an If BUFFER-OR-NAME is a string that does not identify an existing
existing buffer, create a buffer with that name. If buffer, create a buffer with that name. If BUFFER-OR-NAME is
BUFFER-OR-NAME is nil, switch to the buffer returned by nil, switch to the buffer returned by `other-buffer'.
`other-buffer'.
If optional argument NORECORD is non-nil, do not put the buffer
Optional argument NORECORD non-nil means do not put the buffer at the front of the buffer list, and do not make the window
specified by BUFFER-OR-NAME at the front of the buffer list and displaying it the most recently selected one.
do not make the window displaying it the most recently selected
one. If optional argument FORCE-SAME-WINDOW is non-nil, the buffer
must be displayed in the selected window; if that is impossible,
If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed signal an error rather than calling `pop-to-buffer'.
in the selected window; signal an error if that is
impossible (e.g. if the selected window is minibuffer-only). If
nil, BUFFER-OR-NAME may be displayed in another window.
Return the buffer switched to." Return the buffer switched to."
(interactive (interactive
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment