aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2015-05-20 08:49:23 +0200
committerMartin Rudalics2015-05-20 08:49:23 +0200
commit31d58d45249b3fb13a0a9a2c921f04cd9b42ff3f (patch)
treea5c2f1b4826b1e7f972c88d6b992ba3dfc9ef05b /doc
parentf743819b57ef519109c1b9d520d358d19a197086 (diff)
downloademacs-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.texi49
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
2005list (@pxref{Buffer List}). However, this is not done if the 2005list (@pxref{Buffer List}). However, this is not done if the
2006optional argument @var{norecord} is non-@code{nil}. 2006optional argument @var{norecord} is non-@code{nil}.
2007 2007
2008Sometimes, @code{switch-to-buffer} may be unable to display the buffer 2008Sometimes, the selected window may not be suitable for displaying the
2009in the selected window. This happens if the selected window is a 2009buffer. This happens if the selected window is a minibuffer window, or
2010minibuffer window, or if the selected window is strongly dedicated to 2010if the selected window is strongly dedicated to its buffer
2011its buffer (@pxref{Dedicated Windows}). In that case, the command 2011(@pxref{Dedicated Windows}). In such cases, the command normally tries
2012normally tries to display the buffer in some other window, by invoking 2012to 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
2015instead. 2015If the optional argument @var{force-same-window} is non-@code{nil} and
2016the selected window is not suitable for displaying the buffer, this
2017function always signals an error when called non-interactively. In
2018interactive use, if the selected window is a minibuffer window, this
2019function will try to use some other window instead. If the selected
2020window is strongly dedicated to its buffer, the option
2021@code{switch-to-buffer-in-dedicated-window} described next can be used
2022to proceed.
2016@end deffn 2023@end deffn
2017 2024
2025@defopt switch-to-buffer-in-dedicated-window
2026This option, if non-@code{nil}, allows @code{switch-to-buffer} to
2027proceed when called interactively and the selected window is strongly
2028dedicated to its buffer.
2029
2030The following values are respected:
2031
2032@table @code
2033@item nil
2034Disallows switching and signals an error as in non-interactive use.
2035
2036@item prompt
2037Prompts the user whether to allow switching.
2038
2039@item pop
2040Invokes @code{pop-to-buffer} to proceed.
2041
2042@item t
2043Marks the selected window as non-dedicated and proceeds.
2044@end table
2045
2046When called non-interactively, @code{switch-to-buffer} always signals an
2047error when the selected window is dedicated to its buffer and
2048@var{force-same-window} is non-@code{nil}.
2049@end defopt
2050
2018By default, @code{switch-to-buffer} shows the buffer at its position of 2051By 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