GNU bug report logs - #71939
tab-bar `tab-bar-show-inactive-group-tabs' feature request

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Thu, 4 Jul 2024 13:43:01 UTC

Severity: wishlist

Fixed in version 31.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 71939 in the body.
You can then email your comments to 71939 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#71939; Package emacs. (Thu, 04 Jul 2024 13:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ship Mints <shipmints <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 04 Jul 2024 13:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: "Joseph Turner via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Cc: Juri Linkov <juri <at> linkov.net>
Subject: tab-bar `tab-bar-show-inactive-group-tabs' feature request
Date: Thu, 4 Jul 2024 09:41:42 -0400
[Message part 1 (text/plain, inline)]
I'd like to propose that `tab-bar' allow optionally showing tabs for
inactive groups when `tab-bar-format-tabs-groups' is in force rather than
the always-on policy of collapsing inactive groups.

The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
compatible for existing users and has no visible changes for people who do
not set it to t. I will occasionally set the value locally to alter frame
by frame behavior. I've also used a key binding to toggle the behavior to
nice effect.

I've been using these changes (via advice :override) under Emacs 29.3.

Thanks, again, for this package.

The proposed implementation is below with new/changed code in bold.










*(defcustom tab-bar-show-inactive-group-tabs nil  "Show tabs which are in
inactive groups."  :type 'boolean  :initialize 'custom-initialize-default
:set (lambda (sym val)         (set-default sym val)
 (force-mode-line-update))  :group 'tab-bar  :version "30.x")*
(defun tab-bar-format-tabs-groups ()
  "Produce tabs for the tab bar grouped according to their groups."
  (let* ((tabs (funcall tab-bar-tabs-function))
         (current-group (funcall tab-bar-tab-group-function
                                 (tab-bar--current-tab-find tabs)))
         (previous-group nil)
         (i 0))
    (mapcan
     (lambda (tab)
       (let ((tab-group (funcall tab-bar-tab-group-function tab)))
         (setq i (1+ i))
         (prog1 (cond
                 ;; Show current group tabs and ungrouped tabs
                 ((or (equal tab-group current-group) (not tab-group))
                  (append
                   ;; Prepend current group name before first tab
                   (when (and (not (equal previous-group tab-group))
tab-group)
                     (tab-bar--format-tab-group tab i t))
                   ;; Override default tab faces to use group faces
                   (let ((tab-bar-tab-face-function
tab-bar-tab-group-face-function))
                     (tab-bar--format-tab tab i))))
                 ;; Show first tab of other groups with a group name
                 ((not (equal previous-group tab-group))





*                  (append                   (tab-bar--format-tab-group tab
i)                   (when tab-bar-show-inactive-group-tabs
     (let ((tab-bar-tab-face-function tab-bar-tab-group-face-function))
                   (tab-bar--format-tab tab i)))))*                 ;; Hide
other group tabs



*                 (t (when tab-bar-show-inactive-group-tabs
      (let ((tab-bar-tab-face-function tab-bar-tab-group-face-function))
                    (tab-bar--format-tab tab i)))))*           (setq
previous-group tab-group))))
     tabs)))

-Stephane
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71939; Package emacs. (Thu, 04 Jul 2024 16:15:03 GMT) Full text and rfc822 format available.

Message #8 received at 71939 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 71939 <at> debbugs.gnu.org
Subject: Re: bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature
 request
Date: Thu, 04 Jul 2024 19:12:29 +0300
> I'd like to propose that `tab-bar' allow optionally showing tabs for
> inactive groups when `tab-bar-format-tabs-groups' is in force rather than
> the always-on policy of collapsing inactive groups.
>
> The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
> compatible for existing users and has no visible changes for people who do
> not set it to t. I will occasionally set the value locally to alter frame
> by frame behavior. I've also used a key binding to toggle the behavior to
> nice effect.
>
> I've been using these changes (via advice :override) under Emacs 29.3.

Thanks for the suggestion.  I'll try to adapt this for Emacs 31.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71939; Package emacs. (Mon, 29 Jul 2024 18:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 71939 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 71939 <at> debbugs.gnu.org
Subject: Re: bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature
 request
Date: Mon, 29 Jul 2024 21:27:49 +0300
close 71939 31.0.50
thanks

>> I'd like to propose that `tab-bar' allow optionally showing tabs for
>> inactive groups when `tab-bar-format-tabs-groups' is in force rather than
>> the always-on policy of collapsing inactive groups.
>>
>> The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
>> compatible for existing users and has no visible changes for people who do
>> not set it to t. I will occasionally set the value locally to alter frame
>> by frame behavior. I've also used a key binding to toggle the behavior to
>> nice effect.
>>
>> I've been using these changes (via advice :override) under Emacs 29.3.
>
> Thanks for the suggestion.  I'll try to adapt this for Emacs 31.

I adapted this for Emacs 31 and pushed to master.
Thanks for this feature.




bug marked as fixed in version 31.0.50, send any further explanations to 71939 <at> debbugs.gnu.org and Ship Mints <shipmints <at> gmail.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 29 Jul 2024 18:30:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71939; Package emacs. (Mon, 29 Jul 2024 19:08:01 GMT) Full text and rfc822 format available.

Message #16 received at 71939 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 71939 <at> debbugs.gnu.org
Subject: Re: bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature
 request
Date: Mon, 29 Jul 2024 15:05:52 -0400
[Message part 1 (text/plain, inline)]
Thank you. In my config, I've also implemented "(setq
tab-bar-inhibit-inactive-group-tab-hints t)" which suppresses tab hints on
group tabs when inactive groups are being displayed as they are generally
superfluous in that case. We could make suppressing tab hints on group tabs
when inactive groups are being displayed as the only behavior which is also
fine by me.

(defun my/tab-bar-tab-group-format-function (tab i &optional current-p)





*  (let ((tab-bar-tab-hints         (if (and
tab-bar-show-inactive-group-tabs
tab-bar-inhibit-inactive-group-tab-hints)             nil
 tab-bar-tab-hints)))*    (concat
     (propertize
      my:tab-bar-tab-group-name-prefix
      'face (if current-p 'tab-bar-tab-group-current
'tab-bar-tab-group-inactive))
     (tab-bar-tab-group-format-default tab i current-p))))

On Mon, Jul 29, 2024 at 2:28 PM Juri Linkov <juri <at> linkov.net> wrote:

> close 71939 31.0.50
> thanks
>
> >> I'd like to propose that `tab-bar' allow optionally showing tabs for
> >> inactive groups when `tab-bar-format-tabs-groups' is in force rather
> than
> >> the always-on policy of collapsing inactive groups.
> >>
> >> The proposed custom variable `tab-bar-show-inactive-group-tabs' is
> backward
> >> compatible for existing users and has no visible changes for people who
> do
> >> not set it to t. I will occasionally set the value locally to alter
> frame
> >> by frame behavior. I've also used a key binding to toggle the behavior
> to
> >> nice effect.
> >>
> >> I've been using these changes (via advice :override) under Emacs 29.3.
> >
> > Thanks for the suggestion.  I'll try to adapt this for Emacs 31.
>
> I adapted this for Emacs 31 and pushed to master.
> Thanks for this feature.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71939; Package emacs. (Mon, 05 Aug 2024 07:00:02 GMT) Full text and rfc822 format available.

Message #19 received at 71939 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Ship Mints <shipmints <at> gmail.com>
Cc: 71939 <at> debbugs.gnu.org
Subject: Re: bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature
 request
Date: Mon, 05 Aug 2024 09:56:54 +0300
> Thank you. In my config, I've also implemented "(setq
> tab-bar-inhibit-inactive-group-tab-hints t)" which suppresses tab hints on
> group tabs when inactive groups are being displayed as they are generally
> superfluous in that case. We could make suppressing tab hints on group tabs
> when inactive groups are being displayed as the only behavior which is also
> fine by me.

Thanks for the suggestion.  Now hints are not displayed for inactive groups
unconditionally.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 02 Sep 2024 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 85 days ago.

Previous Next


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