GNU logs - #71883, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 01 Jul 2024 20:43:02 +0000
Resent-Message-ID: <handler.71883.B.17198665788436 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 71883 <at> debbugs.gnu.org
Cc: Adam Porter <adam@HIDDEN>, Ship Mints <shipmints@HIDDEN>
X-Debbugs-Original-To: Emacs Bugs Mailing List <bug-gnu-emacs@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.17198665788436
          (code B ref -1); Mon, 01 Jul 2024 20:43:02 +0000
Received: (at submit) by debbugs.gnu.org; 1 Jul 2024 20:42:58 +0000
Received: from localhost ([127.0.0.1]:34791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sONrW-0002C0-4p
	for submit <at> debbugs.gnu.org; Mon, 01 Jul 2024 16:42:58 -0400
Received: from lists.gnu.org ([209.51.188.17]:40108)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1sONrU-0002Bs-HP
 for submit <at> debbugs.gnu.org; Mon, 01 Jul 2024 16:42:57 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1sONrI-00035C-Ux
 for bug-gnu-emacs@HIDDEN; Mon, 01 Jul 2024 16:42:49 -0400
Received: from out-177.mta0.migadu.com ([91.218.175.177])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1sONrE-0005k2-9T
 for bug-gnu-emacs@HIDDEN; Mon, 01 Jul 2024 16:42:43 -0400
X-Envelope-To: bug-gnu-emacs@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1719866545;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type;
 bh=Qh+yf6j4ZJ95tQFQS24m6UK4GSyh0cJqAlToxWN62Vg=;
 b=j4hK2vSaP1awuqG2//Jc/6R/MEEOQXDTDHdfvNLVzuZVj8IAMO/nLNlmG8cY8GVVpOJ66b
 nIsGO3ibjkHONMvz5rl4aeuRNq/TkIG6zF0DXLOZtftLeXC2YVnon4X7cpK33vfRgKYU7U
 TxXYXciLi/6tWSOUo1ri2Drt/HCXA/E=
X-Envelope-To: adam@HIDDEN
X-Envelope-To: shipmints@HIDDEN
X-Envelope-To: adam.porter@HIDDEN
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 01 Jul 2024 13:42:20 -0700
Message-ID: <87le2kaloz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=91.218.175.177;
 envelope-from=joseph@HIDDEN; helo=out-177.mta0.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain

The function tab-bar-auto-width determines which tabs to automatically
resize based on the face applied to each tab's text.  If the face is one
of tab-bar-auto-width-faces, then the tab gets resized.  However, if
either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
set to a function which does not apply one of tab-bar-auto-width-faces,
then the tabs which have a different face are not auto resized.

A real-world example of this issue is in activities.el:

https://github.com/alphapapa/activities.el/issues/76

In the proposed patch, instead of checking each tab's face, we check
that the symbol at the start of each tab keymap matches

(rx bos (or "current-tab" "tab-" "group-"))

Thank you!!

Joseph


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Auto-resize-based-on-keymap-symbol-not-face.patch

From 4d3f43bfeb0d13a127d161fa9c3bd1737eafe645 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 1 Jul 2024 13:34:06 -0700
Subject: [PATCH] Auto resize based on keymap symbol, not face

* lisp/tab-bar.el (tab-bar-auto-width-faces): Remove defvar.
(tab-bar-auto-width): Match against symbol-name.
---
 lisp/tab-bar.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index edec6543a82..f2034616b06 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1216,12 +1216,6 @@ tab-bar-auto-width-min
 It's not recommended to change this value since with larger values, the
 tab bar might wrap to the second line when it shouldn't.")
 
-(defvar tab-bar-auto-width-faces
-  '( tab-bar-tab tab-bar-tab-inactive
-     tab-bar-tab-ungrouped
-     tab-bar-tab-group-inactive)
-  "Resize tabs only with these faces.")
-
 (defvar tab-bar--auto-width-hash nil
   "Memoization table for `tab-bar-auto-width'.")
 
@@ -1250,8 +1244,8 @@ tab-bar-auto-width
         (width 0))    ;; resize tab names to this width
     (dolist (item items)
       (when (and (eq (nth 1 item) 'menu-item) (stringp (nth 2 item)))
-        (if (memq (get-text-property 0 'face (nth 2 item))
-                  tab-bar-auto-width-faces)
+        (if (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
+                            (symbol-name (nth 0 item)))
             (push item tabs)
           (unless (eq (nth 0 item) 'align-right)
             (setq non-tabs (concat non-tabs (nth 2 item)))))))
-- 
2.41.0


--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Joseph Turner <joseph@HIDDEN>
Subject: bug#71883: Acknowledgement ([PATCH] Fix tab-bar-auto-width with
 customized tab-bar-tab-face-function)
Message-ID: <handler.71883.B.17198665788436.ack <at> debbugs.gnu.org>
References: <87le2kaloz.fsf@HIDDEN>
X-Gnu-PR-Message: ack 71883
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 71883 <at> debbugs.gnu.org
Date: Mon, 01 Jul 2024 20:43:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 71883 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
71883: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71883
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 07:00:01 +0000
Resent-Message-ID: <handler.71883.B.171990355328007 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 71883 <at> debbugs.gnu.org
Cc: adam@HIDDEN, shipmints@HIDDEN, joseph@HIDDEN
X-Debbugs-Original-To: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
X-Debbugs-Original-Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, Ship Mints <shipmints@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.171990355328007
          (code B ref -1); Tue, 02 Jul 2024 07:00:01 +0000
Received: (at submit) by debbugs.gnu.org; 2 Jul 2024 06:59:13 +0000
Received: from localhost ([127.0.0.1]:35740 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOXTs-0007Ha-Vn
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 02:59:13 -0400
Received: from lists.gnu.org ([209.51.188.17]:38274)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sOXTr-0007HT-QN
 for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 02:59:12 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1sOXTp-0003q4-WF
 for bug-gnu-emacs@HIDDEN; Tue, 02 Jul 2024 02:59:10 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1sOXTo-0002V4-0c
 for bug-gnu-emacs@HIDDEN; Tue, 02 Jul 2024 02:59:09 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 4313020004;
 Tue,  2 Jul 2024 06:59:01 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87le2kaloz.fsf@HIDDEN> (Joseph Turner via's
 message of "Mon, 01 Jul 2024 13:42:20 -0700")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
Date: Tue, 02 Jul 2024 09:55:08 +0300
Message-ID: <861q4ce1yb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
Received-SPF: pass client-ip=217.70.183.200; envelope-from=juri@HIDDEN;
 helo=relay7-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> The function tab-bar-auto-width determines which tabs to automatically
> resize based on the face applied to each tab's text.  If the face is one
> of tab-bar-auto-width-faces, then the tab gets resized.  However, if
> either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
> set to a function which does not apply one of tab-bar-auto-width-faces,
> then the tabs which have a different face are not auto resized.
>
> A real-world example of this issue is in activities.el:
>
> https://github.com/alphapapa/activities.el/issues/76

Thanks for the request.

Maybe activities.el could add its face to tab-bar-auto-width-faces?

If not, then what about allowing tab-bar-auto-width-faces to have
the value t that means that all tabs should be resized regardless of
what faces they have.

> In the proposed patch, instead of checking each tab's face, we check
> that the symbol at the start of each tab keymap matches
>
> (rx bos (or "current-tab" "tab-" "group-"))

> -(defvar tab-bar-auto-width-faces
> -  '( tab-bar-tab tab-bar-tab-inactive
> -     tab-bar-tab-ungrouped
> -     tab-bar-tab-group-inactive)
> -  "Resize tabs only with these faces.")

Sorry, we can't remove the existing variable to not break user configs.

> @@ -1250,8 +1244,8 @@ tab-bar-auto-width
> -        (if (memq (get-text-property 0 'face (nth 2 item))
> -                  tab-bar-auto-width-faces)
> +        (if (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
> +                            (symbol-name (nth 0 item)))

Matching the symbol name with the hard-coded regexp doesn't look right.
Maybe better to add a new variable that contains a predicate function?
When it returns t then resize.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 07:00:02 +0000
Resent-Message-ID: <handler.71883.B71883.171990355528016 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 71883 <at> debbugs.gnu.org
Cc: adam@HIDDEN, shipmints@HIDDEN, joseph@HIDDEN
X-Debbugs-Original-To: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
X-Debbugs-Original-Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, Ship Mints <shipmints@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.171990355528016
          (code B ref 71883); Tue, 02 Jul 2024 07:00:02 +0000
Received: (at 71883) by debbugs.gnu.org; 2 Jul 2024 06:59:15 +0000
Received: from localhost ([127.0.0.1]:35742 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOXTv-0007Ho-BB
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 02:59:15 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:53741)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sOXTs-0007HN-M8
 for 71883 <at> debbugs.gnu.org; Tue, 02 Jul 2024 02:59:13 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 4313020004;
 Tue,  2 Jul 2024 06:59:01 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87le2kaloz.fsf@HIDDEN> (Joseph Turner via's
 message of "Mon, 01 Jul 2024 13:42:20 -0700")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
Date: Tue, 02 Jul 2024 09:55:08 +0300
Message-ID: <861q4ce1yb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> The function tab-bar-auto-width determines which tabs to automatically
> resize based on the face applied to each tab's text.  If the face is one
> of tab-bar-auto-width-faces, then the tab gets resized.  However, if
> either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
> set to a function which does not apply one of tab-bar-auto-width-faces,
> then the tabs which have a different face are not auto resized.
>
> A real-world example of this issue is in activities.el:
>
> https://github.com/alphapapa/activities.el/issues/76

Thanks for the request.

Maybe activities.el could add its face to tab-bar-auto-width-faces?

If not, then what about allowing tab-bar-auto-width-faces to have
the value t that means that all tabs should be resized regardless of
what faces they have.

> In the proposed patch, instead of checking each tab's face, we check
> that the symbol at the start of each tab keymap matches
>
> (rx bos (or "current-tab" "tab-" "group-"))

> -(defvar tab-bar-auto-width-faces
> -  '( tab-bar-tab tab-bar-tab-inactive
> -     tab-bar-tab-ungrouped
> -     tab-bar-tab-group-inactive)
> -  "Resize tabs only with these faces.")

Sorry, we can't remove the existing variable to not break user configs.

> @@ -1250,8 +1244,8 @@ tab-bar-auto-width
> -        (if (memq (get-text-property 0 'face (nth 2 item))
> -                  tab-bar-auto-width-faces)
> +        (if (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
> +                            (symbol-name (nth 0 item)))

Matching the symbol name with the hard-coded regexp doesn't look right.
Maybe better to add a new variable that contains a predicate function?
When it returns t then resize.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Ship Mints <shipmints@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 13:43:02 +0000
Resent-Message-ID: <handler.71883.B.17199277804362 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, adam@HIDDEN, joseph@HIDDEN
X-Debbugs-Original-Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.17199277804362
          (code B ref -1); Tue, 02 Jul 2024 13:43:02 +0000
Received: (at submit) by debbugs.gnu.org; 2 Jul 2024 13:43:00 +0000
Received: from localhost ([127.0.0.1]:36326 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOdmd-00018H-WE
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 09:43:00 -0400
Received: from lists.gnu.org ([209.51.188.17]:45000)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <shipmints@HIDDEN>) id 1sOdmc-000189-59
 for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 09:42:58 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <shipmints@HIDDEN>)
 id 1sOdma-0000zW-M5
 for bug-gnu-emacs@HIDDEN; Tue, 02 Jul 2024 09:42:56 -0400
Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shipmints@HIDDEN>)
 id 1sOdmY-00083r-Ir
 for bug-gnu-emacs@HIDDEN; Tue, 02 Jul 2024 09:42:56 -0400
Received: by mail-ua1-x92b.google.com with SMTP id
 a1e0cc1a2514c-80fe70b6babso1105059241.2
 for <bug-gnu-emacs@HIDDEN>; Tue, 02 Jul 2024 06:42:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1719927773; x=1720532573; darn=gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=q06fzVHI1y89C70bphPloqeY9QSyFuxJ6/xeXFnTYzU=;
 b=Oy0Ns/sQf1CE4uI8zOopq7pc+SIN4Gn5pRXU/DYm8u6ggsJTOyciKeT072g0u12I+F
 bstM1ed0Lw1sz1t1R9WJFthP9PSCRWKpBN9fdICfozbbCj5+qr/mbMmJ6tORi7P/H33v
 0kV3v3k6hOTXkYlMBrD88g3bIwnS2WqYA84jRb/8Yoli7TDqxok/RxdjX6Z9429qJaKQ
 PxPp3RhKZpJn9kBH/4WzcFkamoIPiDuaMXvwhCUVsCstwhvTdsyO1bxxayIL0MWUHVic
 /AhZpD39XXvgWsqthlJK7NbZIJlPrkUTkON0r7bfdQj98R+5XdyFrxjv+u7eSAv+Ug/D
 fpRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1719927773; x=1720532573;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=q06fzVHI1y89C70bphPloqeY9QSyFuxJ6/xeXFnTYzU=;
 b=U/2wQ5EMCzAceXbyaP9DEy3knQ9Pj/Ba0qOeaTtLqmhoOCz/aDE/Mko6KdyyoEnHvG
 g8dkAs4LS3ZOtZJBNKbnLIMNeWnb7LCHploxnCN9hw8KrguSp6tRlWbIXQ6LlnNDMzUA
 UaWCNPjO/k9b0DfpTS02a5gpe5j5Yk+CCgPPT+Tr2Z+/TVxKVgjv8o9TBAbk9cD+mXEK
 c6ahAby4VZq3NzzJDYgHPiSDRLJ2gTb96ewwsdbauSOMv13S7snPceqQCziAwlC2vZqQ
 RiYa5GPJzDwfQ4vDnbigBsDj2VUFTEgY42A2BWCkogQAYT1Yg2cOKRkvZ+gM7qBsNfoF
 9DPg==
X-Gm-Message-State: AOJu0YxuoHBQoKCSoEFFQbjDmHwu3onO/gW6jVy+ZvVjKz1F2JrosHev
 H1PR8PrNPdznSQa+/UgW37o5kcjPwFqsNZniEqwt35b5uJL1zhEjTrzzx6gUeu6ZrEBi5Vxal2N
 D0lU5Y29012V02pP5jsPKCqLMEaH8Yg==
X-Google-Smtp-Source: AGHT+IH6vfqB463j/xQe4gx6fHb1jnYOu+ulEu7IL4y9qQRLY3XJo65BDpsrhfwcssBDS4EnCUNDnCMG/AlmootZalQ=
X-Received: by 2002:a05:6122:390a:b0:4ec:ef78:d753 with SMTP id
 71dfb90a1353d-4f2a56f2803mr9711142e0c.14.1719927773073; Tue, 02 Jul 2024
 06:42:53 -0700 (PDT)
MIME-Version: 1.0
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN>
In-Reply-To: <861q4ce1yb.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Tue, 2 Jul 2024 09:42:42 -0400
Message-ID: <CAN+1HbqjbJ3hXyHjUfHMuF5YU3SVu7byka1Js-jTSB+dnb7-xw@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000f415c2061c43e304"
Received-SPF: pass client-ip=2607:f8b0:4864:20::92b;
 envelope-from=shipmints@HIDDEN; helo=mail-ua1-x92b.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--000000000000f415c2061c43e304
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I like both ideas. Supporting t seems idiomatic. `activities' could add its
face to the list, or a user in her configuration via documentation.

On Tue, Jul 2, 2024 at 2:59=E2=80=AFAM Juri Linkov <juri@HIDDEN> wrote:

> > The function tab-bar-auto-width determines which tabs to automatically
> > resize based on the face applied to each tab's text.  If the face is on=
e
> > of tab-bar-auto-width-faces, then the tab gets resized.  However, if
> > either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
> > set to a function which does not apply one of tab-bar-auto-width-faces,
> > then the tabs which have a different face are not auto resized.
> >
> > A real-world example of this issue is in activities.el:
> >
> > https://github.com/alphapapa/activities.el/issues/76
>
> Thanks for the request.
>
> Maybe activities.el could add its face to tab-bar-auto-width-faces?
>
> If not, then what about allowing tab-bar-auto-width-faces to have
> the value t that means that all tabs should be resized regardless of
> what faces they have.
>
> > In the proposed patch, instead of checking each tab's face, we check
> > that the symbol at the start of each tab keymap matches
> >
> > (rx bos (or "current-tab" "tab-" "group-"))
>
> > -(defvar tab-bar-auto-width-faces
> > -  '( tab-bar-tab tab-bar-tab-inactive
> > -     tab-bar-tab-ungrouped
> > -     tab-bar-tab-group-inactive)
> > -  "Resize tabs only with these faces.")
>
> Sorry, we can't remove the existing variable to not break user configs.
>
> > @@ -1250,8 +1244,8 @@ tab-bar-auto-width
> > -        (if (memq (get-text-property 0 'face (nth 2 item))
> > -                  tab-bar-auto-width-faces)
> > +        (if (string-match-p
> "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
> > +                            (symbol-name (nth 0 item)))
>
> Matching the symbol name with the hard-coded regexp doesn't look right.
> Maybe better to add a new variable that contains a predicate function?
> When it returns t then resize.
>

--000000000000f415c2061c43e304
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I like both ideas. Supporting t seems=C2=A0idiomatic. `act=
ivities&#39; could add its face to the list, or a user in her configuration=
 via documentation.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl=
ass=3D"gmail_attr">On Tue, Jul 2, 2024 at 2:59=E2=80=AFAM Juri Linkov &lt;<=
a href=3D"mailto:juri@HIDDEN">juri@HIDDEN</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">&gt; The function tab-bar-=
auto-width determines which tabs to automatically<br>
&gt; resize based on the face applied to each tab&#39;s text.=C2=A0 If the =
face is one<br>
&gt; of tab-bar-auto-width-faces, then the tab gets resized.=C2=A0 However,=
 if<br>
&gt; either tab-bar-tab-face-function or tab-bar-tab-group-face-function is=
<br>
&gt; set to a function which does not apply one of tab-bar-auto-width-faces=
,<br>
&gt; then the tabs which have a different face are not auto resized.<br>
&gt;<br>
&gt; A real-world example of this issue is in activities.el:<br>
&gt;<br>
&gt; <a href=3D"https://github.com/alphapapa/activities.el/issues/76" rel=
=3D"noreferrer" target=3D"_blank">https://github.com/alphapapa/activities.e=
l/issues/76</a><br>
<br>
Thanks for the request.<br>
<br>
Maybe activities.el could add its face to tab-bar-auto-width-faces?<br>
<br>
If not, then what about allowing tab-bar-auto-width-faces to have<br>
the value t that means that all tabs should be resized regardless of<br>
what faces they have.<br>
<br>
&gt; In the proposed patch, instead of checking each tab&#39;s face, we che=
ck<br>
&gt; that the symbol at the start of each tab keymap matches<br>
&gt;<br>
&gt; (rx bos (or &quot;current-tab&quot; &quot;tab-&quot; &quot;group-&quot=
;))<br>
<br>
&gt; -(defvar tab-bar-auto-width-faces<br>
&gt; -=C2=A0 &#39;( tab-bar-tab tab-bar-tab-inactive<br>
&gt; -=C2=A0 =C2=A0 =C2=A0tab-bar-tab-ungrouped<br>
&gt; -=C2=A0 =C2=A0 =C2=A0tab-bar-tab-group-inactive)<br>
&gt; -=C2=A0 &quot;Resize tabs only with these faces.&quot;)<br>
<br>
Sorry, we can&#39;t remove the existing variable to not break user configs.=
<br>
<br>
&gt; @@ -1250,8 +1244,8 @@ tab-bar-auto-width<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (memq (get-text-property 0 &#39;face =
(nth 2 item))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tab-ba=
r-auto-width-faces)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (string-match-p &quot;\\`\\(?:current=
-tab\\|\\(?:group\\|tab\\)-\\)&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (symbol-name (nth 0 item)))<br>
<br>
Matching the symbol name with the hard-coded regexp doesn&#39;t look right.=
<br>
Maybe better to add a new variable that contains a predicate function?<br>
When it returns t then resize.<br>
</blockquote></div>

--000000000000f415c2061c43e304--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Ship Mints <shipmints@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 13:45:01 +0000
Resent-Message-ID: <handler.71883.B71883.17199278424493 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, adam@HIDDEN, joseph@HIDDEN
X-Debbugs-Original-Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.17199278424493
          (code B ref 71883); Tue, 02 Jul 2024 13:45:01 +0000
Received: (at 71883) by debbugs.gnu.org; 2 Jul 2024 13:44:02 +0000
Received: from localhost ([127.0.0.1]:36330 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOdnd-0001AE-Ib
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 09:44:02 -0400
Received: from mail-vk1-f182.google.com ([209.85.221.182]:45432)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <shipmints@HIDDEN>) id 1sOdnb-00019n-TY
 for 71883 <at> debbugs.gnu.org; Tue, 02 Jul 2024 09:44:00 -0400
Received: by mail-vk1-f182.google.com with SMTP id
 71dfb90a1353d-4ef53497bc2so1385498e0c.3
 for <71883 <at> debbugs.gnu.org>; Tue, 02 Jul 2024 06:43:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1719927773; x=1720532573; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=q06fzVHI1y89C70bphPloqeY9QSyFuxJ6/xeXFnTYzU=;
 b=d0v6jbw+1N9H7pN7COcanrYb0AQcIwenvtHtypurzoAN+Z9B5PSz9mEkucwfAJAmaY
 KkxmtiF2W97NmB+u3+sUU8sk8BXr/Rmu+qRJ0BdKKLRKV7WUuqAWIffb0L6IAN+W3zQs
 tHTmFqJxjsFWX88qXmXvN92NtlhRp2h25q++uO5YsHK+cXamoM69NFInlrqTThjiErOa
 ZkFtDQkf033SY4pMgedw8nDiJa7ZbVjKOeUapbUHOOBfdQrsyKv/iUR/IqOx1IKa8Tx0
 pBHNqy1c648OuedkDQClZYwpENmG92CozyEUweM2fpnBEdPvDX1dELpN/aWMYy3x0c63
 ehMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1719927773; x=1720532573;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=q06fzVHI1y89C70bphPloqeY9QSyFuxJ6/xeXFnTYzU=;
 b=ZiTRsXO1WYPvDgnLAuTLvZgnjcddCbltGrTyzN2A4WZafyN1le6+ox1AG1mtTzVcbd
 GKRjk5UNjkT/LSSQGHWnBjAu9PSFkqkOHRoACD+JJeoHBUebZy9GUOyK3WoJ/I5HMc5g
 sevda4ECr+cwT7VHNSu5eHiOidckI5O8L7gozU/j6GDSRpN0nMc54RNmk75erXEa464D
 3cZR91sFuzKC93R2CDme1ohH3u5R53WcmXwweRy1Q7zuNY3CaRtxiWcT3vxHLiZVBFrm
 +WqXqtyYvsplZorz6tW/mtFM1sycahhlq82ID1th5PBfcqBixy9UED5SJY3DNzyHbUQp
 G6Ow==
X-Forwarded-Encrypted: i=1;
 AJvYcCWpyxdOEcp7pEqLdZV8gZspx++F6u4N7C1Q9h1aqGF6/XlvsGPDcPPa7iHT6ZR6Ait/aKUcUzEyLJ4mENTvg/uWVZI+uLI=
X-Gm-Message-State: AOJu0Yw0g43XaKi4yAEmt7N0Ps+6Ziif11YZhKFbrGdwpULa4kMPbhUH
 98AsEO4wBRlSfgLUbtIW7MV1k3CqdpCIv7POjQ1EuV363LbOLKj3mpe0kJQg4PRs8JiHYfumsyV
 eZdEWN4lrM9RydpsB4cutmXTBkfY=
X-Google-Smtp-Source: AGHT+IH6vfqB463j/xQe4gx6fHb1jnYOu+ulEu7IL4y9qQRLY3XJo65BDpsrhfwcssBDS4EnCUNDnCMG/AlmootZalQ=
X-Received: by 2002:a05:6122:390a:b0:4ec:ef78:d753 with SMTP id
 71dfb90a1353d-4f2a56f2803mr9711142e0c.14.1719927773073; Tue, 02 Jul 2024
 06:42:53 -0700 (PDT)
MIME-Version: 1.0
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN>
In-Reply-To: <861q4ce1yb.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Tue, 2 Jul 2024 09:42:42 -0400
Message-ID: <CAN+1HbqjbJ3hXyHjUfHMuF5YU3SVu7byka1Js-jTSB+dnb7-xw@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000f415c2061c43e304"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000f415c2061c43e304
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I like both ideas. Supporting t seems idiomatic. `activities' could add its
face to the list, or a user in her configuration via documentation.

On Tue, Jul 2, 2024 at 2:59=E2=80=AFAM Juri Linkov <juri@HIDDEN> wrote:

> > The function tab-bar-auto-width determines which tabs to automatically
> > resize based on the face applied to each tab's text.  If the face is on=
e
> > of tab-bar-auto-width-faces, then the tab gets resized.  However, if
> > either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
> > set to a function which does not apply one of tab-bar-auto-width-faces,
> > then the tabs which have a different face are not auto resized.
> >
> > A real-world example of this issue is in activities.el:
> >
> > https://github.com/alphapapa/activities.el/issues/76
>
> Thanks for the request.
>
> Maybe activities.el could add its face to tab-bar-auto-width-faces?
>
> If not, then what about allowing tab-bar-auto-width-faces to have
> the value t that means that all tabs should be resized regardless of
> what faces they have.
>
> > In the proposed patch, instead of checking each tab's face, we check
> > that the symbol at the start of each tab keymap matches
> >
> > (rx bos (or "current-tab" "tab-" "group-"))
>
> > -(defvar tab-bar-auto-width-faces
> > -  '( tab-bar-tab tab-bar-tab-inactive
> > -     tab-bar-tab-ungrouped
> > -     tab-bar-tab-group-inactive)
> > -  "Resize tabs only with these faces.")
>
> Sorry, we can't remove the existing variable to not break user configs.
>
> > @@ -1250,8 +1244,8 @@ tab-bar-auto-width
> > -        (if (memq (get-text-property 0 'face (nth 2 item))
> > -                  tab-bar-auto-width-faces)
> > +        (if (string-match-p
> "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
> > +                            (symbol-name (nth 0 item)))
>
> Matching the symbol name with the hard-coded regexp doesn't look right.
> Maybe better to add a new variable that contains a predicate function?
> When it returns t then resize.
>

--000000000000f415c2061c43e304
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I like both ideas. Supporting t seems=C2=A0idiomatic. `act=
ivities&#39; could add its face to the list, or a user in her configuration=
 via documentation.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl=
ass=3D"gmail_attr">On Tue, Jul 2, 2024 at 2:59=E2=80=AFAM Juri Linkov &lt;<=
a href=3D"mailto:juri@HIDDEN">juri@HIDDEN</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">&gt; The function tab-bar-=
auto-width determines which tabs to automatically<br>
&gt; resize based on the face applied to each tab&#39;s text.=C2=A0 If the =
face is one<br>
&gt; of tab-bar-auto-width-faces, then the tab gets resized.=C2=A0 However,=
 if<br>
&gt; either tab-bar-tab-face-function or tab-bar-tab-group-face-function is=
<br>
&gt; set to a function which does not apply one of tab-bar-auto-width-faces=
,<br>
&gt; then the tabs which have a different face are not auto resized.<br>
&gt;<br>
&gt; A real-world example of this issue is in activities.el:<br>
&gt;<br>
&gt; <a href=3D"https://github.com/alphapapa/activities.el/issues/76" rel=
=3D"noreferrer" target=3D"_blank">https://github.com/alphapapa/activities.e=
l/issues/76</a><br>
<br>
Thanks for the request.<br>
<br>
Maybe activities.el could add its face to tab-bar-auto-width-faces?<br>
<br>
If not, then what about allowing tab-bar-auto-width-faces to have<br>
the value t that means that all tabs should be resized regardless of<br>
what faces they have.<br>
<br>
&gt; In the proposed patch, instead of checking each tab&#39;s face, we che=
ck<br>
&gt; that the symbol at the start of each tab keymap matches<br>
&gt;<br>
&gt; (rx bos (or &quot;current-tab&quot; &quot;tab-&quot; &quot;group-&quot=
;))<br>
<br>
&gt; -(defvar tab-bar-auto-width-faces<br>
&gt; -=C2=A0 &#39;( tab-bar-tab tab-bar-tab-inactive<br>
&gt; -=C2=A0 =C2=A0 =C2=A0tab-bar-tab-ungrouped<br>
&gt; -=C2=A0 =C2=A0 =C2=A0tab-bar-tab-group-inactive)<br>
&gt; -=C2=A0 &quot;Resize tabs only with these faces.&quot;)<br>
<br>
Sorry, we can&#39;t remove the existing variable to not break user configs.=
<br>
<br>
&gt; @@ -1250,8 +1244,8 @@ tab-bar-auto-width<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (memq (get-text-property 0 &#39;face =
(nth 2 item))<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tab-ba=
r-auto-width-faces)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (string-match-p &quot;\\`\\(?:current=
-tab\\|\\(?:group\\|tab\\)-\\)&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (symbol-name (nth 0 item)))<br>
<br>
Matching the symbol name with the hard-coded regexp doesn&#39;t look right.=
<br>
Maybe better to add a new variable that contains a predicate function?<br>
When it returns t then resize.<br>
</blockquote></div>

--000000000000f415c2061c43e304--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 16:26:02 +0000
Resent-Message-ID: <handler.71883.B.171993752711415 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, adam@HIDDEN, shipmints@HIDDEN
X-Debbugs-Original-Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>, Ship Mints <shipmints@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.171993752711415
          (code B ref -1); Tue, 02 Jul 2024 16:26:02 +0000
Received: (at submit) by debbugs.gnu.org; 2 Jul 2024 16:25:27 +0000
Received: from localhost ([127.0.0.1]:37475 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOgJq-0002y2-Ug
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 12:25:27 -0400
Received: from lists.gnu.org ([209.51.188.17]:54304)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1sOgJo-0002xu-Ob
 for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 12:25:25 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1sOgJn-0006wm-7B
 for bug-gnu-emacs@HIDDEN; Tue, 02 Jul 2024 12:25:23 -0400
Received: from out-181.mta1.migadu.com ([95.215.58.181])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1sOgJj-0003P3-J1
 for bug-gnu-emacs@HIDDEN; Tue, 02 Jul 2024 12:25:22 -0400
X-Envelope-To: juri@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1719937515;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=V8xeLs/E95cyw8+Cm3E6n/zhlao88DVnrdnVnjaJeSE=;
 b=i2CB23sgFmRPe5s8KhNdBN1hUdtUUSKJO3CjM/7IRE9HqWHtsYiOn2c60Db7yt2lP5b1O4
 VMxhTzQUl8LJqY9OGFaDsvseYnGmgnd/82vFB52miJc4Gu+bfPRQiEC+NjMIx8HXZVqhhn
 prRPbhFKu0ffA5fAQdrl2MaTL8npW5A=
X-Envelope-To: bug-gnu-emacs@HIDDEN
X-Envelope-To: 71883 <at> debbugs.gnu.org
X-Envelope-To: adam@HIDDEN
X-Envelope-To: shipmints@HIDDEN
X-Envelope-To: adam.porter@HIDDEN
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <861q4ce1yb.fsf@HIDDEN> (Juri Linkov's message of "Tue, 
 02 Jul 2024 09:55:08 +0300")
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN>
Date: Tue, 02 Jul 2024 09:25:10 -0700
Message-ID: <877ce3damx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=95.215.58.181;
 envelope-from=joseph@HIDDEN; helo=out-181.mta1.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Juri Linkov <juri@HIDDEN> writes:

>> The function tab-bar-auto-width determines which tabs to automatically
>> resize based on the face applied to each tab's text.  If the face is one
>> of tab-bar-auto-width-faces, then the tab gets resized.  However, if
>> either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
>> set to a function which does not apply one of tab-bar-auto-width-faces,
>> then the tabs which have a different face are not auto resized.
>>
>> A real-world example of this issue is in activities.el:
>>
>> https://github.com/alphapapa/activities.el/issues/76
>
> Thanks for the request.
>
> Maybe activities.el could add its face to tab-bar-auto-width-faces?

Unfortunately, this isn't possible.  activities.el sets
tab-bar-tab-face-function to

(defun activities-tabs--tab-bar-tab-face-function (tab)
  "Return a face for TAB.
If TAB represents an activity, face `activities-tabs' is added as
inherited."
  ;; TODO: Propose a tab-bar equivalent of `tab-line-tab-face-functions'.
  (let ((face (funcall activities-tabs-tab-bar-tab-face-function-original tab)))
    (if (activities-tabs--tab-parameter 'activity tab)
        `(:inherit (activities-tabs ,face))
      face)))

so there's no face symbol to match against.

> If not, then what about allowing tab-bar-auto-width-faces to have
> the value t that means that all tabs should be resized regardless of
> what faces they have.

Would you be willing to send a patch with this idea?

>> In the proposed patch, instead of checking each tab's face, we check
>> that the symbol at the start of each tab keymap matches
>>
>> (rx bos (or "current-tab" "tab-" "group-"))
>
>> -(defvar tab-bar-auto-width-faces
>> -  '( tab-bar-tab tab-bar-tab-inactive
>> -     tab-bar-tab-ungrouped
>> -     tab-bar-tab-group-inactive)
>> -  "Resize tabs only with these faces.")
>
> Sorry, we can't remove the existing variable to not break user
> configs.

You're right.

>> @@ -1250,8 +1244,8 @@ tab-bar-auto-width
>> -        (if (memq (get-text-property 0 'face (nth 2 item))
>> -                  tab-bar-auto-width-faces)
>> +        (if (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
>> +                            (symbol-name (nth 0 item)))
>
> Matching the symbol name with the hard-coded regexp doesn't look right.
> Maybe better to add a new variable that contains a predicate function?
> When it returns t then resize.

What would be passed to the predicate function?

Thanks for the review!

Joseph




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 16:26:02 +0000
Resent-Message-ID: <handler.71883.B71883.171993755611470 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, adam@HIDDEN, shipmints@HIDDEN
X-Debbugs-Original-Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>, Ship Mints <shipmints@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.171993755611470
          (code B ref 71883); Tue, 02 Jul 2024 16:26:02 +0000
Received: (at 71883) by debbugs.gnu.org; 2 Jul 2024 16:25:56 +0000
Received: from localhost ([127.0.0.1]:37478 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOgKK-0002yv-DJ
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 12:25:56 -0400
Received: from out-189.mta1.migadu.com ([95.215.58.189]:57128)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1sOgKH-0002yf-TT
 for 71883 <at> debbugs.gnu.org; Tue, 02 Jul 2024 12:25:54 -0400
X-Envelope-To: juri@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1719937515;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=V8xeLs/E95cyw8+Cm3E6n/zhlao88DVnrdnVnjaJeSE=;
 b=i2CB23sgFmRPe5s8KhNdBN1hUdtUUSKJO3CjM/7IRE9HqWHtsYiOn2c60Db7yt2lP5b1O4
 VMxhTzQUl8LJqY9OGFaDsvseYnGmgnd/82vFB52miJc4Gu+bfPRQiEC+NjMIx8HXZVqhhn
 prRPbhFKu0ffA5fAQdrl2MaTL8npW5A=
X-Envelope-To: bug-gnu-emacs@HIDDEN
X-Envelope-To: 71883 <at> debbugs.gnu.org
X-Envelope-To: adam@HIDDEN
X-Envelope-To: shipmints@HIDDEN
X-Envelope-To: adam.porter@HIDDEN
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <861q4ce1yb.fsf@HIDDEN> (Juri Linkov's message of "Tue, 
 02 Jul 2024 09:55:08 +0300")
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN>
Date: Tue, 02 Jul 2024 09:25:10 -0700
Message-ID: <877ce3damx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Juri Linkov <juri@HIDDEN> writes:

>> The function tab-bar-auto-width determines which tabs to automatically
>> resize based on the face applied to each tab's text.  If the face is one
>> of tab-bar-auto-width-faces, then the tab gets resized.  However, if
>> either tab-bar-tab-face-function or tab-bar-tab-group-face-function is
>> set to a function which does not apply one of tab-bar-auto-width-faces,
>> then the tabs which have a different face are not auto resized.
>>
>> A real-world example of this issue is in activities.el:
>>
>> https://github.com/alphapapa/activities.el/issues/76
>
> Thanks for the request.
>
> Maybe activities.el could add its face to tab-bar-auto-width-faces?

Unfortunately, this isn't possible.  activities.el sets
tab-bar-tab-face-function to

(defun activities-tabs--tab-bar-tab-face-function (tab)
  "Return a face for TAB.
If TAB represents an activity, face `activities-tabs' is added as
inherited."
  ;; TODO: Propose a tab-bar equivalent of `tab-line-tab-face-functions'.
  (let ((face (funcall activities-tabs-tab-bar-tab-face-function-original tab)))
    (if (activities-tabs--tab-parameter 'activity tab)
        `(:inherit (activities-tabs ,face))
      face)))

so there's no face symbol to match against.

> If not, then what about allowing tab-bar-auto-width-faces to have
> the value t that means that all tabs should be resized regardless of
> what faces they have.

Would you be willing to send a patch with this idea?

>> In the proposed patch, instead of checking each tab's face, we check
>> that the symbol at the start of each tab keymap matches
>>
>> (rx bos (or "current-tab" "tab-" "group-"))
>
>> -(defvar tab-bar-auto-width-faces
>> -  '( tab-bar-tab tab-bar-tab-inactive
>> -     tab-bar-tab-ungrouped
>> -     tab-bar-tab-group-inactive)
>> -  "Resize tabs only with these faces.")
>
> Sorry, we can't remove the existing variable to not break user
> configs.

You're right.

>> @@ -1250,8 +1244,8 @@ tab-bar-auto-width
>> -        (if (memq (get-text-property 0 'face (nth 2 item))
>> -                  tab-bar-auto-width-faces)
>> +        (if (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
>> +                            (symbol-name (nth 0 item)))
>
> Matching the symbol name with the hard-coded regexp doesn't look right.
> Maybe better to add a new variable that contains a predicate function?
> When it returns t then resize.

What would be passed to the predicate function?

Thanks for the review!

Joseph




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 17:40:02 +0000
Resent-Message-ID: <handler.71883.B71883.171994194519448 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Joseph Turner <joseph@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, Adam Porter <adam@HIDDEN>, Ship Mints <shipmints@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.171994194519448
          (code B ref 71883); Tue, 02 Jul 2024 17:40:02 +0000
Received: (at 71883) by debbugs.gnu.org; 2 Jul 2024 17:39:05 +0000
Received: from localhost ([127.0.0.1]:37628 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOhT7-00053a-5C
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 13:39:05 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35487)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sOhT4-000532-KX
 for 71883 <at> debbugs.gnu.org; Tue, 02 Jul 2024 13:39:03 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 7AE9FE0002;
 Tue,  2 Jul 2024 17:38:50 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <877ce3damx.fsf@HIDDEN> (Joseph Turner's message of
 "Tue, 02 Jul 2024 09:25:10 -0700")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
Date: Tue, 02 Jul 2024 20:34:43 +0300
Message-ID: <86r0cb7l58.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> If not, then what about allowing tab-bar-auto-width-faces to have
>> the value t that means that all tabs should be resized regardless of
>> what faces they have.
>
> Would you be willing to send a patch with this idea?

Probably this is not needed after implementing a variable with
a predicate function, since it could be set to 'always' to return t.

Then activities.el could set this to a function that checks for a symbol.

>>> In the proposed patch, instead of checking each tab's face, we check
>>> that the symbol at the start of each tab keymap matches
>>>
>>> (rx bos (or "current-tab" "tab-" "group-"))
>>
>>> -(defvar tab-bar-auto-width-faces
>>> -  '( tab-bar-tab tab-bar-tab-inactive
>>> -     tab-bar-tab-ungrouped
>>> -     tab-bar-tab-group-inactive)
>>> -  "Resize tabs only with these faces.")
>>
>> Sorry, we can't remove the existing variable to not break user
>> configs.
>
> You're right.

But we could deprecate tab-bar-auto-width-faces in Emacs 30,
and in Emacs 31 replace it with a function that matches a symbol name
like in your patch.  Then users will have time to get the function into use.

>>> @@ -1250,8 +1244,8 @@ tab-bar-auto-width
>>> -        (if (memq (get-text-property 0 'face (nth 2 item))
>>> -                  tab-bar-auto-width-faces)
>>> +        (if (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)"
>>> +                            (symbol-name (nth 0 item)))
>>
>> Matching the symbol name with the hard-coded regexp doesn't look right.
>> Maybe better to add a new variable that contains a predicate function?
>> When it returns t then resize.
>
> What would be passed to the predicate function?

I think only 'item' should be passed to the function,
there is no other useful information here.

Then in Emacs 30 this function could check for a face name
in (nth 2 item), and in Emacs 31 a symbol name in (nth 0 item).

But only if a symbol name covers all cases currently supported
by the face name.  Let's see with the face->symbol mapping:

  tab-bar-tab -> current-tab
  tab-bar-tab-inactive -> tab-N
  tab-bar-tab-ungrouped -> tab-N, unfortunately there is no separate symbol
  tab-bar-tab-group-inactive -> group-N
  tab-bar-tab-group-current -> there is no current-group, but this could be added:

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index edec6543a82..66fb9490ce8 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1044,7 +1044,7 @@ tab-bar--format-tab-group
 when the tab is current.  Return the result as a keymap."
   (append
    `((,(intern (format "sep-%i" i)) menu-item ,(tab-bar-separator) ignore))
-   `((,(intern (format "group-%i" i))
+   `((,(intern (if current-p "current-group" (format "group-%i" i)))
       menu-item
       ,(if current-p
            (condition-case nil




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Adam Porter <adam@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 02 Jul 2024 23:11:01 +0000
Resent-Message-ID: <handler.71883.B71883.171996181721622 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, Ship Mints <shipmints@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.171996181721622
          (code B ref 71883); Tue, 02 Jul 2024 23:11:01 +0000
Received: (at 71883) by debbugs.gnu.org; 2 Jul 2024 23:10:17 +0000
Received: from localhost ([127.0.0.1]:38080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOmdc-0005ce-Tt
	for submit <at> debbugs.gnu.org; Tue, 02 Jul 2024 19:10:17 -0400
Received: from duck.cedar.relay.mailchannels.net ([23.83.210.52]:63561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1sOmdZ-0005cQ-VC
 for 71883 <at> debbugs.gnu.org; Tue, 02 Jul 2024 19:10:16 -0400
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id D49C1903DFA;
 Tue,  2 Jul 2024 23:10:09 +0000 (UTC)
Received: from pdx1-sub0-mail-a303.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 7511C904137;
 Tue,  2 Jul 2024 23:10:09 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1719961809; a=rsa-sha256;
 cv=none;
 b=IMB9512rzuahpj/z6jmBAfyFkSl6BnzwLYKqlFfIsRMgHf8Pvvi44r0HPNYt23i1V+xhMH
 n/GM52G2f1BRL73Y1K/qPsaP9BY8GoYxSXAw4wFz7FJQXnDq549AfYBiLeeDhhnhXr0SC9
 2pVi570Vz0Ia1KvDtEFhQThc1NUsWnst4FphseDGSF4X50kapwJeDneFe+Nx4M+8QaU6OQ
 I0wccgUOj1eKQPvWkgH/UdXHWiGnCGejKcpgbgf9qu1QtarnAAUxRVj+upFPweEyvTm9iC
 Har7crMxBs/N/fb/CEsuhl58UbyY5nW5FSNK/ZinNBW9USDq+YFRREtZvuqpMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1719961809;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=27toR5nxTBNca/2uEV6bPNO0kpEZBOWTJNbrYZPDhq4=;
 b=bzI1L54zLg4RKrSSskuFh0shgxEdNVH4MAD1oRsdmXGz2t51qzJVfrdoe8lzefbvTJC9ZG
 hD0JIhEoBay56wkFhJSdCdu2aSVgrtbQc9kAGTxt/sw3fk7Zgz8xSNpHxla69TlrcmpxlR
 OUwdYJRjv7LX2K44t/JuRh+qjRph4eQJ+7UAFJu8JxwJsI5WAQuVoT5/SGiZUB89DHlnQJ
 KRCdnDXkMp4xv3ocZzXemvua/wfjNW7DP0r7UfrXQEEJqB4sQDfGstL/EGPjUBoQTcduUk
 adpazChJMoAneuz466dz73LwCrD2KBVogHMFAVGCMhNJ6cd2azRE8iTcTlJi+g==
ARC-Authentication-Results: i=1; rspamd-79677bdb95-8df25;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
X-MC-Relay: Junk
X-MailChannels-SenderId: dreamhost|x-authsender|adam@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-White-Shrill: 05c5353e3e7f3f47_1719961809724_3014323374
X-MC-Loop-Signature: 1719961809724:565619715
X-MC-Ingress-Time: 1719961809724
Received: from pdx1-sub0-mail-a303.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.107.111.134 (trex/6.9.2); Tue, 02 Jul 2024 23:10:09 +0000
Received: from [10.43.22.157] (unknown [193.56.116.15])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: adam@HIDDEN)
 by pdx1-sub0-mail-a303.dreamhost.com (Postfix) with ESMTPSA id 4WDJXc5d9fzB8; 
 Tue,  2 Jul 2024 16:10:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1719961809;
 bh=27toR5nxTBNca/2uEV6bPNO0kpEZBOWTJNbrYZPDhq4=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=wLqydcDgP8gK2U3o7p/+FPxuQLnqYMUffXhadctwM+w1nyn8dt0ey9QxibyeNg6BH
 +9W1652c3y/xP9Qgj8pAOwlBUOH0Sf61MrP3kMDOtcAzEq80bFv5djY7ZRCbbW5Sn0
 lFvEPWljooRsCtI6ExfJ/3ooqhu0eDSm5OgnOkgy715BckQSVVXqmVR9itVV2wzXzb
 yknmlBJK260jvhQic9pmxjIM1OWA1c92YJjfXHeu8GhKTVAz21KjwuvwPGNgoqRtjh
 T7dnw8LUhLevdY0OzPDTEQ2nO9uECnXvuCC4Pf+2f/2I3rqTfled9XxgQu9jug8IR+
 FP4CW5FLM0Dcg==
Message-ID: <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
Date: Tue, 2 Jul 2024 18:10:07 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
Content-Language: en-US
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <86r0cb7l58.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Thanks to all for working on this.

On 7/2/24 12:34, Juri Linkov wrote:
> Probably this is not needed after implementing a variable with
> a predicate function, since it could be set to 'always' to return t.
> 
> Then activities.el could set this to a function that checks for a symbol.

If it seems appropriate, I'd suggest using a list of predicate 
functions, which could be used with `run-hook-with-args-until-success'. 
That way there wouldn't be any contention with other libraries which 
also wanted to set that function.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 03 Jul 2024 06:32:02 +0000
Resent-Message-ID: <handler.71883.B71883.17199883082426 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Adam Porter <adam@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, Ship Mints <shipmints@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.17199883082426
          (code B ref 71883); Wed, 03 Jul 2024 06:32:02 +0000
Received: (at 71883) by debbugs.gnu.org; 3 Jul 2024 06:31:48 +0000
Received: from localhost ([127.0.0.1]:38446 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sOtWt-0000d3-Ty
	for submit <at> debbugs.gnu.org; Wed, 03 Jul 2024 02:31:48 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:58261)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sOtWs-0000cn-8p
 for 71883 <at> debbugs.gnu.org; Wed, 03 Jul 2024 02:31:46 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 1D24B40004;
 Wed,  3 Jul 2024 06:31:15 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN> (Adam
 Porter's message of "Tue, 2 Jul 2024 18:10:07 -0500")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
Date: Wed, 03 Jul 2024 09:27:17 +0300
Message-ID: <86msmzc7ne.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Probably this is not needed after implementing a variable with
>> a predicate function, since it could be set to 'always' to return t.
>> Then activities.el could set this to a function that checks for a symbol.
>
> If it seems appropriate, I'd suggest using a list of predicate functions,
> which could be used with `run-hook-with-args-until-success'. That way there
> wouldn't be any contention with other libraries which also wanted to set
> that function.

Would you agree to use add-function instead?  For example, in tab-bar.el:

  (defvar tab-bar-auto-width-predicate #'tab-bar-auto-width-faces)

Then in activities.el you could use:

  (add-function :after-while tab-bar-auto-width-predicate activities-predicate)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Adam Porter <adam@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 03 Jul 2024 19:52:02 +0000
Resent-Message-ID: <handler.71883.B71883.172003626612533 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, Ship Mints <shipmints@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172003626612533
          (code B ref 71883); Wed, 03 Jul 2024 19:52:02 +0000
Received: (at 71883) by debbugs.gnu.org; 3 Jul 2024 19:51:06 +0000
Received: from localhost ([127.0.0.1]:40621 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sP60F-0003Fd-Un
	for submit <at> debbugs.gnu.org; Wed, 03 Jul 2024 15:51:06 -0400
Received: from duck.cedar.relay.mailchannels.net ([23.83.210.52]:33433)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1sP60B-0003FN-IL
 for 71883 <at> debbugs.gnu.org; Wed, 03 Jul 2024 15:50:54 -0400
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 3FB99103289;
 Wed,  3 Jul 2024 19:50:44 +0000 (UTC)
Received: from pdx1-sub0-mail-a243.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 617AA10339B;
 Wed,  3 Jul 2024 19:50:42 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1720036243; a=rsa-sha256;
 cv=none;
 b=e95uYu3JP+A51Zx2P1mrzVtlxAMFfBVtU/ZfiuB4WETKs/m1ibEjL8ks+J/odoiwoUIRZb
 6159e/HeEBgFl+kpLzdWtLeYyVO0aFaDBGzTyRdgyXNmbDYe7zqsH2NdToRxMTlLDXHHxa
 5Qd53MfBIrqIg2ZfpEAAnnI0cir8uozgyRcIofuwQaDAorfQ9ecp/rmrwFpVz1bwuQfefV
 wiPxXDiGpaV52fWri+fmvk8a9j7pZwmoCspWUhF8nHyS1tAfANowjo9YgiK66I+gDvQbtR
 sT54GV8FQYbr//SAjg0H1r5OZ9dBsPm0qKCMyBckkuz5yxb/Rm2K+kdVRupfpA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1720036243;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=HvDrcLTT6h0zA6Z0+PdeNCpIEP7WH+WkU8U3rbZYBiM=;
 b=W7Ee02NIg1ubNxkXQeE6zAqDGwAnJvWBIn4E7dkVdXeNmDZZ69LW+Zz+A7c8klTCi1R2eQ
 1bk8zKIF+Eby85pV/K/PHSlX/tm5GftqJm0Lg+6qqx0VNPnu8XDoAUHB6l5k96xsVvOwki
 hGWX0x6X/bBXWcOrRzaXhEaJDKPLAiJDpW3kEnxdyYsoChTUavMBQaNMUEK0wQvItNe3Dx
 C4eJM84jS5LM7JNSz4NCjiIw7L0N+udE4VROzhW4Dq2o6lm1fKC6LhItwSxxIpvKD4acxG
 XPmKvfhHXUWA8h0FwtML2JcOBveyGXp9pIaH6rBhDOf2oEjgGU/BnK1x63BzVQ==
ARC-Authentication-Results: i=1; rspamd-7f76976655-9tvft;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
X-MC-Relay: Junk
X-MailChannels-SenderId: dreamhost|x-authsender|adam@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Battle-Snatch: 1863f15c698c3f99_1720036243889_4019203324
X-MC-Loop-Signature: 1720036243889:2163711867
X-MC-Ingress-Time: 1720036243888
Received: from pdx1-sub0-mail-a243.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.108.35.150 (trex/6.9.2); Wed, 03 Jul 2024 19:50:43 +0000
Received: from [10.43.51.109] (unknown [193.56.116.15])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: adam@HIDDEN)
 by pdx1-sub0-mail-a243.dreamhost.com (Postfix) with ESMTPSA id 4WDr3q0jLdzh2; 
 Wed,  3 Jul 2024 12:50:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1720036231;
 bh=HvDrcLTT6h0zA6Z0+PdeNCpIEP7WH+WkU8U3rbZYBiM=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=lA9aGNWM/aP1H6PXwxCs1E28YNcw2t5CIxRvOrPpULL4D6/vlrdXUvsJDPEDpM8qZ
 cmqqoPNx4/IC90BQ7ajdMY6wjFnBepmhfNRRDqpIUoumJNb5QDQJyBsECG4PD8eSov
 OcsjwRucLAjxonsAT+uF7yy1/c6xCqFOXxN9r+H2GXTGjqT53EOJJDhC2WMj+HEXun
 ZuJPV9wCIpzHf85ihgbMf8U953ISrIWQqWRUvmOF1px06KRllSNVIJ7U7yrAQ7o1cT
 ZSHA5xTmBxYLrlB4n84A7scITJzofZj+wQjWyu0+MkwxVFaeQz9jAc4p3OKUFjoiG5
 53Zg+xzoVPXRQ==
Message-ID: <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
Date: Wed, 3 Jul 2024 14:50:24 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
Content-Language: en-US
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <86msmzc7ne.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

On 7/3/24 01:27, Juri Linkov wrote:
>>> Probably this is not needed after implementing a variable with
>>> a predicate function, since it could be set to 'always' to return t.
>>> Then activities.el could set this to a function that checks for a symbol.
>>
>> If it seems appropriate, I'd suggest using a list of predicate functions,
>> which could be used with `run-hook-with-args-until-success'. That way there
>> wouldn't be any contention with other libraries which also wanted to set
>> that function.
> 
> Would you agree to use add-function instead?  For example, in tab-bar.el:
> 
>    (defvar tab-bar-auto-width-predicate #'tab-bar-auto-width-faces)
> 
> Then in activities.el you could use:
> 
>    (add-function :after-while tab-bar-auto-width-predicate activities-predicate)

Isn't advice generally intended for users to use in their configs, 
rather than for libraries to use?  If we have here an opportunity to 
design an API that is extensible by multiple libraries, wouldn't that be 
preferable to asking downstream libraries to apply multiple levels of 
advice and the problems that would raise?

IOW, what would the problem be with using 
`run-hook-with-args-until-success' on a list of functions?  If there is 
one, I must be missing something.  :)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 04 Jul 2024 18:06:01 +0000
Resent-Message-ID: <handler.71883.B71883.17201163143229 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Adam Porter <adam@HIDDEN>
Cc: 71883 <at> debbugs.gnu.org, Ship Mints <shipmints@HIDDEN>, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.17201163143229
          (code B ref 71883); Thu, 04 Jul 2024 18:06:01 +0000
Received: (at 71883) by debbugs.gnu.org; 4 Jul 2024 18:05:14 +0000
Received: from localhost ([127.0.0.1]:42919 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPQpW-0000q1-9O
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 14:05:14 -0400
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:39817)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sPQpU-0000po-Nb
 for 71883 <at> debbugs.gnu.org; Thu, 04 Jul 2024 14:05:13 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 60D8AC0002;
 Thu,  4 Jul 2024 18:04:42 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN> (Adam
 Porter's message of "Wed, 3 Jul 2024 14:50:24 -0500")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
Date: Thu, 04 Jul 2024 20:57:23 +0300
Message-ID: <86o77dox54.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>>> Probably this is not needed after implementing a variable with
>>>> a predicate function, since it could be set to 'always' to return t.
>>>> Then activities.el could set this to a function that checks for a symbol.
>>>
>>> If it seems appropriate, I'd suggest using a list of predicate functions,
>>> which could be used with `run-hook-with-args-until-success'. That way there
>>> wouldn't be any contention with other libraries which also wanted to set
>>> that function.
>> Would you agree to use add-function instead?  For example, in tab-bar.el:
>>    (defvar tab-bar-auto-width-predicate #'tab-bar-auto-width-faces)
>> Then in activities.el you could use:
>>    (add-function :after-while tab-bar-auto-width-predicate
>> activities-predicate)
>
> Isn't advice generally intended for users to use in their configs, rather
> than for libraries to use?  If we have here an opportunity to design an API
> that is extensible by multiple libraries, wouldn't that be preferable to
> asking downstream libraries to apply multiple levels of advice and the
> problems that would raise?
>
> IOW, what would the problem be with using
> `run-hook-with-args-until-success' on a list of functions?  If there is
> one, I must be missing something.  :)

Advice is intended for users and external libraries.
Only in core it should be avoided.

But `run-hook-with-args-until-success' is fine with me too.

Let's see what Joseph and Stephane think.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Ship Mints <shipmints@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 04 Jul 2024 21:14:02 +0000
Resent-Message-ID: <handler.71883.B71883.17201275861442 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: Adam Porter <adam@HIDDEN>, 71883 <at> debbugs.gnu.org, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.17201275861442
          (code B ref 71883); Thu, 04 Jul 2024 21:14:02 +0000
Received: (at 71883) by debbugs.gnu.org; 4 Jul 2024 21:13:06 +0000
Received: from localhost ([127.0.0.1]:43195 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPTlJ-0000NB-G4
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 17:13:05 -0400
Received: from mail-ua1-f50.google.com ([209.85.222.50]:54626)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <shipmints@HIDDEN>) id 1sPTlI-0000Mh-C0
 for 71883 <at> debbugs.gnu.org; Thu, 04 Jul 2024 17:13:05 -0400
Received: by mail-ua1-f50.google.com with SMTP id
 a1e0cc1a2514c-80b76c5de79so299493241.1
 for <71883 <at> debbugs.gnu.org>; Thu, 04 Jul 2024 14:13:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1720127516; x=1720732316; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=JY1e76MusV+avyk+KBQqwA56mn0J2p/ZoufX/bbYlSc=;
 b=W14DBR6sBa/Di/mYP1GWUNlR8iBiAeatm2kBlxn2GU3QZQV5mIMtyKQdjJmpYbjd/3
 MzJanNpdtmK8ZTf/1Qlup9nzcw8A08wXOihFlMt6OeiCpZiEz1ODHO9qsZWrAa6IPFs5
 l/zyY/GVhGubWt+LpF9nGSeFpnWeuUnjjz48kpv9APbIZJ05nvkOogIXnWouaKZBQPAs
 ajl4sD0m8fRbzn2OenCnKacHBcLaIcSHgNzBkFTtEHoPyx7moay92TPI/VetUJcj6zGO
 KgiN+KkZoG9erkX2dDz4Pb5CRqtkdufSLqCpo2y4miQXzSbsev1lJNjWV5Om9+90/apb
 favQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1720127516; x=1720732316;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=JY1e76MusV+avyk+KBQqwA56mn0J2p/ZoufX/bbYlSc=;
 b=qbEls8Ohnu7Zdb6f13p9rRdGOu6ZGjX4Xk+nb4pdn/cTMkTMXglJlf4g71VZU8h7+Q
 3FImUNQkvSF+8ZrC8+PFMZO92OxVTo1x1LpwU3D/gKB5RSwlImSapWJl4rL+Q16hah/K
 rK5xwpCLFhlir0/HdqbnrwBcYm6+GQMXq9KXVbtimD3Tu/Vy8vzII6Q+SVlMWyjY+mNe
 mv2lJa/oZ5znUGnE0IoFlyDix0yU0EwnE40l8F+Lp4eDPV/DBC3OXL2JsiFaWPwkE957
 CRtNztikG0e2WLgwPc03Xq3TJ9cmZ4BIR+wh+Nk5z3gczbKP3DqHS8oVHLZ0chFhgeUI
 bwfg==
X-Forwarded-Encrypted: i=1;
 AJvYcCXpbTx+e4ppfX1MhA3xzSzL/pxLzERsflNcJ4OyT905I5/6swfG5wELa84bdIY/9ImQ6yY8eaF+KLgBTEdTqMQuNy0dVnE=
X-Gm-Message-State: AOJu0YwLtRIPC3yxagdJVM8Lor7muSl+98yLUa+846Hvtmo3zV3++aZP
 gtLeZBXbNpfOuXjG7M5nCAyndGNlmRW51L3H3vL8Mzy8gSR02n5u1smzdaQSPYIkSywb0hoY+oI
 UFTHeukZpUYnb6H8RLevdBafnTI2bnQ==
X-Google-Smtp-Source: AGHT+IE05UMmlLRoGdNeHzIPNdr5vircn37bWPmj/XBNJ46bcs/kbQECWrXs5ZFY0LECginBBgX8Q4/xrwMB9gMf5EQ=
X-Received: by 2002:a05:6102:408:b0:48f:e4b0:81b4 with SMTP id
 ada2fe7eead31-48fee8522b0mr3142288137.7.1720127515858; Thu, 04 Jul 2024
 14:11:55 -0700 (PDT)
MIME-Version: 1.0
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN>
 <877ce3damx.fsf@HIDDEN> <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN>
In-Reply-To: <86o77dox54.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Thu, 4 Jul 2024 17:11:44 -0400
Message-ID: <CAN+1HbqrnM21EkTkLwjC+rkEB4sQSUV+vhvB4+LRdODbOGHL+w@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000008d20a6061c72656d"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000008d20a6061c72656d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Seems reasonable and thank you for soliciting my input. You're the expert
with tab-bar, I'm just a happy minor contributor. I do have
activities/tab-bar UI features I use and don't want to break. Relevant to
this particular discussion, I rely on activities-tabs face to visually
differentiate activities-controlled tabs (I put a one-pixel box around the
tab).

I do similar things for tabs under other control regimes and have
customized formatters for groups and tabs for both colors and content
(prefixes for group names, prefixes for tab names that have "project"
buffers). And lots of customization around general usage; e.g., you know
about the work I did on optionally collapsing tab group members (Emacs 31!)=
.

-S

On Thu, Jul 4, 2024 at 2:04=E2=80=AFPM Juri Linkov <juri@HIDDEN> wrote:

> >>>> Probably this is not needed after implementing a variable with
> >>>> a predicate function, since it could be set to 'always' to return t.
> >>>> Then activities.el could set this to a function that checks for a
> symbol.
> >>>
> >>> If it seems appropriate, I'd suggest using a list of predicate
> functions,
> >>> which could be used with `run-hook-with-args-until-success'. That way
> there
> >>> wouldn't be any contention with other libraries which also wanted to
> set
> >>> that function.
> >> Would you agree to use add-function instead?  For example, in
> tab-bar.el:
> >>    (defvar tab-bar-auto-width-predicate #'tab-bar-auto-width-faces)
> >> Then in activities.el you could use:
> >>    (add-function :after-while tab-bar-auto-width-predicate
> >> activities-predicate)
> >
> > Isn't advice generally intended for users to use in their configs, rath=
er
> > than for libraries to use?  If we have here an opportunity to design an
> API
> > that is extensible by multiple libraries, wouldn't that be preferable t=
o
> > asking downstream libraries to apply multiple levels of advice and the
> > problems that would raise?
> >
> > IOW, what would the problem be with using
> > `run-hook-with-args-until-success' on a list of functions?  If there is
> > one, I must be missing something.  :)
>
> Advice is intended for users and external libraries.
> Only in core it should be avoided.
>
> But `run-hook-with-args-until-success' is fine with me too.
>
> Let's see what Joseph and Stephane think.
>

--0000000000008d20a6061c72656d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Seems reasonable and thank you for soliciting my=C2=A0inpu=
t. You&#39;re the expert with tab-bar, I&#39;m just a happy minor contribut=
or. I do have activities/tab-bar UI features I use and don&#39;t want to br=
eak. Relevant to this particular discussion, I rely on activities-tabs face=
 to visually differentiate activities-controlled tabs (I put a one-pixel bo=
x around the tab).<div><br></div><div>I do similar things for tabs under ot=
her control regimes and have customized formatters for groups and tabs for =
both colors and content (prefixes for group names, prefixes for tab names t=
hat have &quot;project&quot; buffers). And lots of customization around gen=
eral usage; e.g., you know about the work I did on optionally collapsing ta=
b group members (Emacs 31!).</div><div><br></div><div>-S</div></div><br><di=
v class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 4=
, 2024 at 2:04=E2=80=AFPM Juri Linkov &lt;<a href=3D"mailto:juri@HIDDEN=
">juri@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex">&gt;&gt;&gt;&gt; Probably this is not needed after impleme=
nting a variable with<br>
&gt;&gt;&gt;&gt; a predicate function, since it could be set to &#39;always=
&#39; to return t.<br>
&gt;&gt;&gt;&gt; Then activities.el could set this to a function that check=
s for a symbol.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If it seems appropriate, I&#39;d suggest using a list of predi=
cate functions,<br>
&gt;&gt;&gt; which could be used with `run-hook-with-args-until-success&#39=
;. That way there<br>
&gt;&gt;&gt; wouldn&#39;t be any contention with other libraries which also=
 wanted to set<br>
&gt;&gt;&gt; that function.<br>
&gt;&gt; Would you agree to use add-function instead?=C2=A0 For example, in=
 tab-bar.el:<br>
&gt;&gt;=C2=A0 =C2=A0 (defvar tab-bar-auto-width-predicate #&#39;tab-bar-au=
to-width-faces)<br>
&gt;&gt; Then in activities.el you could use:<br>
&gt;&gt;=C2=A0 =C2=A0 (add-function :after-while tab-bar-auto-width-predica=
te<br>
&gt;&gt; activities-predicate)<br>
&gt;<br>
&gt; Isn&#39;t advice generally intended for users to use in their configs,=
 rather<br>
&gt; than for libraries to use?=C2=A0 If we have here an opportunity to des=
ign an API<br>
&gt; that is extensible by multiple libraries, wouldn&#39;t that be prefera=
ble to<br>
&gt; asking downstream libraries to apply multiple levels of advice and the=
<br>
&gt; problems that would raise?<br>
&gt;<br>
&gt; IOW, what would the problem be with using<br>
&gt; `run-hook-with-args-until-success&#39; on a list of functions?=C2=A0 I=
f there is<br>
&gt; one, I must be missing something.=C2=A0 :)<br>
<br>
Advice is intended for users and external libraries.<br>
Only in core it should be avoided.<br>
<br>
But `run-hook-with-args-until-success&#39; is fine with me too.<br>
<br>
Let&#39;s see what Joseph and Stephane think.<br>
</blockquote></div>

--0000000000008d20a6061c72656d--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 16 Jul 2024 21:01:02 +0000
Resent-Message-ID: <handler.71883.B71883.172116361914567 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: Adam Porter <adam@HIDDEN>, 71883 <at> debbugs.gnu.org, Ship Mints <shipmints@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172116361914567
          (code B ref 71883); Tue, 16 Jul 2024 21:01:02 +0000
Received: (at 71883) by debbugs.gnu.org; 16 Jul 2024 21:00:19 +0000
Received: from localhost ([127.0.0.1]:34505 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sTpHW-0003mt-L5
	for submit <at> debbugs.gnu.org; Tue, 16 Jul 2024 17:00:19 -0400
Received: from out-176.mta1.migadu.com ([95.215.58.176]:16065)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1sTpHT-0003mf-Pq
 for 71883 <at> debbugs.gnu.org; Tue, 16 Jul 2024 17:00:17 -0400
X-Envelope-To: juri@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1721163605;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=L8C7L4Kisd1qXinJjyCHOwhzHKdiAiPnKBMBh9Zldvs=;
 b=kdSDCC9pU1zbtWwncm2ACSMLhir9yrEg8oyWSFIJ0v9zgRVHBNmfM5icmGSgJy7e5K40f4
 LXl0Io3btTzyN2ycHvrGHmxN+DBerY1hBpVV06Q3CBGJZapj5ZZnB376lC05D6rikufHnH
 HW+C/tSVXqfg5kdQdwlJBgewhFa/YWQ=
X-Envelope-To: adam@HIDDEN
X-Envelope-To: 71883 <at> debbugs.gnu.org
X-Envelope-To: shipmints@HIDDEN
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
From: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <86o77dox54.fsf@HIDDEN> (Juri Linkov's message of "Thu, 
 04 Jul 2024 20:57:23 +0300")
Date: Mon, 15 Jul 2024 22:12:46 -0700
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN>
Message-ID: <87a5ihgii9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.9 (/)

--=-=-=
Content-Type: text/plain

Juri Linkov <juri@HIDDEN> writes:

> Let's see what Joseph and Stephane think.

Please see the attached patches, where the first three commits are
intended to be applied to the emacs-30 branch, and the final commit
removes the obsolete `tab-bar-auto-width-faces' on master.

Does this change warrant a NEWS entry?

Thanks!

Joseph


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Use-current-group-symbol-for-current-tab-group-item.patch

From 050a574bcab371ee87b1ed6c15e6431a3c2ed4d8 Mon Sep 17 00:00:00 2001
From: Juri Linkov <juri@HIDDEN>
Date: Mon, 15 Jul 2024 21:23:39 -0700
Subject: [PATCH 1/4] Use current-group symbol for current tab group item

* lisp/tab-bar.el (tab-bar--format-tab-group):
---
 lisp/tab-bar.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index edec6543a82..66fb9490ce8 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1044,7 +1044,7 @@ tab-bar--format-tab-group
 when the tab is current.  Return the result as a keymap."
   (append
    `((,(intern (format "sep-%i" i)) menu-item ,(tab-bar-separator) ignore))
-   `((,(intern (format "group-%i" i))
+   `((,(intern (if current-p "current-group" (format "group-%i" i)))
       menu-item
       ,(if current-p
            (condition-case nil
-- 
2.41.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0002-Add-abnormal-hook-to-determine-which-tabs-to-auto-wi.patch

From ca66acf2a4ded69e07a796d3feb1906072c20e6c Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 15 Jul 2024 21:55:35 -0700
Subject: [PATCH 2/4] Add abnormal hook to determine which tabs to auto-widen

* lisp/tab-bar.el (tab-bar-auto-width-predicate-default):  Default value
for tab-bar-auto-width-functions.
(tab-bar-auto-width-functions): New abnormal hook.
(tab-bar-auto-width): Run new abnormal hook until success instead of
comparing text properties on Emacs 31 or later.
---
 lisp/tab-bar.el | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 66fb9490ce8..86259f36df5 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1222,6 +1222,18 @@ tab-bar-auto-width-faces
      tab-bar-tab-group-inactive)
   "Resize tabs only with these faces.")
 
+(defun tab-bar-auto-width-predicate-default (item)
+  "Accepts tab ITEM and returns non-nil for tabs and tab groups."
+  (string-match-p
+   ;; (rx bos (or "current-tab" "current-group" "tab-" "group-"))
+   "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)"
+   (symbol-name (nth 0 item))))
+
+(defvar tab-bar-auto-width-functions '(tab-bar-auto-width-predicate-default)
+  "List of functions for `tab-bar-auto-width' to call with a tab ITEM.
+If any of these functions returns non-nil for a given tab ITEM, that
+tab's width will be auto-sized.")
+
 (defvar tab-bar--auto-width-hash nil
   "Memoization table for `tab-bar-auto-width'.")
 
@@ -1250,8 +1262,10 @@ tab-bar-auto-width
         (width 0))    ;; resize tab names to this width
     (dolist (item items)
       (when (and (eq (nth 1 item) 'menu-item) (stringp (nth 2 item)))
-        (if (memq (get-text-property 0 'face (nth 2 item))
-                  tab-bar-auto-width-faces)
+        (if (if (version<= "31" emacs-version)
+                (run-hook-with-args-until-success 'tab-bar-auto-width-functions item)
+              (memq (get-text-property 0 'face (nth 2 item))
+                    tab-bar-auto-width-faces))
             (push item tabs)
           (unless (eq (nth 0 item) 'align-right)
             (setq non-tabs (concat non-tabs (nth 2 item)))))))
-- 
2.41.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0003-Mark-tab-bar-auto-width-faces-obsolete.patch

From 89c7c43219569df5d78a3677aeff7f5e20d83330 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 15 Jul 2024 22:05:40 -0700
Subject: [PATCH 3/4] Mark tab-bar-auto-width-faces obsolete

* lisp/tab-bar.el: (tab-bar-auto-width-faces) Obsolete on >=30.
---
 lisp/tab-bar.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 86259f36df5..853f487743d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1216,6 +1216,7 @@ tab-bar-auto-width-min
 It's not recommended to change this value since with larger values, the
 tab bar might wrap to the second line when it shouldn't.")
 
+(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30")
 (defvar tab-bar-auto-width-faces
   '( tab-bar-tab tab-bar-tab-inactive
      tab-bar-tab-ungrouped
-- 
2.41.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0004-Remove-obsolete-tab-bar-auto-width-faces.patch

From fa939a20ad4752bdf6d591b09ec69e14981aa714 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 15 Jul 2024 22:07:22 -0700
Subject: [PATCH 4/4] Remove obsolete tab-bar-auto-width-faces

* lisp/tab-bar.el (tab-bar-auto-width-faces):  Remove.
(tab-bar-auto-width): Only run tab-bar-auto-width-functions.
---
 lisp/tab-bar.el | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 853f487743d..57ea78414bc 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1216,13 +1216,6 @@ tab-bar-auto-width-min
 It's not recommended to change this value since with larger values, the
 tab bar might wrap to the second line when it shouldn't.")
 
-(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30")
-(defvar tab-bar-auto-width-faces
-  '( tab-bar-tab tab-bar-tab-inactive
-     tab-bar-tab-ungrouped
-     tab-bar-tab-group-inactive)
-  "Resize tabs only with these faces.")
-
 (defun tab-bar-auto-width-predicate-default (item)
   "Accepts tab ITEM and returns non-nil for tabs and tab groups."
   (string-match-p
@@ -1263,10 +1256,7 @@ tab-bar-auto-width
         (width 0))    ;; resize tab names to this width
     (dolist (item items)
       (when (and (eq (nth 1 item) 'menu-item) (stringp (nth 2 item)))
-        (if (if (version<= "31" emacs-version)
-                (run-hook-with-args-until-success 'tab-bar-auto-width-functions item)
-              (memq (get-text-property 0 'face (nth 2 item))
-                    tab-bar-auto-width-faces))
+        (if (run-hook-with-args-until-success 'tab-bar-auto-width-functions item)
             (push item tabs)
           (unless (eq (nth 0 item) 'align-right)
             (setq non-tabs (concat non-tabs (nth 2 item)))))))
-- 
2.41.0


--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 17 Jul 2024 11:22:02 +0000
Resent-Message-ID: <handler.71883.B71883.172121528813780 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Joseph Turner <joseph@HIDDEN>
Cc: adam@HIDDEN, 71883 <at> debbugs.gnu.org, shipmints@HIDDEN, juri@HIDDEN
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172121528813780
          (code B ref 71883); Wed, 17 Jul 2024 11:22:02 +0000
Received: (at 71883) by debbugs.gnu.org; 17 Jul 2024 11:21:28 +0000
Received: from localhost ([127.0.0.1]:35160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sU2it-0003aB-TL
	for submit <at> debbugs.gnu.org; Wed, 17 Jul 2024 07:21:28 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54050)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sU2io-0003Zx-Of
 for 71883 <at> debbugs.gnu.org; Wed, 17 Jul 2024 07:21:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sU2gX-0005fF-Ri; Wed, 17 Jul 2024 07:19:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=unqCKAXt2jlTfxP/rrHcfQjMdUbLXskhmd2XAq5pA6o=; b=gJP65DcZf3Hi
 l7nZeSCBPX+MTE6ml8McRBQyNwyt5pfukc1AYs2Ni0vp2nZfDvuOmnT3JDBE0w/5pxn/IhxuegVLT
 QCtfwhqchfuN802ElOUgR+jt5dD8pXlnH/faxoxtrxZnaFx/ANblljHrbGY3U/RaBh76fj+xLFwAu
 A0v3bp+uUp53lkgg+9n8NdRvqYAk0FCD0bwxMrewafxilByfrk1+P2Rn7Li5srYOjo94yd5C+aolQ
 CjAdWP4LFNR1mgRr3O1MROCBcY8T4PBimrzKP3vVvtbFAE+k5Fs2lBfc5y/s24JfqgGtAIkxKqj6z
 vF9eio5ANDTZ7x9/xVfjow==;
Date: Wed, 17 Jul 2024 14:18:52 +0300
Message-Id: <86jzhkgtb7.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87a5ihgii9.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN> <87a5ihgii9.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Adam Porter <adam@HIDDEN>, 71883 <at> debbugs.gnu.org,
>  Ship Mints <shipmints@HIDDEN>
> Date: Mon, 15 Jul 2024 22:12:46 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Juri Linkov <juri@HIDDEN> writes:
> 
> > Let's see what Joseph and Stephane think.
> 
> Please see the attached patches, where the first three commits are
> intended to be applied to the emacs-30 branch, and the final commit
> removes the obsolete `tab-bar-auto-width-faces' on master.

I'm not sure I understand why they need to be installed on emacs-30.
Is this a regression in Emacs 29 or Emacs 30?  What bad things will
happen if we install the changes on master instead>

> Does this change warrant a NEWS entry?

Yes, since you are adding a hook variable.  Obsolescence of a variable
also requires a NEWS entry.

> From: Joseph Turner <joseph@HIDDEN>
> Date: Mon, 15 Jul 2024 22:07:22 -0700
> Subject: [PATCH 4/4] Remove obsolete tab-bar-auto-width-faces
> 
> * lisp/tab-bar.el (tab-bar-auto-width-faces):  Remove.
> (tab-bar-auto-width): Only run tab-bar-auto-width-functions.

We don't usually remove a variable one major release after it has been
obsoleted.  It's too soon.

Thanks.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 19 Jul 2024 15:19:01 +0000
Resent-Message-ID: <handler.71883.B71883.17214023084617 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: adam@HIDDEN, 71883 <at> debbugs.gnu.org, shipmints@HIDDEN, Joseph Turner <joseph@HIDDEN>
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.17214023084617
          (code B ref 71883); Fri, 19 Jul 2024 15:19:01 +0000
Received: (at 71883) by debbugs.gnu.org; 19 Jul 2024 15:18:28 +0000
Received: from localhost ([127.0.0.1]:50197 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sUpNM-0001CO-Br
	for submit <at> debbugs.gnu.org; Fri, 19 Jul 2024 11:18:28 -0400
Received: from mslow1.mail.gandi.net ([217.70.178.240]:33967)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sUpNK-0001CE-0t
 for 71883 <at> debbugs.gnu.org; Fri, 19 Jul 2024 11:18:26 -0400
Received: from relay9-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::229])
 by mslow1.mail.gandi.net (Postfix) with ESMTP id 74071C2C28
 for <71883 <at> debbugs.gnu.org>; Fri, 19 Jul 2024 06:56:02 +0000 (UTC)
Received: by mail.gandi.net (Postfix) with ESMTPSA id E2098FF802;
 Fri, 19 Jul 2024 06:55:55 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <86jzhkgtb7.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 17 Jul
 2024 14:18:52 +0300")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN> <87a5ihgii9.fsf@HIDDEN>
 <86jzhkgtb7.fsf@HIDDEN>
Date: Fri, 19 Jul 2024 09:42:41 +0300
Message-ID: <865xt1lw66.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Please see the attached patches, where the first three commits are
>> intended to be applied to the emacs-30 branch, and the final commit
>> removes the obsolete `tab-bar-auto-width-faces' on master.

Thanks for the patches, although I agree with Eli that the changes
on emacs-30 should be minimal.

> I'm not sure I understand why they need to be installed on emacs-30.
> Is this a regression in Emacs 29 or Emacs 30?  What bad things will
> happen if we install the changes on master instead>

Replacing hard-coded logic with customizable variable
for external packages like activities.el is needed
as soon as possible on emacs-30 because hard-coded logic
hinders the use of packages.

However, there is no hurry to change the default behavior
to match a symbol name instead of checking face names.
Therefore I think better to move the existing code

  (memq (get-text-property 0 'face (nth 2 item)) tab-bar-auto-width-faces)

to the new predicate function on emacs-30.  Then activities.el
can change it to another function that matches a symbol.

Then on master the default body on the new predicate
could be replaced from checking the face to match a symbol.
Also changes in tab-bar--format-tab-group should be on master as well.

>> Does this change warrant a NEWS entry?
>
> Yes, since you are adding a hook variable.  Obsolescence of a variable
> also requires a NEWS entry.

Then addition of tab-bar-auto-width-functions requires a NEWS entry on emacs-30.
And obsolescence of tab-bar-auto-width-faces requires a NEWS entry on master.

>> * lisp/tab-bar.el (tab-bar-auto-width-faces):  Remove.
>> (tab-bar-auto-width): Only run tab-bar-auto-width-functions.
>
> We don't usually remove a variable one major release after it has been
> obsoleted.  It's too soon.

Indeed, it could be obsoleted on master.
This will provide a minimal set of changes on emacs-30.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 25 Jul 2024 18:12:02 +0000
Resent-Message-ID: <handler.71883.B71883.172193108612138 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: adam@HIDDEN, 71883 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, shipmints@HIDDEN
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172193108612138
          (code B ref 71883); Thu, 25 Jul 2024 18:12:02 +0000
Received: (at 71883) by debbugs.gnu.org; 25 Jul 2024 18:11:26 +0000
Received: from localhost ([127.0.0.1]:37732 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sX2w1-00039g-Gr
	for submit <at> debbugs.gnu.org; Thu, 25 Jul 2024 14:11:26 -0400
Received: from out-180.mta0.migadu.com ([91.218.175.180]:53708)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1sX2vy-00039M-QJ
 for 71883 <at> debbugs.gnu.org; Thu, 25 Jul 2024 14:11:23 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1721931066;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=In/odr5Si9AYIzXF2UV+4B9Lty/pURJxo6cTA8XQZQg=;
 b=Z/cDTyZKHK5NkM3jhz8S9P49lf+imPKtEsGloxHzD5Kn9Cyai3AWZh4J5xnTPMGmy/2d9V
 f4Mgf3c4xQ3PH6yYXEAxKIGycQZiCRI1tocd0kRI40mATZhTP/R9AiRcTij7ee+6YGmMVP
 BFL8Sj8cv2j0rZxVlpNY03y5IASk7PE=
From: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <865xt1lw66.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 19 Jul 2024 09:42:41 +0300")
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN> <87a5ihgii9.fsf@HIDDEN>
 <86jzhkgtb7.fsf@HIDDEN> <865xt1lw66.fsf@HIDDEN>
Date: Thu, 25 Jul 2024 11:11:01 -0700
Message-ID: <87ikwttk96.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Juri Linkov <juri@HIDDEN> writes:

>> I'm not sure I understand why they need to be installed on emacs-30.
>> Is this a regression in Emacs 29 or Emacs 30?  What bad things will
>> happen if we install the changes on master instead>

No regression.

> Replacing hard-coded logic with customizable variable
> for external packages like activities.el is needed
> as soon as possible on emacs-30 because hard-coded logic
> hinders the use of packages.
>
> However, there is no hurry to change the default behavior
> to match a symbol name instead of checking face names.
> Therefore I think better to move the existing code
>
>   (memq (get-text-property 0 'face (nth 2 item)) tab-bar-auto-width-faces)
>
> to the new predicate function on emacs-30.  Then activities.el
> can change it to another function that matches a symbol.
>
> Then on master the default body on the new predicate
> could be replaced from checking the face to match a symbol.
> Also changes in tab-bar--format-tab-group should be on master as well.

Much as I'd like to use these changes asap, I think this patchset should
go entirely on master.  I see these changes as adding functionality
(making tab-bar tabs more extensible) rather than bug fixes.

>>> Does this change warrant a NEWS entry?
>>
>> Yes, since you are adding a hook variable.  Obsolescence of a variable
>> also requires a NEWS entry.

Please see attached patches.

Thanks!

Joseph


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Use-current-group-symbol-for-current-tab-group-item.patch

From 050a574bcab371ee87b1ed6c15e6431a3c2ed4d8 Mon Sep 17 00:00:00 2001
From: Juri Linkov <juri@HIDDEN>
Date: Mon, 15 Jul 2024 21:23:39 -0700
Subject: [PATCH 1/4] Use current-group symbol for current tab group item

* lisp/tab-bar.el (tab-bar--format-tab-group):
---
 lisp/tab-bar.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index edec6543a82..66fb9490ce8 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1044,7 +1044,7 @@ tab-bar--format-tab-group
 when the tab is current.  Return the result as a keymap."
   (append
    `((,(intern (format "sep-%i" i)) menu-item ,(tab-bar-separator) ignore))
-   `((,(intern (format "group-%i" i))
+   `((,(intern (if current-p "current-group" (format "group-%i" i)))
       menu-item
       ,(if current-p
            (condition-case nil
-- 
2.41.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0002-Add-abnormal-hook-to-determine-which-tabs-to-auto-wi.patch

From f85b67595b91f90fdd96231d18b73edcf96c30be Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 15 Jul 2024 21:55:35 -0700
Subject: [PATCH 2/4] Add abnormal hook to determine which tabs to auto-widen

* lisp/tab-bar.el (tab-bar-auto-width-predicate-default):  Default value
for tab-bar-auto-width-functions.
(tab-bar-auto-width-functions): New abnormal hook.
(tab-bar-auto-width): Run new abnormal hook until success instead of
comparing text properties.
---
 lisp/tab-bar.el | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 66fb9490ce8..9ad59339aa1 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1222,6 +1222,18 @@ tab-bar-auto-width-faces
      tab-bar-tab-group-inactive)
   "Resize tabs only with these faces.")
 
+(defun tab-bar-auto-width-predicate-default (item)
+  "Accepts tab ITEM and returns non-nil for tabs and tab groups."
+  (string-match-p
+   ;; (rx bos (or "current-tab" "current-group" "tab-" "group-"))
+   "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)"
+   (symbol-name (nth 0 item))))
+
+(defvar tab-bar-auto-width-functions '(tab-bar-auto-width-predicate-default)
+  "List of functions for `tab-bar-auto-width' to call with a tab ITEM.
+If any of these functions returns non-nil for a given tab ITEM, that
+tab's width will be auto-sized.")
+
 (defvar tab-bar--auto-width-hash nil
   "Memoization table for `tab-bar-auto-width'.")
 
@@ -1250,8 +1262,7 @@ tab-bar-auto-width
         (width 0))    ;; resize tab names to this width
     (dolist (item items)
       (when (and (eq (nth 1 item) 'menu-item) (stringp (nth 2 item)))
-        (if (memq (get-text-property 0 'face (nth 2 item))
-                  tab-bar-auto-width-faces)
+        (if (run-hook-with-args-until-success 'tab-bar-auto-width-functions item)
             (push item tabs)
           (unless (eq (nth 0 item) 'align-right)
             (setq non-tabs (concat non-tabs (nth 2 item)))))))
-- 
2.41.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0003-Mark-tab-bar-auto-width-faces-obsolete.patch

From f4419f46ab96476537fe377baf5950bb8ef22b83 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Mon, 15 Jul 2024 22:05:40 -0700
Subject: [PATCH 3/4] Mark tab-bar-auto-width-faces obsolete

* lisp/tab-bar.el: (tab-bar-auto-width-faces) Obsolete on >=30.
---
 lisp/tab-bar.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 9ad59339aa1..503df82539d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1216,6 +1216,7 @@ tab-bar-auto-width-min
 It's not recommended to change this value since with larger values, the
 tab bar might wrap to the second line when it shouldn't.")
 
+(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30")
 (defvar tab-bar-auto-width-faces
   '( tab-bar-tab tab-bar-tab-inactive
      tab-bar-tab-ungrouped
-- 
2.41.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0004-etc-NEWS-Announce-tab-bar-auto-width-functions.patch

From 1d677b03e1ebb38b8287adf1a6cc4fe5ab4712b2 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@HIDDEN>
Date: Thu, 25 Jul 2024 10:58:38 -0700
Subject: [PATCH 4/4] ; * etc/NEWS: Announce tab-bar-auto-width-functions

---
 etc/NEWS | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 5c08bc7550f..300b79c50b2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -30,6 +30,14 @@ applies, and please also update docstrings as needed.
 
 * Changes in Emacs 31.1
 
+** Tab Bars and Tab Lines
+
+*** New abnormal hook 'tab-bar-auto-width-functions'.  This hook
+allows you to control which tab-bar tabs are automatically resized.
+
+*** The 'tab-bar-auto-width-faces' variable is now obsolete.
+Use 'tab-bar-auto-width-functions' instead.
+
 
 * Editing Changes in Emacs 31.1
 
-- 
2.41.0


--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Juri Linkov <juri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 25 Jul 2024 18:24:01 +0000
Resent-Message-ID: <handler.71883.B71883.172193178313412 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Joseph Turner <joseph@HIDDEN>
Cc: adam@HIDDEN, 71883 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, shipmints@HIDDEN
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172193178313412
          (code B ref 71883); Thu, 25 Jul 2024 18:24:01 +0000
Received: (at 71883) by debbugs.gnu.org; 25 Jul 2024 18:23:03 +0000
Received: from localhost ([127.0.0.1]:37751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sX37H-0003UG-6a
	for submit <at> debbugs.gnu.org; Thu, 25 Jul 2024 14:23:03 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50837)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sX37E-0003TK-Jz
 for 71883 <at> debbugs.gnu.org; Thu, 25 Jul 2024 14:23:01 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 8D90FE0002;
 Thu, 25 Jul 2024 18:22:23 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87ikwttk96.fsf@HIDDEN> (Joseph Turner's message of
 "Thu, 25 Jul 2024 11:11:01 -0700")
Organization: LINKOV.NET
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN> <87a5ihgii9.fsf@HIDDEN>
 <86jzhkgtb7.fsf@HIDDEN> <865xt1lw66.fsf@HIDDEN>
 <87ikwttk96.fsf@HIDDEN>
Date: Thu, 25 Jul 2024 21:18:57 +0300
Message-ID: <865xstibce.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Replacing hard-coded logic with customizable variable
>> for external packages like activities.el is needed
>> as soon as possible on emacs-30 because hard-coded logic
>> hinders the use of packages.
>>
>> However, there is no hurry to change the default behavior
>> to match a symbol name instead of checking face names.
>> Therefore I think better to move the existing code
>>
>>   (memq (get-text-property 0 'face (nth 2 item)) tab-bar-auto-width-faces)
>>
>> to the new predicate function on emacs-30.  Then activities.el
>> can change it to another function that matches a symbol.
>>
>> Then on master the default body on the new predicate
>> could be replaced from checking the face to match a symbol.
>> Also changes in tab-bar--format-tab-group should be on master as well.
>
> Much as I'd like to use these changes asap, I think this patchset should
> go entirely on master.  I see these changes as adding functionality
> (making tab-bar tabs more extensible) rather than bug fixes.

Are you sure there is no hurry to make tab-bar more extensible
for activities.el?  Then let's push to master for Emacs 31.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 25 Jul 2024 18:53:01 +0000
Resent-Message-ID: <handler.71883.B71883.172193356216307 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Juri Linkov <juri@HIDDEN>
Cc: adam@HIDDEN, 71883 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, shipmints@HIDDEN
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172193356216307
          (code B ref 71883); Thu, 25 Jul 2024 18:53:01 +0000
Received: (at 71883) by debbugs.gnu.org; 25 Jul 2024 18:52:42 +0000
Received: from localhost ([127.0.0.1]:37765 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sX3Zx-0004Ew-NF
	for submit <at> debbugs.gnu.org; Thu, 25 Jul 2024 14:52:42 -0400
Received: from out-174.mta1.migadu.com ([95.215.58.174]:41564)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joseph@HIDDEN>) id 1sX3Zu-0004Ef-ST
 for 71883 <at> debbugs.gnu.org; Thu, 25 Jul 2024 14:52:40 -0400
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; 
 s=key1; t=1721933544;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=TGknkb3z0sB345NS46EqDajweFnyS2+/3E4sQghKhFE=;
 b=bOxGl/laNmyG0nHlmT7Ub4USPwtnXRbWvJzPoFqWmZ8tSB5YsUycHU8u8/02mnq3aMjnnM
 gFeeJ+21zDMfT7i2Kzn78eFnBlGqZkGgfCgxsaGgXqL1Las95LEAn9BAJ66fRmMIJzFOZb
 ZPU1WPQkmsHvr43/M8KsKhQMFnBC0SU=
From: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <865xstibce.fsf@HIDDEN> (Juri Linkov's message of "Thu, 
 25 Jul 2024 21:18:57 +0300")
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN> <87a5ihgii9.fsf@HIDDEN>
 <86jzhkgtb7.fsf@HIDDEN> <865xt1lw66.fsf@HIDDEN>
 <87ikwttk96.fsf@HIDDEN> <865xstibce.fsf@HIDDEN>
Date: Thu, 25 Jul 2024 11:52:19 -0700
Message-ID: <87a5i5fgnw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Juri Linkov <juri@HIDDEN> writes:

>>> Replacing hard-coded logic with customizable variable
>>> for external packages like activities.el is needed
>>> as soon as possible on emacs-30 because hard-coded logic
>>> hinders the use of packages.
>>>
>>> However, there is no hurry to change the default behavior
>>> to match a symbol name instead of checking face names.
>>> Therefore I think better to move the existing code
>>>
>>>   (memq (get-text-property 0 'face (nth 2 item)) tab-bar-auto-width-faces)
>>>
>>> to the new predicate function on emacs-30.  Then activities.el
>>> can change it to another function that matches a symbol.
>>>
>>> Then on master the default body on the new predicate
>>> could be replaced from checking the face to match a symbol.
>>> Also changes in tab-bar--format-tab-group should be on master as well.
>>
>> Much as I'd like to use these changes asap, I think this patchset should
>> go entirely on master.  I see these changes as adding functionality
>> (making tab-bar tabs more extensible) rather than bug fixes.
>
> Are you sure there is no hurry to make tab-bar more extensible
> for activities.el?  Then let's push to master for Emacs 31.

The effect on activities.el is purely cosmetic.  I think it's fine to
wait for 31.

Thanks for thinking it through together with me!

Joseph




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 25 Jul 2024 19:10:01 +0000
Resent-Message-ID: <handler.71883.B71883.172193456018296 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71883
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Joseph Turner <joseph@HIDDEN>
Cc: adam@HIDDEN, 71883 <at> debbugs.gnu.org, shipmints@HIDDEN, juri@HIDDEN
Received: via spool by 71883-submit <at> debbugs.gnu.org id=B71883.172193456018296
          (code B ref 71883); Thu, 25 Jul 2024 19:10:01 +0000
Received: (at 71883) by debbugs.gnu.org; 25 Jul 2024 19:09:20 +0000
Received: from localhost ([127.0.0.1]:37802 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sX3q4-0004l1-0M
	for submit <at> debbugs.gnu.org; Thu, 25 Jul 2024 15:09:20 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56456)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sX3q1-0004kl-Kn
 for 71883 <at> debbugs.gnu.org; Thu, 25 Jul 2024 15:09:18 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sX3pn-0006aH-BT; Thu, 25 Jul 2024 15:09:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=pT7lpYAtEsI/ooLYY09qkeR2JDlxMwRk2Xf76eyk1kc=; b=SpOLadf1kDKZ
 69zbv2HjCSRygReGwEIQ2gNThdVaeK9Jr+6v+6QUYfZwln+HnhFUS1jRhVkErp5GHACwUthpVtMIf
 OBDETDkDFP6HzOK1K5//v1NCDgKy9BEZhcAgAjjMicFq3mKWeTw2XNbl+I80eFKIIDD7OjOXSA/zD
 fIZHEfiCk/2pPBk8QZNQ3Cw8HUj/k2N4hk6hsatvuXyA6tZWL5UloIUF7XeE+RHFqZ8IAle3ZstjO
 NO03ppR+shBDBLg1mgKFZTcHp0jokWi2M4m20gTW9s5gnwLNEhKYSQcMmiQT5zO1ZhuT9PiRgEabw
 P9xOCHC/cZzdwjJFu3U+eQ==;
Date: Thu, 25 Jul 2024 22:09:01 +0300
Message-Id: <861q3h47ci.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87ikwttk96.fsf@HIDDEN> (message from Joseph Turner
 on Thu, 25 Jul 2024 11:11:01 -0700)
References: <87le2kaloz.fsf@HIDDEN>
 <861q4ce1yb.fsf@HIDDEN> <877ce3damx.fsf@HIDDEN>
 <86r0cb7l58.fsf@HIDDEN>
 <5aff3095-087f-493d-9251-8048b51280f9@HIDDEN>
 <86msmzc7ne.fsf@HIDDEN>
 <af1df2fc-bc57-46fd-8ea2-c48aa799a2ec@HIDDEN>
 <86o77dox54.fsf@HIDDEN> <87a5ihgii9.fsf@HIDDEN>
 <86jzhkgtb7.fsf@HIDDEN> <865xt1lw66.fsf@HIDDEN>
 <87ikwttk96.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Joseph Turner <joseph@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  adam@HIDDEN,
>   71883 <at> debbugs.gnu.org,  shipmints@HIDDEN
> Date: Thu, 25 Jul 2024 11:11:01 -0700
> 
> +** Tab Bars and Tab Lines
> +
> +*** New abnormal hook 'tab-bar-auto-width-functions'.  This hook
> +allows you to control which tab-bar tabs are automatically resized.

The first line should be a single complete sentence.





Last modified: Thu, 25 Jul 2024 19:15:01 UTC

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