aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2019-11-26 10:13:12 +0100
committerMartin Rudalics2019-11-26 10:13:12 +0100
commit261b060f12234baa6912ef40a9ce1a054f583ad0 (patch)
tree05ff49333a2b84af0763bc491404352a20c89c7d /doc
parentb006095bc9eb1f963372cf862aa040e9a9d30331 (diff)
downloademacs-261b060f12234baa6912ef40a9ce1a054f583ad0.tar.gz
emacs-261b060f12234baa6912ef40a9ce1a054f583ad0.zip
2019-11-26 Martin Rudalics <rudalics@gmx.at>
* lisp/window.el (switch-to-visible-buffer): Declare obsolete. (switch-to-prev-buffer-skip): New option. (switch-to-prev-buffer, switch-to-next-buffer): Obey 'switch-to-prev-buffer-skip'. * doc/lispref/windows.texi (Window History): Remove description of 'switch-to-visible-buffer'. Describe new option 'switch-to-prev-buffer-skip' * etc/NEWS: Mention switch from 'switch-to-visible-buffer' to 'switch-to-prev-buffer-skip'.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/windows.texi78
1 files changed, 64 insertions, 14 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index f05a6db1761..fdba259bf71 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3920,8 +3920,13 @@ or killed, or has been already shown by a recent invocation of
3920If repeated invocations of this command have already shown all buffers 3920If repeated invocations of this command have already shown all buffers
3921previously shown in @var{window}, further invocations will show buffers 3921previously shown in @var{window}, further invocations will show buffers
3922from the buffer list of the frame @var{window} appears on (@pxref{Buffer 3922from the buffer list of the frame @var{window} appears on (@pxref{Buffer
3923List}), trying to skip buffers that are already shown in another window 3923List}).
3924on that frame. 3924
3925The option @code{switch-to-prev-buffer-skip} described below can be
3926used to inhibit switching to certain buffers, for example, to those
3927already shown in another window. Also, if @var{window}'s frame has a
3928@code{buffer-predicate} parameter (@pxref{Buffer Parameters}), that
3929predicate may inhibit switching to certain buffers.
3925@end deffn 3930@end deffn
3926 3931
3927@deffn Command switch-to-next-buffer &optional window 3932@deffn Command switch-to-next-buffer &optional window
@@ -3933,20 +3938,65 @@ defaults to the selected one.
3933If there is no recent invocation of @code{switch-to-prev-buffer} that 3938If there is no recent invocation of @code{switch-to-prev-buffer} that
3934can be undone, this function tries to show a buffer from the buffer list 3939can be undone, this function tries to show a buffer from the buffer list
3935of the frame @var{window} appears on (@pxref{Buffer List}). 3940of the frame @var{window} appears on (@pxref{Buffer List}).
3941
3942The option @code{switch-to-prev-buffer-skip} and the
3943@code{buffer-predicate} (@pxref{Buffer Parameters}) of @var{window}'s
3944frame affect this command as they do for @code{switch-to-prev-buffer}.
3936@end deffn 3945@end deffn
3937 3946
3938By default @code{switch-to-prev-buffer} and @code{switch-to-next-buffer} 3947By default @code{switch-to-prev-buffer} and
3939can switch to a buffer that is already shown in another window on the 3948@code{switch-to-next-buffer} can switch to a buffer that is already
3940same frame. The following option can be used to override this behavior. 3949shown in another window. The following option can be used to override
3941 3950this behavior.
3942@defopt switch-to-visible-buffer 3951
3943If this variable is non-@code{nil}, @code{switch-to-prev-buffer} and 3952@defopt switch-to-prev-buffer-skip
3944@code{switch-to-next-buffer} may switch to a buffer that is already 3953If this variable is @code{nil}, @code{switch-to-prev-buffer} may
3945visible on the same frame, provided the buffer was shown in the 3954switch to any buffer, including those already shown in other windows.
3946relevant window before. If it is @code{nil}, 3955
3947@code{switch-to-prev-buffer} and @code{switch-to-next-buffer} always 3956If this variable is non-@code{nil}, @code{switch-to-prev-buffer} will
3948try to avoid switching to a buffer that is already visible in another 3957refrain from switching to certain buffers. The following values can
3949window on the same frame. The default is @code{t}. 3958be used:
3959
3960@itemize @bullet
3961@item
3962@code{this} means do not switch to a buffer shown on the frame that
3963hosts the window @code{switch-to-prev-buffer} is acting upon.
3964
3965@item
3966@code{visible} means do not switch to a buffer shown on any visible
3967frame.
3968
3969@item
39700 (the number zero) means do not switch to a buffer shown on any
3971visible or iconified frame.
3972
3973@item
3974@code{t} means do not switch to a buffer shown on any live frame.
3975
3976@item
3977A function that takes three arguments---the @var{window} argument of
3978@code{switch-to-prev-buffer}, a buffer @code{switch-to-prev-buffer}
3979intends to switch to and the @var{bury-or-kill} argument of
3980@code{switch-to-prev-buffer}. If that function returns
3981non-@code{nil}, @code{switch-to-prev-buffer} will refrain from
3982switching to the buffer specified by the second argument.
3983@end itemize
3984
3985The command @code{switch-to-next-buffer} obeys this option in a
3986similar way. If this option specifies a function,
3987@code{switch-to-next-buffer} will call that function with the third
3988argument always @code{nil}.
3989
3990Note that since @code{switch-to-prev-buffer} is called by
3991@code{bury-buffer}, @code{replace-buffer-in-windows} and
3992@code{quit-restore-window} as well, customizing this option may also
3993affect the behavior of Emacs when a window is quit or a buffer gets
3994buried or killed.
3995
3996Note also that under certain circumstances
3997@code{switch-to-prev-buffer} and @code{switch-to-next-buffer} may
3998ignore this option, for example, when there is only one buffer left
3999these functions can switch to.
3950@end defopt 4000@end defopt
3951 4001
3952 4002