diff options
| -rw-r--r-- | doc/lispref/ChangeLog | 1 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 25 | ||||
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/window.el | 34 |
4 files changed, 33 insertions, 29 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 37e96dde077..9a747838c26 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | * windows.texi (Display Action Functions) | 5 | * windows.texi (Display Action Functions) |
| 6 | (Choosing Window Options): Remove obsolete variable | 6 | (Choosing Window Options): Remove obsolete variable |
| 7 | display-buffer-reuse-frames. | 7 | display-buffer-reuse-frames. |
| 8 | (Switching Buffers): Minor doc tweak for switch-to-buffer. | ||
| 8 | 9 | ||
| 9 | * positions.texi (Narrowing): Document buffer-narrowed-p. | 10 | * positions.texi (Narrowing): Document buffer-narrowed-p. |
| 10 | 11 | ||
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 52bdc9a5fa1..ea48a46359c 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -1492,12 +1492,10 @@ to make a buffer current to modify it in Lisp, use | |||
| 1492 | @code{set-buffer}. @xref{Current Buffer}. | 1492 | @code{set-buffer}. @xref{Current Buffer}. |
| 1493 | 1493 | ||
| 1494 | @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window | 1494 | @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window |
| 1495 | This function displays @var{buffer-or-name} in the selected window, | 1495 | This command attempts to display @var{buffer-or-name} in the selected |
| 1496 | and makes it the current buffer. (In contrast, @code{set-buffer} | 1496 | window, and makes it the current buffer. It is often used |
| 1497 | makes the buffer current but does not display it; @pxref{Current | 1497 | interactively (as the binding of @kbd{C-x b}), as well as in Lisp |
| 1498 | Buffer}). It is often used interactively (as the binding of @kbd{C-x | 1498 | programs. The return value is the buffer switched to. |
| 1499 | b}), as well as in Lisp programs. The return value is the buffer | ||
| 1500 | switched to. | ||
| 1501 | 1499 | ||
| 1502 | If @var{buffer-or-name} is @code{nil}, it defaults to the buffer | 1500 | If @var{buffer-or-name} is @code{nil}, it defaults to the buffer |
| 1503 | returned by @code{other-buffer} (@pxref{The Buffer List}). If | 1501 | 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 | buffer's major mode is determined by the variable @code{major-mode} | 1504 | buffer's major mode is determined by the variable @code{major-mode} |
| 1507 | (@pxref{Major Modes}). | 1505 | (@pxref{Major Modes}). |
| 1508 | 1506 | ||
| 1509 | Normally the specified buffer is put at the front of the buffer | 1507 | Normally, the specified buffer is put at the front of the buffer |
| 1510 | list---both the global buffer list and the selected frame's buffer | 1508 | list---both the global buffer list and the selected frame's buffer |
| 1511 | list (@pxref{The Buffer List}). However, this is not done if the | 1509 | list (@pxref{The Buffer List}). However, this is not done if the |
| 1512 | optional argument @var{norecord} is non-@code{nil}. | 1510 | optional argument @var{norecord} is non-@code{nil}. |
| 1513 | 1511 | ||
| 1514 | If this function is unable to display the buffer in the selected | 1512 | Sometimes, @code{switch-to-buffer} may be unable to display the buffer |
| 1515 | window---usually because the selected window is a minibuffer window or | 1513 | in the selected window. This happens if the selected window is a |
| 1516 | is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then | 1514 | minibuffer window, or if the selected window is strongly dedicated to |
| 1517 | it normally tries to display the buffer in some other window, in the | 1515 | its buffer (@pxref{Dedicated Windows}). In that case, the command |
| 1518 | manner of @code{pop-to-buffer} (see below). However, if the optional | 1516 | normally tries to display the buffer in some other window, by invoking |
| 1519 | argument @var{force-same-window} is non-@code{nil}, it signals an error | 1517 | @code{pop-to-buffer} (see below). However, if the optional argument |
| 1518 | @var{force-same-window} is non-@code{nil}, it signals an error | ||
| 1520 | instead. | 1519 | instead. |
| 1521 | @end deffn | 1520 | @end deffn |
| 1522 | 1521 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db3a3f5d044..95a6c1e7174 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-09-07 Chong Yidong <cyd@gnu.org> | 1 | 2012-09-07 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * window.el (switch-to-buffer): Doc fix (Bug#12181). | ||
| 4 | |||
| 3 | * files.el (after-find-file): Don't fail on a read-only buffer if | 5 | * files.el (after-find-file): Don't fail on a read-only buffer if |
| 4 | require-final-newline is `visit' or `visit-save' (Bug#11156). | 6 | require-final-newline is `visit' or `visit-save' (Bug#11156). |
| 5 | 7 | ||
diff --git a/lisp/window.el b/lisp/window.el index 66b86f45e77..0e03268029c 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -5642,26 +5642,28 @@ buffer with the name BUFFER-OR-NAME and return that buffer." | |||
| 5642 | 5642 | ||
| 5643 | (defun switch-to-buffer (buffer-or-name &optional norecord force-same-window) | 5643 | (defun switch-to-buffer (buffer-or-name &optional norecord force-same-window) |
| 5644 | "Switch to buffer BUFFER-OR-NAME in the selected window. | 5644 | "Switch to buffer BUFFER-OR-NAME in the selected window. |
| 5645 | If called interactively, prompt for the buffer name using the | 5645 | If the selected window cannot display the specified |
| 5646 | buffer (e.g. if it is a minibuffer window or strongly dedicated | ||
| 5647 | to another buffer), call `pop-to-buffer' to select the buffer in | ||
| 5648 | another window. | ||
| 5649 | |||
| 5650 | If called interactively, read the buffer name using the | ||
| 5646 | minibuffer. The variable `confirm-nonexistent-file-or-buffer' | 5651 | minibuffer. The variable `confirm-nonexistent-file-or-buffer' |
| 5647 | determines whether to request confirmation before creating a new | 5652 | determines whether to request confirmation before creating a new |
| 5648 | buffer. | 5653 | buffer. |
| 5649 | 5654 | ||
| 5650 | BUFFER-OR-NAME may be a buffer, a string (a buffer name), or | 5655 | BUFFER-OR-NAME may be a buffer, a string (a buffer name), or nil. |
| 5651 | nil. If BUFFER-OR-NAME is a string that does not identify an | 5656 | If BUFFER-OR-NAME is a string that does not identify an existing |
| 5652 | existing buffer, create a buffer with that name. If | 5657 | buffer, create a buffer with that name. If BUFFER-OR-NAME is |
| 5653 | BUFFER-OR-NAME is nil, switch to the buffer returned by | 5658 | nil, switch to the buffer returned by `other-buffer'. |
| 5654 | `other-buffer'. | 5659 | |
| 5655 | 5660 | If optional argument NORECORD is non-nil, do not put the buffer | |
| 5656 | Optional argument NORECORD non-nil means do not put the buffer | 5661 | at the front of the buffer list, and do not make the window |
| 5657 | specified by BUFFER-OR-NAME at the front of the buffer list and | 5662 | displaying it the most recently selected one. |
| 5658 | do not make the window displaying it the most recently selected | 5663 | |
| 5659 | one. | 5664 | If optional argument FORCE-SAME-WINDOW is non-nil, the buffer |
| 5660 | 5665 | must be displayed in the selected window; if that is impossible, | |
| 5661 | If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed | 5666 | signal an error rather than calling `pop-to-buffer'. |
| 5662 | in the selected window; signal an error if that is | ||
| 5663 | impossible (e.g. if the selected window is minibuffer-only). If | ||
| 5664 | nil, BUFFER-OR-NAME may be displayed in another window. | ||
| 5665 | 5667 | ||
| 5666 | Return the buffer switched to." | 5668 | Return the buffer switched to." |
| 5667 | (interactive | 5669 | (interactive |