diff options
| author | Jürgen Hartmann | 2015-06-23 17:43:58 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2015-06-23 17:43:58 +0200 |
| commit | abe07ef01ccb61968e6aebc1178dbefb683a27ae (patch) | |
| tree | b94bdf63a21a2d0590f122a8abc44916b00a25dc | |
| parent | 931f00677dee11d687b99140d25e5373448e329c (diff) | |
| download | emacs-abe07ef01ccb61968e6aebc1178dbefb683a27ae.tar.gz emacs-abe07ef01ccb61968e6aebc1178dbefb683a27ae.zip | |
Respect ‘switch-to-visible-buffer’ more rigidly. (Bug#20861)
* lisp/window.el (switch-to-visible-buffer): Doc adjustment.
(switch-to-prev-buffer, switch-to-next-buffer): Respect
switch-to-visible-buffer independent of the windows history.
Copyright-paperwork-exempt: yes
| -rw-r--r-- | lisp/window.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/window.el b/lisp/window.el index 6e4571167ea..a4ed9ea7216 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -3874,12 +3874,10 @@ before was current this also makes BUFFER the current buffer." | |||
| 3874 | (defcustom switch-to-visible-buffer t | 3874 | (defcustom switch-to-visible-buffer t |
| 3875 | "If non-nil, allow switching to an already visible buffer. | 3875 | "If non-nil, allow switching to an already visible buffer. |
| 3876 | If this variable is non-nil, `switch-to-prev-buffer' and | 3876 | If this variable is non-nil, `switch-to-prev-buffer' and |
| 3877 | `switch-to-next-buffer' may switch to an already visible buffer | 3877 | `switch-to-next-buffer' may switch to an already visible buffer. |
| 3878 | provided the buffer was shown before in the window specified as | 3878 | If this variable is nil, `switch-to-prev-buffer' and |
| 3879 | argument to those functions. If this variable is nil, | 3879 | `switch-to-next-buffer' always try to avoid switching to a buffer |
| 3880 | `switch-to-prev-buffer' and `switch-to-next-buffer' always try to | 3880 | that is already visible in another window on the same frame." |
| 3881 | avoid switching to a buffer that is already visible in another | ||
| 3882 | window on the same frame." | ||
| 3883 | :type 'boolean | 3881 | :type 'boolean |
| 3884 | :version "24.1" | 3882 | :version "24.1" |
| 3885 | :group 'windows) | 3883 | :group 'windows) |
| @@ -3950,7 +3948,8 @@ to it." | |||
| 3950 | (or (null pred) (funcall pred buffer)) | 3948 | (or (null pred) (funcall pred buffer)) |
| 3951 | (not (eq (aref (buffer-name buffer) 0) ?\s)) | 3949 | (not (eq (aref (buffer-name buffer) 0) ?\s)) |
| 3952 | (or bury-or-kill (not (memq buffer next-buffers)))) | 3950 | (or bury-or-kill (not (memq buffer next-buffers)))) |
| 3953 | (if (get-buffer-window buffer frame) | 3951 | (if (and (not switch-to-visible-buffer) |
| 3952 | (get-buffer-window buffer frame)) | ||
| 3954 | ;; Try to avoid showing a buffer visible in some other window. | 3953 | ;; Try to avoid showing a buffer visible in some other window. |
| 3955 | (unless visible | 3954 | (unless visible |
| 3956 | (setq visible buffer)) | 3955 | (setq visible buffer)) |
| @@ -4052,7 +4051,8 @@ found." | |||
| 4052 | (or (null pred) (funcall pred buffer)) | 4051 | (or (null pred) (funcall pred buffer)) |
| 4053 | (not (eq (aref (buffer-name buffer) 0) ?\s)) | 4052 | (not (eq (aref (buffer-name buffer) 0) ?\s)) |
| 4054 | (not (assq buffer (window-prev-buffers window)))) | 4053 | (not (assq buffer (window-prev-buffers window)))) |
| 4055 | (if (get-buffer-window buffer frame) | 4054 | (if (and (not switch-to-visible-buffer) |
| 4055 | (get-buffer-window buffer frame)) | ||
| 4056 | ;; Try to avoid showing a buffer visible in some other window. | 4056 | ;; Try to avoid showing a buffer visible in some other window. |
| 4057 | (setq visible buffer) | 4057 | (setq visible buffer) |
| 4058 | (setq new-buffer buffer) | 4058 | (setq new-buffer buffer) |