all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#52050: [PATCH] Make tab-line-switch-cycling work with buffer groups
@ 2021-11-23  4:16 Matt Kramer
  2021-11-23  8:06 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Kramer @ 2021-11-23  4:16 UTC (permalink / raw)
  To: 52050

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

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@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

[-- Attachment #2: Type: text/html, Size: 2291 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-24 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-23  4:16 bug#52050: [PATCH] Make tab-line-switch-cycling work with buffer groups Matt Kramer
2021-11-23  8:06 ` Juri Linkov
2021-11-23  9:41   ` Matt Kramer
2021-11-24 19:43     ` Juri Linkov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.