diff options
author | pillule <pillule@riseup.net> | 2021-08-18 09:16:06 +0200 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2021-08-18 09:16:06 +0200 |
commit | eddb003f30e48bdbc0b9cb774f261b1558912167 (patch) | |
tree | 2880c291e3601c4477027aaac6acf093d44b51eb /lisp/window.el | |
parent | 6d3455eb144e30f4cc4f56eb3454f4ad785e411d (diff) | |
download | emacs-eddb003f30e48bdbc0b9cb774f261b1558912167.tar.gz emacs-eddb003f30e48bdbc0b9cb774f261b1558912167.tar.bz2 emacs-eddb003f30e48bdbc0b9cb774f261b1558912167.zip |
Fix behavior when switch-to-prev-buffer-skip is a function (Bug#49275)
* lisp/window.el (switch-to-prev-buffer)
(switch-to-next-buffer): More correctly handle cases where
'switch-to-prev-buffer-skip' is a function.
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/window.el b/lisp/window.el index 0346397566a..e14d472cf3f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4721,8 +4721,8 @@ This function is called by `prev-buffer'." window new-buffer (nth 1 entry) (nth 2 entry)) (throw 'found t))))) - (when skipped - ;; Show first skipped buffer. + (when (and skipped (not (functionp switch-to-prev-buffer-skip))) + ;; Show first skipped buffer, unless skip was a function. (setq new-buffer skipped) (set-window-buffer-start-and-point window new-buffer))) @@ -4831,6 +4831,7 @@ This function is called by `next-buffer'." ;; nreverse here!) (dolist (entry (reverse (window-prev-buffers window))) (when (and (not (eq new-buffer (car entry))) + (not (eq old-buffer (car entry))) (setq new-buffer (car entry)) (or (buffer-live-p new-buffer) (not (setq killed-buffers @@ -4842,8 +4843,8 @@ This function is called by `next-buffer'." window new-buffer (nth 1 entry) (nth 2 entry)) (throw 'found t)))) - (when skipped - ;; Show first skipped buffer. + (when (and skipped (not (functionp switch-to-prev-buffer-skip))) + ;; Show first skipped buffer, unless skip was a function. (setq new-buffer skipped) (set-window-buffer-start-and-point window new-buffer))) |