From 2a0bc80b0f4b9c3789dc691e8267d761172e7ec3 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 4 Apr 2024 09:21:01 +0300 Subject: [PATCH] Disobey display actions while using switch-to-buffer on the tab-line * lisp/tab-line.el (tab-line-select-tab-buffer) (tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab): Let-bind switch-to-buffer-obey-display-actions to nil around the call to switch-to-buffer to restrain buffer switching in bounds of the same window only (bug#69993). (cherry picked from commit 57e78f2d49a5b1a2337a15254e7b8c87aa63c83a) --- lisp/tab-line.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 8c59f7b2e6d..fd18e7b7909 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -832,7 +832,8 @@ using the `previous-buffer' command." (switch-to-prev-buffer window))) (t (with-selected-window window - (switch-to-buffer buffer)))))) + (let ((switch-to-buffer-obey-display-actions nil)) + (switch-to-buffer buffer))))))) (defcustom tab-line-switch-cycling nil "Enable cycling tab switch. @@ -863,7 +864,8 @@ Its effect is the same as using the `previous-buffer' command (nth (1- (length buffers)) buffers) (nth (1- pos) buffers))))) (when (bufferp buffer) - (switch-to-buffer buffer))))))) + (let ((switch-to-buffer-obey-display-actions nil)) + (switch-to-buffer buffer)))))))) (defun tab-line-switch-to-next-tab (&optional event) "Switch to the next tab's buffer. @@ -885,7 +887,8 @@ Its effect is the same as using the `next-buffer' command (car buffers) (nth (1+ pos) buffers))))) (when (bufferp buffer) - (switch-to-buffer buffer))))))) + (let ((switch-to-buffer-obey-display-actions nil)) + (switch-to-buffer buffer)))))))) (defcustom tab-line-close-tab-function 'bury-buffer -- 2.39.5