diff options
| author | Martin Rudalics | 2015-05-20 08:49:23 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2015-05-20 08:49:23 +0200 |
| commit | 31d58d45249b3fb13a0a9a2c921f04cd9b42ff3f (patch) | |
| tree | a5c2f1b4826b1e7f972c88d6b992ba3dfc9ef05b /doc | |
| parent | f743819b57ef519109c1b9d520d358d19a197086 (diff) | |
| download | emacs-31d58d45249b3fb13a0a9a2c921f04cd9b42ff3f.tar.gz emacs-31d58d45249b3fb13a0a9a2c921f04cd9b42ff3f.zip | |
Improve `switch-to-buffer' in strongly dedicated windows (Bug#20472)
* lisp/window.el (switch-to-buffer-in-dedicated-window): New option.
(switch-to-buffer): If the selected window is strongly dedicated
to its buffer, signal error before prompting for buffer name. Handle
`switch-to-buffer-in-dedicated-window'. (Bug#20472)
* doc/lispref/windows.texi (Switching Buffers): Document
`switch-to-buffer-in-dedicated-window'.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/windows.texi | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 6da3582ddd1..b2bc6378008 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -2005,16 +2005,49 @@ list---both the global buffer list and the selected frame's buffer | |||
| 2005 | list (@pxref{Buffer List}). However, this is not done if the | 2005 | list (@pxref{Buffer List}). However, this is not done if the |
| 2006 | optional argument @var{norecord} is non-@code{nil}. | 2006 | optional argument @var{norecord} is non-@code{nil}. |
| 2007 | 2007 | ||
| 2008 | Sometimes, @code{switch-to-buffer} may be unable to display the buffer | 2008 | Sometimes, the selected window may not be suitable for displaying the |
| 2009 | in the selected window. This happens if the selected window is a | 2009 | buffer. This happens if the selected window is a minibuffer window, or |
| 2010 | minibuffer window, or if the selected window is strongly dedicated to | 2010 | if the selected window is strongly dedicated to its buffer |
| 2011 | its buffer (@pxref{Dedicated Windows}). In that case, the command | 2011 | (@pxref{Dedicated Windows}). In such cases, the command normally tries |
| 2012 | normally tries to display the buffer in some other window, by invoking | 2012 | to display the buffer in some other window, by invoking |
| 2013 | @code{pop-to-buffer} (see below). However, if the optional argument | 2013 | @code{pop-to-buffer} (see below). |
| 2014 | @var{force-same-window} is non-@code{nil}, it signals an error | 2014 | |
| 2015 | instead. | 2015 | If the optional argument @var{force-same-window} is non-@code{nil} and |
| 2016 | the selected window is not suitable for displaying the buffer, this | ||
| 2017 | function always signals an error when called non-interactively. In | ||
| 2018 | interactive use, if the selected window is a minibuffer window, this | ||
| 2019 | function will try to use some other window instead. If the selected | ||
| 2020 | window is strongly dedicated to its buffer, the option | ||
| 2021 | @code{switch-to-buffer-in-dedicated-window} described next can be used | ||
| 2022 | to proceed. | ||
| 2016 | @end deffn | 2023 | @end deffn |
| 2017 | 2024 | ||
| 2025 | @defopt switch-to-buffer-in-dedicated-window | ||
| 2026 | This option, if non-@code{nil}, allows @code{switch-to-buffer} to | ||
| 2027 | proceed when called interactively and the selected window is strongly | ||
| 2028 | dedicated to its buffer. | ||
| 2029 | |||
| 2030 | The following values are respected: | ||
| 2031 | |||
| 2032 | @table @code | ||
| 2033 | @item nil | ||
| 2034 | Disallows switching and signals an error as in non-interactive use. | ||
| 2035 | |||
| 2036 | @item prompt | ||
| 2037 | Prompts the user whether to allow switching. | ||
| 2038 | |||
| 2039 | @item pop | ||
| 2040 | Invokes @code{pop-to-buffer} to proceed. | ||
| 2041 | |||
| 2042 | @item t | ||
| 2043 | Marks the selected window as non-dedicated and proceeds. | ||
| 2044 | @end table | ||
| 2045 | |||
| 2046 | When called non-interactively, @code{switch-to-buffer} always signals an | ||
| 2047 | error when the selected window is dedicated to its buffer and | ||
| 2048 | @var{force-same-window} is non-@code{nil}. | ||
| 2049 | @end defopt | ||
| 2050 | |||
| 2018 | By default, @code{switch-to-buffer} shows the buffer at its position of | 2051 | By default, @code{switch-to-buffer} shows the buffer at its position of |
| 2019 | @code{point}. This behavior can be tuned using the following option. | 2052 | @code{point}. This behavior can be tuned using the following option. |
| 2020 | 2053 | ||