GNU bug report logs - #60073
30.0.50; [PATCH] Tab bar group format not applied to current

Previous Next

Package: emacs;

Reported by: Gabriel <gabriel376 <at> hotmail.com>

Date: Wed, 14 Dec 2022 20:22:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 29.0.60

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 60073 in the body.
You can then email your comments to 60073 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#60073; Package emacs. (Wed, 14 Dec 2022 20:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel <gabriel376 <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 14 Dec 2022 20:22:01 GMT) Full text and rfc822 format available.

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

From: Gabriel <gabriel376 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH] Tab bar group format not applied to current
Date: Wed, 14 Dec 2022 17:16:24 -0300
[Message part 1 (text/plain, inline)]
Description:

The user option 'tab-bar-tab-group-format-function' is not applied to
current group tab, only to other group tabs.  I suspect this is not
intentional and could be fixed by the attached patch.

Steps:

1) emacs -Q (master "42c757913a4c6acc07f8904df7def6b720bb23b4")

2) Enable tab bar and create some tabs and groups:

(progn
  (tab-bar-mode 1)
  (tab-bar-change-tab-group "group1")
  (tab-new)
  (tab-bar-change-tab-group "group2")
  (tab-new)
  (tab-bar-change-tab-group "group2")
  (tab-new)
  (tab-bar-change-tab-group "group3"))

3) Set a custom function to format group tabs:

(progn
  (defun my-tab-bar-group-format (tab i)
    (format "<%s (%s)>"
        (funcall tab-bar-tab-group-function tab)
        i))
  (setopt tab-bar-format '(tab-bar-format-tabs-groups)
      tab-bar-tab-group-format-function 'my-tab-bar-group-format))

4) Change tabs a couple of times with 'C-x t o' ('tab-next')

Result: The 'tab-bar-tab-group-format-function' is not applied to format
the current group tab, only to other group tabs.  See attach patch for a
proposed fix.  If this behavior is intentional, I propose to update the
doc string.

[0001-Fix-incorrect-format-of-current-tab-bar-group.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
---
Gabriel

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60073; Package emacs. (Thu, 15 Dec 2022 15:10:01 GMT) Full text and rfc822 format available.

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

From: Gabriel <gabriel376 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#60073: 30.0.50; [PATCH] Tab bar group format not applied to
 current
Date: Thu, 15 Dec 2022 12:04:42 -0300
[Message part 1 (text/plain, inline)]
Here is a new patch that also updates the function
'tab-bar-tab-group-format-default'.  There are no breaking or functional
changes in how the tab-bar behaves today.

With this patch, the 'tab-bar-tab-group-format-function' behaves
similarly to 'tab-bar-tab-name-format-function'.

[0001-Make-tab-bar-tab-group-format-function-also-handle-c.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
---
Gabriel

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60073; Package emacs. (Thu, 15 Dec 2022 18:05:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Gabriel <gabriel376 <at> hotmail.com>
Cc: 60073 <at> debbugs.gnu.org
Subject: Re: bug#60073: 30.0.50; [PATCH] Tab bar group format not applied to
 current
Date: Thu, 15 Dec 2022 20:04:06 +0200
close 60073 29.0.60
thanks

> Here is a new patch that also updates the function
> 'tab-bar-tab-group-format-default'.

Thanks, pushed.

> There are no breaking or functional changes in how the tab-bar behaves
> today.

It's a breaking change because we can't use a new call with three
arguments to call the function that might be customized by users with
two arguments.  So I added a safety net.




bug marked as fixed in version 29.0.60, send any further explanations to 60073 <at> debbugs.gnu.org and Gabriel <gabriel376 <at> hotmail.com> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Thu, 15 Dec 2022 18:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60073; Package emacs. (Thu, 15 Dec 2022 18:07:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Gabriel <gabriel376 <at> hotmail.com>
Cc: 60073 <at> debbugs.gnu.org
Subject: Re: bug#60073: 30.0.50; [PATCH] Tab bar group format not applied to
 current
Date: Thu, 15 Dec 2022 20:05:55 +0200
> Result: The 'tab-bar-tab-group-format-function' is not applied to format
> the current group tab, only to other group tabs.  See attach patch for a
> proposed fix.  If this behavior is intentional, I propose to update the
> doc string.

Indeed, this behavior was intentional because when tab-bar-tab-hints is non-nil
then the number is already displayed on the current tab, so the group tab
doesn't duplicate the same number.

But you are right that tab-bar-tab-group-format-function should be called
even for the current tab.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Jan 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 251 days ago.

Previous Next


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