From 11e5c7d8ca58cc946930048b5c88c8f582d4d5d8 Mon Sep 17 00:00:00 2001 From: Matt Kramer Date: Wed, 24 Nov 2021 21:41:52 +0200 Subject: [PATCH] Fix tab-line cycling when using buffer groups (bug#52050) * lisp/tab-line.el (tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab): Remove tabs that aren't associated with a buffer, such as the `group-tab' that exists when `tab-line-tabs-function' is `tab-line-tabs-buffer-groups'. Copyright-paperwork-exempt: yes --- lisp/tab-line.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 110c6e96969..af0647acf7c 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -792,7 +792,9 @@ Its effect is the same as using the `previous-buffer' command (if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) (switch-to-prev-buffer window) (with-selected-window (or window (selected-window)) - (let* ((tabs (funcall tab-line-tabs-function)) + (let* ((tabs (seq-filter + (lambda (tab) (or (bufferp tab) (assq 'buffer tab))) + (funcall tab-line-tabs-function))) (pos (seq-position tabs (current-buffer) (lambda (tab buffer) @@ -816,7 +818,9 @@ Its effect is the same as using the `next-buffer' command (if (eq tab-line-tabs-function #'tab-line-tabs-window-buffers) (switch-to-next-buffer window) (with-selected-window (or window (selected-window)) - (let* ((tabs (funcall tab-line-tabs-function)) + (let* ((tabs (seq-filter + (lambda (tab) (or (bufferp tab) (assq 'buffer tab))) + (funcall tab-line-tabs-function))) (pos (seq-position tabs (current-buffer) (lambda (tab buffer) -- 2.39.5