diff options
| author | Martin Rudalics | 2019-11-26 10:13:12 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2019-11-26 10:13:12 +0100 |
| commit | 261b060f12234baa6912ef40a9ce1a054f583ad0 (patch) | |
| tree | 05ff49333a2b84af0763bc491404352a20c89c7d /doc | |
| parent | b006095bc9eb1f963372cf862aa040e9a9d30331 (diff) | |
| download | emacs-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.texi | 78 |
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 | |||
| 3920 | If repeated invocations of this command have already shown all buffers | 3920 | If repeated invocations of this command have already shown all buffers |
| 3921 | previously shown in @var{window}, further invocations will show buffers | 3921 | previously shown in @var{window}, further invocations will show buffers |
| 3922 | from the buffer list of the frame @var{window} appears on (@pxref{Buffer | 3922 | from the buffer list of the frame @var{window} appears on (@pxref{Buffer |
| 3923 | List}), trying to skip buffers that are already shown in another window | 3923 | List}). |
| 3924 | on that frame. | 3924 | |
| 3925 | The option @code{switch-to-prev-buffer-skip} described below can be | ||
| 3926 | used to inhibit switching to certain buffers, for example, to those | ||
| 3927 | already shown in another window. Also, if @var{window}'s frame has a | ||
| 3928 | @code{buffer-predicate} parameter (@pxref{Buffer Parameters}), that | ||
| 3929 | predicate 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. | |||
| 3933 | If there is no recent invocation of @code{switch-to-prev-buffer} that | 3938 | If there is no recent invocation of @code{switch-to-prev-buffer} that |
| 3934 | can be undone, this function tries to show a buffer from the buffer list | 3939 | can be undone, this function tries to show a buffer from the buffer list |
| 3935 | of the frame @var{window} appears on (@pxref{Buffer List}). | 3940 | of the frame @var{window} appears on (@pxref{Buffer List}). |
| 3941 | |||
| 3942 | The option @code{switch-to-prev-buffer-skip} and the | ||
| 3943 | @code{buffer-predicate} (@pxref{Buffer Parameters}) of @var{window}'s | ||
| 3944 | frame affect this command as they do for @code{switch-to-prev-buffer}. | ||
| 3936 | @end deffn | 3945 | @end deffn |
| 3937 | 3946 | ||
| 3938 | By default @code{switch-to-prev-buffer} and @code{switch-to-next-buffer} | 3947 | By default @code{switch-to-prev-buffer} and |
| 3939 | can 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 |
| 3940 | same frame. The following option can be used to override this behavior. | 3949 | shown in another window. The following option can be used to override |
| 3941 | 3950 | this behavior. | |
| 3942 | @defopt switch-to-visible-buffer | 3951 | |
| 3943 | If 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 | 3953 | If this variable is @code{nil}, @code{switch-to-prev-buffer} may |
| 3945 | visible on the same frame, provided the buffer was shown in the | 3954 | switch to any buffer, including those already shown in other windows. |
| 3946 | relevant window before. If it is @code{nil}, | 3955 | |
| 3947 | @code{switch-to-prev-buffer} and @code{switch-to-next-buffer} always | 3956 | If this variable is non-@code{nil}, @code{switch-to-prev-buffer} will |
| 3948 | try to avoid switching to a buffer that is already visible in another | 3957 | refrain from switching to certain buffers. The following values can |
| 3949 | window on the same frame. The default is @code{t}. | 3958 | be used: |
| 3959 | |||
| 3960 | @itemize @bullet | ||
| 3961 | @item | ||
| 3962 | @code{this} means do not switch to a buffer shown on the frame that | ||
| 3963 | hosts 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 | ||
| 3967 | frame. | ||
| 3968 | |||
| 3969 | @item | ||
| 3970 | 0 (the number zero) means do not switch to a buffer shown on any | ||
| 3971 | visible or iconified frame. | ||
| 3972 | |||
| 3973 | @item | ||
| 3974 | @code{t} means do not switch to a buffer shown on any live frame. | ||
| 3975 | |||
| 3976 | @item | ||
| 3977 | A function that takes three arguments---the @var{window} argument of | ||
| 3978 | @code{switch-to-prev-buffer}, a buffer @code{switch-to-prev-buffer} | ||
| 3979 | intends to switch to and the @var{bury-or-kill} argument of | ||
| 3980 | @code{switch-to-prev-buffer}. If that function returns | ||
| 3981 | non-@code{nil}, @code{switch-to-prev-buffer} will refrain from | ||
| 3982 | switching to the buffer specified by the second argument. | ||
| 3983 | @end itemize | ||
| 3984 | |||
| 3985 | The command @code{switch-to-next-buffer} obeys this option in a | ||
| 3986 | similar way. If this option specifies a function, | ||
| 3987 | @code{switch-to-next-buffer} will call that function with the third | ||
| 3988 | argument always @code{nil}. | ||
| 3989 | |||
| 3990 | Note 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 | ||
| 3993 | affect the behavior of Emacs when a window is quit or a buffer gets | ||
| 3994 | buried or killed. | ||
| 3995 | |||
| 3996 | Note also that under certain circumstances | ||
| 3997 | @code{switch-to-prev-buffer} and @code{switch-to-next-buffer} may | ||
| 3998 | ignore this option, for example, when there is only one buffer left | ||
| 3999 | these functions can switch to. | ||
| 3950 | @end defopt | 4000 | @end defopt |
| 3951 | 4001 | ||
| 3952 | 4002 | ||