GNU bug report logs - #52050
[PATCH] Make tab-line-switch-cycling work with buffer groups

Previous Next

Package: emacs;

Reported by: Matt Kramer <matt314159 <at> gmail.com>

Date: Tue, 23 Nov 2021 04:37:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Matt Kramer <matt314159 <at> gmail.com>
To: 52050 <at> debbugs.gnu.org
Subject: bug#52050: [PATCH] Make tab-line-switch-cycling work with buffer groups
Date: Mon, 22 Nov 2021 20:16:09 -0800
[Message part 1 (text/plain, inline)]
Currently, `tab-line-switch-cycling' has no effect in the presence of any
tab that isn't associated with a buffer, such as the `group-tab' that
exists when `tab-line-tabs-function' is `tab-line-tabs-buffer-groups'. This
patch modifies `tab-line-switch-to-{next,prev}-tab' to remove any such tab
from consideration.

From 205cebc3a05884d948a5ea45688732cbe1b948ea Mon Sep 17 00:00:00 2001
From: Matt Kramer <mkramer <at> lbl.gov>
Date: Mon, 22 Nov 2021 20:03:01 -0800
Subject: [PATCH] Fix tab-line cycling when using buffer groups

---
 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 110c6e9696..af0647acf7 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -792,7 +792,9 @@ tab-line-switch-to-prev-tab
     (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 @@ tab-line-switch-to-next-tab
     (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.26.2
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.