]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tab-line cycling when using buffer groups (bug#52050)
authorMatt Kramer <mkramer@lbl.gov>
Wed, 24 Nov 2021 19:41:52 +0000 (21:41 +0200)
committerJuri Linkov <juri@linkov.net>
Wed, 24 Nov 2021 19:42:32 +0000 (21:42 +0200)
* 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

index 110c6e96969b63f2048bedad6da7e8f126958001..af0647acf7ccc7ac100dd2de80a1fb334679df56 100644 (file)
@@ -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)