GNU bug report logs -
#52050
[PATCH] Make tab-line-switch-cycling work with buffer groups
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52050 in the body.
You can then email your comments to 52050 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52050
; Package
emacs
.
(Tue, 23 Nov 2021 04:37:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Matt Kramer <matt314159 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 23 Nov 2021 04:37:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[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)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52050
; Package
emacs
.
(Tue, 23 Nov 2021 08:07:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 52050 <at> debbugs.gnu.org (full text, mbox):
> 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.
Thanks for the patch. Please send your complete tab-line setup,
so we could test and verify that your patch correctly fixes the problem.
I see at least these settings:
(setq tab-line-switch-cycling t)
(setq tab-line-tabs-function 'tab-line-tabs-buffer-groups)
But it seems you also modified either tab-line-tabs-buffer-list-function,
or tab-line-tabs-buffer-group-sort-function, or both of them. Is this true?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52050
; Package
emacs
.
(Tue, 23 Nov 2021 09:43:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 52050 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>
> But it seems you also modified either tab-line-tabs-buffer-list-function,
> or tab-line-tabs-buffer-group-sort-function, or both of them. Is this
> true?
>
Yes to tab-line-tabs-buffer-group-sort-function, no to
tab-line-tabs-buffer-list-function, yes also to
tab-line-tabs-buffer-group-function. Setup is below:
(defvar ++buffer-group-table
(make-hash-table :test 'equal))
;; I manually populate ++buffer-group-table
(defun ++tab-line-buffer-group (buffer)
(gethash (buffer-name buffer) ++buffer-group-table
(with-current-buffer buffer
(concat (symbol-name major-mode)
":"
(and buffer-file-name
(file-name-directory buffer-file-name))))))
(defun ++buffer-name< (a b)
(string< (buffer-name a) (buffer-name b)))
(setq tab-line-tabs-function #'tab-line-tabs-buffer-groups
tab-line-tabs-buffer-group-function #'++tab-line-buffer-group
tab-line-tabs-buffer-group-sort-function #'++buffer-name<
tab-line-switch-cycling t)
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#52050
; Package
emacs
.
(Wed, 24 Nov 2021 19:45:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 52050 <at> debbugs.gnu.org (full text, mbox):
close 52050 29.0.50
thanks
> But it seems you also modified either
> tab-line-tabs-buffer-list-function,
> or tab-line-tabs-buffer-group-sort-function, or both of them. Is this
> true?
>
> Yes to tab-line-tabs-buffer-group-sort-function, no to
> tab-line-tabs-buffer-list-function, yes also to
> tab-line-tabs-buffer-group-function. Setup is below:
Thanks, now confirmed that it works as it should,
so your patch is pushed to master.
bug marked as fixed in version 29.0.50, send any further explanations to
52050 <at> debbugs.gnu.org and Matt Kramer <matt314159 <at> gmail.com>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Wed, 24 Nov 2021 19:45:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 23 Dec 2021 12:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.