From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 01 16:42:58 2024 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 ) id 1sONrW-0002C0-4p for submit@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 ) id 1sONrU-0002Bs-HP for submit@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 ) id 1sONrI-00035C-Ux for bug-gnu-emacs@gnu.org; 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 ) id 1sONrE-0005k2-9T for bug-gnu-emacs@gnu.org; Mon, 01 Jul 2024 16:42:43 -0400 X-Envelope-To: bug-gnu-emacs@gnu.org 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@alphapapa.net X-Envelope-To: shipmints@gmail.com X-Envelope-To: adam.porter@47ap.net X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Emacs Bugs Mailing List Subject: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function Date: Mon, 01 Jul 2024 13:42:20 -0700 Message-ID: <87le2kaloz.fsf@breatheoutbreathe.in> 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@breatheoutbreathe.in; 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-Debbugs-Envelope-To: submit Cc: Adam Porter , Ship Mints X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 02 02:59:13 2024 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 ) id 1sOXTs-0007Ha-Vn for submit@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 ) id 1sOXTr-0007HT-QN for submit@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 ) id 1sOXTp-0003q4-WF for bug-gnu-emacs@gnu.org; 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 ) id 1sOXTo-0002V4-0c for bug-gnu-emacs@gnu.org; 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 To: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <87le2kaloz.fsf@breatheoutbreathe.in> (Joseph Turner via's message of "Mon, 01 Jul 2024 13:42:20 -0700") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> Date: Tue, 02 Jul 2024 09:55:08 +0300 Message-ID: <861q4ce1yb.fsf@mail.linkov.net> 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@linkov.net Received-SPF: pass client-ip=217.70.183.200; envelope-from=juri@linkov.net; 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-Debbugs-Envelope-To: submit Cc: 71883@debbugs.gnu.org, Adam Porter , Ship Mints , Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 02 09:43:00 2024 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 ) id 1sOdmd-00018H-WE for submit@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 ) id 1sOdmc-000189-59 for submit@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 ) id 1sOdma-0000zW-M5 for bug-gnu-emacs@gnu.org; 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 ) id 1sOdmY-00083r-Ir for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2024 09:42:56 -0400 Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-80fe70b6babso1105059241.2 for ; 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@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> In-Reply-To: <861q4ce1yb.fsf@mail.linkov.net> From: Ship Mints Date: Tue, 2 Jul 2024 09:42:42 -0400 Message-ID: Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function To: Juri Linkov Content-Type: multipart/alternative; boundary="000000000000f415c2061c43e304" Received-SPF: pass client-ip=2607:f8b0:4864:20::92b; envelope-from=shipmints@gmail.com; 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-Debbugs-Envelope-To: submit Cc: 71883@debbugs.gnu.org, Adam Porter , "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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
I like both ideas. Supporting t seems=C2=A0idiomatic. `act= ivities' 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 <<= a href=3D"mailto:juri@linkov.net">juri@linkov.net> wrote:
<= 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">> The function tab-bar-= auto-width determines which tabs to automatically
> resize based on the face applied to each tab's text.=C2=A0 If the = face is one
> of tab-bar-auto-width-faces, then the tab gets resized.=C2=A0 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.e= l/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 che= ck
> that the symbol at the start of each tab keymap matches
>
> (rx bos (or "current-tab" "tab-" "group-"= ;))

> -(defvar tab-bar-auto-width-faces
> -=C2=A0 '( tab-bar-tab tab-bar-tab-inactive
> -=C2=A0 =C2=A0 =C2=A0tab-bar-tab-ungrouped
> -=C2=A0 =C2=A0 =C2=A0tab-bar-tab-group-inactive)
> -=C2=A0 "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
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (memq (get-text-property 0 'face = (nth 2 item))
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tab-ba= r-auto-width-faces)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (string-match-p "\\`\\(?:current= -tab\\|\\(?:group\\|tab\\)-\\)"
> +=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)))

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-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 02 12:25:27 2024 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 ) id 1sOgJq-0002y2-Ug for submit@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 ) id 1sOgJo-0002xu-Ob for submit@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 ) id 1sOgJn-0006wm-7B for bug-gnu-emacs@gnu.org; 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 ) id 1sOgJj-0003P3-J1 for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2024 12:25:22 -0400 X-Envelope-To: juri@linkov.net 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@gnu.org X-Envelope-To: 71883@debbugs.gnu.org X-Envelope-To: adam@alphapapa.net X-Envelope-To: shipmints@gmail.com X-Envelope-To: adam.porter@47ap.net X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <861q4ce1yb.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 02 Jul 2024 09:55:08 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> Date: Tue, 02 Jul 2024 09:25:10 -0700 Message-ID: <877ce3damx.fsf@breatheoutbreathe.in> 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@breatheoutbreathe.in; 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-Debbugs-Envelope-To: submit Cc: 71883@debbugs.gnu.org, Adam Porter , "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Ship Mints X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Juri Linkov 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 02 13:39:05 2024 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 ) id 1sOhT7-00053a-5C for submit@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 ) id 1sOhT4-000532-KX for 71883@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 To: Joseph Turner Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <877ce3damx.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Tue, 02 Jul 2024 09:25:10 -0700") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> Date: Tue, 02 Jul 2024 20:34:43 +0300 Message-ID: <86r0cb7l58.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: 71883@debbugs.gnu.org, Adam Porter , Ship Mints X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 02 19:10:17 2024 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 ) id 1sOmdc-0005ce-Tt for submit@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 ) id 1sOmdZ-0005cQ-VC for 71883@debbugs.gnu.org; Tue, 02 Jul 2024 19:10:16 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net 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@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net 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@alphapapa.net) 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@alphapapa.net> Date: Tue, 2 Jul 2024 18:10:07 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function To: Juri Linkov , Joseph Turner References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> Content-Language: en-US From: Adam Porter In-Reply-To: <86r0cb7l58.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: 71883@debbugs.gnu.org, Ship Mints X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 02:31:48 2024 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 ) id 1sOtWt-0000d3-Ty for submit@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 ) id 1sOtWs-0000cn-8p for 71883@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 To: Adam Porter Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> (Adam Porter's message of "Tue, 2 Jul 2024 18:10:07 -0500") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> Date: Wed, 03 Jul 2024 09:27:17 +0300 Message-ID: <86msmzc7ne.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: 71883@debbugs.gnu.org, Ship Mints , Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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) From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 15:51:06 2024 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 ) id 1sP60F-0003Fd-Un for submit@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 ) id 1sP60B-0003FN-IL for 71883@debbugs.gnu.org; Wed, 03 Jul 2024 15:50:54 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net 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@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net 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@alphapapa.net) 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: Date: Wed, 3 Jul 2024 14:50:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function To: Juri Linkov References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> Content-Language: en-US From: Adam Porter In-Reply-To: <86msmzc7ne.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: 71883@debbugs.gnu.org, Ship Mints , Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. :) From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 04 14:05:14 2024 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 ) id 1sPQpW-0000q1-9O for submit@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 ) id 1sPQpU-0000po-Nb for 71883@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 To: Adam Porter Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: (Adam Porter's message of "Wed, 3 Jul 2024 14:50:24 -0500") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> Date: Thu, 04 Jul 2024 20:57:23 +0300 Message-ID: <86o77dox54.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: 71883@debbugs.gnu.org, Ship Mints , Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 04 17:13:06 2024 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 ) id 1sPTlJ-0000NB-G4 for submit@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 ) id 1sPTlI-0000Mh-C0 for 71883@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@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@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> In-Reply-To: <86o77dox54.fsf@mail.linkov.net> From: Ship Mints Date: Thu, 4 Jul 2024 17:11:44 -0400 Message-ID: Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function To: Juri Linkov Content-Type: multipart/alternative; boundary="0000000000008d20a6061c72656d" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71883 Cc: Adam Porter , 71883@debbugs.gnu.org, Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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
Seems reasonable and thank you for soliciting my=C2=A0inpu= t. You're the expert with tab-bar, I'm just a happy minor contribut= or. I do have activities/tab-bar UI features I use and don'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).

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 "project" 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!).

-S

On Thu, Jul 4= , 2024 at 2:04=E2=80=AFPM Juri Linkov <juri@linkov.net> wrote:
>>>> Probably this is not needed after impleme= nting 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 check= s for a symbol.
>>>
>>> If it seems appropriate, I'd suggest using a list of predi= cate 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?=C2=A0 For example, in= tab-bar.el:
>>=C2=A0 =C2=A0 (defvar tab-bar-auto-width-predicate #'tab-bar-au= to-width-faces)
>> Then in activities.el you could use:
>>=C2=A0 =C2=A0 (add-function :after-while tab-bar-auto-width-predica= te
>> activities-predicate)
>
> Isn't advice generally intended for users to use in their configs,= rather
> than for libraries to use?=C2=A0 If we have here an opportunity to des= ign an API
> that is extensible by multiple libraries, wouldn't that be prefera= ble 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?=C2=A0 I= f there is
> one, I must be missing something.=C2=A0 :)

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-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 16 17:00:19 2024 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 ) id 1sTpHW-0003mt-L5 for submit@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 ) id 1sTpHT-0003mf-Pq for 71883@debbugs.gnu.org; Tue, 16 Jul 2024 17:00:17 -0400 X-Envelope-To: juri@linkov.net 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@alphapapa.net X-Envelope-To: 71883@debbugs.gnu.org X-Envelope-To: shipmints@gmail.com X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <86o77dox54.fsf@mail.linkov.net> (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@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> Message-ID: <87a5ihgii9.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 71883 Cc: Adam Porter , 71883@debbugs.gnu.org, Ship Mints X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) --=-=-= Content-Type: text/plain Juri Linkov 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 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 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 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 17 07:21:28 2024 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 ) id 1sU2it-0003aB-TL for submit@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 ) id 1sU2io-0003Zx-Of for 71883@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 ) 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@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <87a5ihgii9.fsf@breatheoutbreathe.in> (bug-gnu-emacs@gnu.org) Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, shipmints@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Adam Porter , 71883@debbugs.gnu.org, > Ship Mints > 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" > > Juri Linkov 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 > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 19 11:18:28 2024 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 ) id 1sUpNM-0001CO-Br for submit@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 ) id 1sUpNK-0001CE-0t for 71883@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@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 To: Eli Zaretskii Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <86jzhkgtb7.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 17 Jul 2024 14:18:52 +0300") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> Date: Fri, 19 Jul 2024 09:42:41 +0300 Message-ID: <865xt1lw66.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, shipmints@gmail.com, Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 25 14:11:26 2024 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 ) id 1sX2w1-00039g-Gr for submit@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 ) id 1sX2vy-00039M-QJ for 71883@debbugs.gnu.org; Thu, 25 Jul 2024 14:11:23 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com 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 To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <865xt1lw66.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 19 Jul 2024 09:42:41 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> Date: Thu, 25 Jul 2024 11:11:01 -0700 Message-ID: <87ikwttk96.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Juri Linkov 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 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 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 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 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 25 14:23:03 2024 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 ) id 1sX37H-0003UG-6a for submit@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 ) id 1sX37E-0003TK-Jz for 71883@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 To: Joseph Turner Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <87ikwttk96.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Thu, 25 Jul 2024 11:11:01 -0700") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> Date: Thu, 25 Jul 2024 21:18:57 +0300 Message-ID: <865xstibce.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 25 14:52:42 2024 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 ) id 1sX3Zx-0004Ew-NF for submit@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 ) id 1sX3Zu-0004Ef-ST for 71883@debbugs.gnu.org; Thu, 25 Jul 2024 14:52:40 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com 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 To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <865xstibce.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 25 Jul 2024 21:18:57 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <865xstibce.fsf@mail.linkov.net> Date: Thu, 25 Jul 2024 11:52:19 -0700 Message-ID: <87a5i5fgnw.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 25 15:09:20 2024 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 ) id 1sX3q4-0004l1-0M for submit@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 ) id 1sX3q1-0004kl-Kn for 71883@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 ) 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@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <87ikwttk96.fsf@breatheoutbreathe.in> (message from Joseph Turner on Thu, 25 Jul 2024 11:11:01 -0700) Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, shipmints@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Joseph Turner > Cc: Eli Zaretskii , adam@alphapapa.net, > 71883@debbugs.gnu.org, shipmints@gmail.com > 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 25 19:00:33 2024 Received: (at 71883) by debbugs.gnu.org; 25 Jul 2024 23:00:33 +0000 Received: from localhost ([127.0.0.1]:37991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sX7Ro-0005I4-LS for submit@debbugs.gnu.org; Thu, 25 Jul 2024 19:00:33 -0400 Received: from out-186.mta1.migadu.com ([95.215.58.186]:42402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sX7Rl-0005Hn-F6 for 71883@debbugs.gnu.org; Thu, 25 Jul 2024 19:00:31 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1721948415; 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=/r9DxQ/1Hxrb8Vnp4P7O+1lL4NScZgeGWOK8ikfBM3A=; b=OnqFSATczQc9R2c9AX/Do2BtOMD0vgVxu8zl4/kn+LG/HOFVdVEOpgeDGfBcPptsJVqzdc XANiYNDrAQcU37r4GDXGgxzK/6LVA3SUdAq1AjzmaYOMKkcYd844/AWckK2S2gKw+0COFm hHnuuVh0khMPcXDlCoWaDEl4VZXfHHg= From: Joseph Turner To: Eli Zaretskii Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <861q3h47ci.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Jul 2024 22:09:01 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> Date: Thu, 25 Jul 2024 16:00:10 -0700 Message-ID: <87a5i5dqmd.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, shipmints@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Joseph Turner >> Cc: Eli Zaretskii , adam@alphapapa.net, >> 71883@debbugs.gnu.org, shipmints@gmail.com >> 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. Thanks! See patches. --=-=-= 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 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 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 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 7e63ee64297e1f8fdb161654d17516bfdb6eb527 Mon Sep 17 00:00:00 2001 From: Joseph Turner 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..078573dd654 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 auto-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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 03:05:56 2024 Received: (at 71883) by debbugs.gnu.org; 6 Aug 2024 07:05:56 +0000 Received: from localhost ([127.0.0.1]:59906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbEGa-0001Bm-6y for submit@debbugs.gnu.org; Tue, 06 Aug 2024 03:05:56 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:35115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbEGX-0001BO-Q8 for 71883@debbugs.gnu.org; Tue, 06 Aug 2024 03:05:54 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 410F51BF206; Tue, 6 Aug 2024 07:04:57 +0000 (UTC) From: Juri Linkov To: Joseph Turner Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <87a5i5dqmd.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Thu, 25 Jul 2024 16:00:10 -0700") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> Date: Tue, 06 Aug 2024 09:59:51 +0300 Message-ID: <86plqmqgpa.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Thanks for the patches. > - `((,(intern (format "group-%i" i)) > + `((,(intern (if current-p "current-group" (format "group-%i" i))) I pushed this part to master now. > +(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)))) In this part please remove the current group from the default implementation, because it looks too ugly, and it was not resized before this change, since tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face. > - (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) I wonder how users are supposed to handle tab-bar-tab-ungrouped now? Since it can't be distinguished from grouped tabs (both have tab- symbols), is this how users should customize this now: (setq tab-bar-auto-width-functions `(,(lambda (item) (and (string-match-p "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)" (symbol-name (nth 0 item))) (not (eq (get-text-property 0 'face (nth 2 item)) 'tab-bar-tab-ungrouped)))))) > +(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30") > [...] > +*** The 'tab-bar-auto-width-faces' variable is now obsolete. > +Use 'tab-bar-auto-width-functions' instead. Actually I see no need to obsolete the variable instead of deleting it right away since it's not used anywhere anymore. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 08:16:21 2024 Received: (at 71883) by debbugs.gnu.org; 9 Aug 2024 12:16:21 +0000 Received: from localhost ([127.0.0.1]:37783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scOXd-0005i2-6x for submit@debbugs.gnu.org; Fri, 09 Aug 2024 08:16:21 -0400 Received: from out-184.mta0.migadu.com ([91.218.175.184]:17411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scOXY-0005hh-5F for 71883@debbugs.gnu.org; Fri, 09 Aug 2024 08:16:20 -0400 Date: Fri, 09 Aug 2024 05:15:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1723205741; 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; bh=lxDmkhAGvullpgmppIgQcGUVbeGeLO4uxFlOJ/MrXJ0=; b=NQMTQSkZZGv0NWKmcgYK13Y8L2KKvI9xt1eIa4EtZ8YzcW/amXk5wnZAQWlKPUZePn6GW/ 9VmZAxSilLCyRrOqZI4rtrmFVmNL1c5ViNrGMMi1qtywuH1oT0L23QelXTXT9WldqMh+P4 g0SoN0Tkby2kYzCku3LZ3oWRQSE6/FM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Juri Linkov Subject: =?US-ASCII?Q?Re=3A_bug=2371883=3A_=5BPATCH=5D_Fix_tab-bar-auto-wid?= =?US-ASCII?Q?th_with_customized_tab-bar-tab-face-function?= In-Reply-To: <86plqmqgpa.fsf@mail.linkov.net> References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> <86plqmqgpa.fsf@mail.linkov.net> Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----N0P9I6MIA9SK9IVTRY7RE3HTJ9PIIA Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) ------N0P9I6MIA9SK9IVTRY7RE3HTJ9PIIA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On August 5, 2024 11:59:51 PM PDT, Juri Linkov wrote: >Thanks for the patches=2E > >> - `((,(intern (format "group-%i" i)) >> + `((,(intern (if current-p "current-group" (format "group-%i" i))) > >I pushed this part to master now=2E > >> +(defun tab-bar-auto-width-predicate-default (item) >> + "Accepts tab ITEM and returns non-nil for tabs and tab groups=2E" >> + (string-match-p >> + ;; (rx bos (or "current-tab" "current-group" "tab-" "group-")) >> + "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)" >> + (symbol-name (nth 0 item)))) > >In this part please remove the current group from the default implementat= ion, >because it looks too ugly, and it was not resized before this change, sin= ce >tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current fac= e=2E If the simpler change brings feature parity, go for it! >> - (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-func= tions item) > >I wonder how users are supposed to handle tab-bar-tab-ungrouped now? >Since it can't be distinguished from grouped tabs (both have tab- symbols= ), >is this how users should customize this now: > > (setq tab-bar-auto-width-functions > `(,(lambda (item) > (and (string-match-p > "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)" (symbo= l-name (nth 0 item))) > (not (eq (get-text-property 0 'face (nth 2 item)) > 'tab-bar-tab-ungrouped)))))) I'm not sure=2E I have never used group tabs=2E >> +(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-= functions "30") >> [=2E=2E=2E] >> +*** The 'tab-bar-auto-width-faces' variable is now obsolete=2E >> +Use 'tab-bar-auto-width-functions' instead=2E > >Actually I see no need to obsolete the variable instead of deleting it ri= ght away >since it's not used anywhere anymore=2E If it's okay to remove defvars without obsoletion notice, then I'm in favo= r of deleting it now=2E Thanks! Joseph ------N0P9I6MIA9SK9IVTRY7RE3HTJ9PIIA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On August 5, 2024 11:5= 9:51 PM PDT, Juri Linkov <juri@linkov=2Enet> wrote:
>Thanks for= the patches=2E
>
>> -=C2=A0=C2=A0 `((,(intern (format "grou= p-%i" i))
>> +=C2=A0=C2=A0 `((,(intern (if current-p "current-grou= p" (format "group-%i" i)))
>
>I pushed this part to master now= =2E
>
>> +(defun tab-bar-auto-width-predicate-default (item)=
>> +=C2=A0 "Accepts tab ITEM and returns non-nil for tabs and tab= groups=2E"
>> +=C2=A0 (string-match-p
>> +=C2=A0=C2=A0 ;= ; (rx bos (or "current-tab" "current-group" "tab-" "group-"))
>> += =C2=A0=C2=A0 "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)= "
>> +=C2=A0=C2=A0 (symbol-name (nth 0 item))))
>
>In = this part please remove the current group from the default implementation,<= br>>because it looks too ugly, and it was not resized before this change= , since
>tab-bar-auto-width-faces didn't contain the tab-bar-tab-grou= p-current face=2E

If the simpler change brings feature parity, go fo= r it!

>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (memq= (get-text-property 0 'face (nth 2 item))
>> -=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=C2=A0=C2= =A0=C2=A0 tab-bar-auto-width-faces)
>> +=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (if (run-hook-with-args-until-success 'tab-bar-auto-widt= h-functions item)
>
>I wonder how users are supposed to handle = tab-bar-tab-ungrouped now?
>Since it can't be distinguished from grou= ped tabs (both have tab- symbols),
>is this how users should customiz= e this now:
>
>=C2=A0 (setq tab-bar-auto-width-functions
>= ;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(,(lambda (item)
>=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and (st= ring-match-p
>=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=C2=A0=C2=A0=C2=A0=C2=A0 "\\`\\(?:current-tab= \\|\\(?:group\\|tab\\)-\\)" (symbol-name (nth 0 item)))
>=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=C2= =A0=C2=A0=C2=A0 (not (eq (get-text-property 0 'face (nth 2 item))
>= =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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 'tab-bar-tab-ungrouped))))))

I'm not sure=2E=C2=A0 I have nev= er used group tabs=2E

>> +(make-obsolete-variable 'tab-bar-aut= o-width-faces 'tab-bar-auto-width-functions "30")
>> [=2E=2E=2E]>> +*** The 'tab-bar-auto-width-faces' variable is now obsolete=2E<= br>>> +Use 'tab-bar-auto-width-functions' instead=2E
>
>A= ctually I see no need to obsolete the variable instead of deleting it right= away
>since it's not used anywhere anymore=2E

If it's okay to= remove defvars without obsoletion notice, then I'm in favor of deleting it= now=2E

Thanks!

Joseph
------N0P9I6MIA9SK9IVTRY7RE3HTJ9PIIA-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 09 08:26:35 2024 Received: (at 71883) by debbugs.gnu.org; 9 Aug 2024 12:26:35 +0000 Received: from localhost ([127.0.0.1]:37795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scOhW-00060a-Di for submit@debbugs.gnu.org; Fri, 09 Aug 2024 08:26:35 -0400 Received: from out-176.mta0.migadu.com ([91.218.175.176]:38846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1scOhR-00060H-L2 for 71883@debbugs.gnu.org; Fri, 09 Aug 2024 08:26:33 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1723206325; 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=HKrYYRFE2FtdxxhFd5jQdbqKj6ajshgx070Og177IO4=; b=hpYXoWGAFXe/spAjY/7Vtxso1qYUGnYwDySRQJNpyxLl7Hp3E/MHF/FI1wo6d//99TCUd8 5wYRaYLkfqxyw1Lv+iSENNM8hOwl9xHSEazQvi6sLmBxXbNE5pj24i0Pcz0Pr+DNaKoKUP 8BjXe1lv199u79cNq4ZCbNpoHhH5t9s= From: Joseph Turner To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <86plqmqgpa.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 06 Aug 2024 09:59:51 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> <86plqmqgpa.fsf@mail.linkov.net> Date: Fri, 09 Aug 2024 05:25:21 -0700 Message-ID: <87ed6xanny.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > Thanks for the patches. > >> - `((,(intern (format "group-%i" i)) >> + `((,(intern (if current-p "current-group" (format "group-%i" i))) > > I pushed this part to master now. > >> +(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)))) > > In this part please remove the current group from the default implementation, > because it looks too ugly, and it was not resized before this change, since > tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face. If the simpler change offers feature parity, that sounds good to me. >> - (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) > > I wonder how users are supposed to handle tab-bar-tab-ungrouped now? > Since it can't be distinguished from grouped tabs (both have tab- symbols), > is this how users should customize this now: > > (setq tab-bar-auto-width-functions > `(,(lambda (item) > (and (string-match-p > "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)" (symbol-name (nth 0 item))) > (not (eq (get-text-property 0 'face (nth 2 item)) > 'tab-bar-tab-ungrouped)))))) I don't use tab groups, so I don't know if anyone will want to do this. >> +(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30") >> [...] >> +*** The 'tab-bar-auto-width-faces' variable is now obsolete. >> +Use 'tab-bar-auto-width-functions' instead. > > Actually I see no need to obsolete the variable instead of deleting it right away > since it's not used anywhere anymore. If it's okay to remove defvars without obsoletion, I'm in favor of it. Thanks! Joseph From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 13:00:14 2024 Received: (at 71883) by debbugs.gnu.org; 19 Aug 2024 17:00:15 +0000 Received: from localhost ([127.0.0.1]:59111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg5jq-0002Dv-Jx for submit@debbugs.gnu.org; Mon, 19 Aug 2024 13:00:14 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:34113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg5jp-0002DP-2P; Mon, 19 Aug 2024 13:00:13 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id A535FE0007; Mon, 19 Aug 2024 16:59:03 +0000 (UTC) From: Juri Linkov To: Joseph Turner Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <87ed6xanny.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Fri, 09 Aug 2024 05:25:21 -0700") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> <86plqmqgpa.fsf@mail.linkov.net> <87ed6xanny.fsf@breatheoutbreathe.in> Date: Mon, 19 Aug 2024 19:57:13 +0300 Message-ID: <86o75o30ye.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 71883 31.0.50 thanks >>> +(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)))) >> >> In this part please remove the current group from the default implementation, >> because it looks too ugly, and it was not resized before this change, since >> tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face. > > If the simpler change offers feature parity, that sounds good to me. Thanks for the patch, I pushed it to master, then ameliorated it to keep backwards-compatibility for users customized these faces, but by default using your predicate on symbols. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 21:50:23 2024 Received: (at 71883) by debbugs.gnu.org; 20 Aug 2024 01:50:23 +0000 Received: from localhost ([127.0.0.1]:59493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgE0t-00081J-FL for submit@debbugs.gnu.org; Mon, 19 Aug 2024 21:50:23 -0400 Received: from out-179.mta1.migadu.com ([95.215.58.179]:60360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgE0r-000813-2D for 71883@debbugs.gnu.org; Mon, 19 Aug 2024 21:50:21 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1724118572; 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=gBM/PpvyH4wheD9BMLZu24ChCqiy2DAfQ5/cwvojVsM=; b=JRd5InUs8fJ1Xpk346KEe4EjcKCn0CpteW25L20qtR/lEIbtu8DsMndeLHi06jsBis2mK9 5q70Br6erpMCkv8DfTMNmbQ8nhJLfqzDKJ4T750Klqpu+cbF69j+viaiVV6PZQw8FAZrTi MvIufN8jA//PcPDyUZ53EJPceyz7Dzg= From: Joseph Turner To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <86o75o30ye.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 19 Aug 2024 19:57:13 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> <86plqmqgpa.fsf@mail.linkov.net> <87ed6xanny.fsf@breatheoutbreathe.in> <86o75o30ye.fsf@mail.linkov.net> Date: Mon, 19 Aug 2024 18:49:27 -0700 Message-ID: <87ttfgc6ag.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > close 71883 31.0.50 > thanks > >>>> +(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)))) >>> >>> In this part please remove the current group from the default implementation, >>> because it looks too ugly, and it was not resized before this change, since >>> tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face. >> >> If the simpler change offers feature parity, that sounds good to me. > > Thanks for the patch, I pushed it to master, then ameliorated it > to keep backwards-compatibility for users customized these faces, > but by default using your predicate on symbols. Thank you! How would users have customized tab-bar-auto-width-faces since it was not a defcustom? From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 02:50:18 2024 Received: (at 71883) by debbugs.gnu.org; 20 Aug 2024 06:50:18 +0000 Received: from localhost ([127.0.0.1]:59695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgIh8-00080B-3H for submit@debbugs.gnu.org; Tue, 20 Aug 2024 02:50:18 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:50033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgIh6-0007zv-EK for 71883@debbugs.gnu.org; Tue, 20 Aug 2024 02:50:16 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2BC9F240005; Tue, 20 Aug 2024 06:49:04 +0000 (UTC) From: Juri Linkov To: Joseph Turner Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <87ttfgc6ag.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Mon, 19 Aug 2024 18:49:27 -0700") Organization: LINKOV.NET References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> <86plqmqgpa.fsf@mail.linkov.net> <87ed6xanny.fsf@breatheoutbreathe.in> <86o75o30ye.fsf@mail.linkov.net> <87ttfgc6ag.fsf@breatheoutbreathe.in> Date: Tue, 20 Aug 2024 09:40:38 +0300 Message-ID: <86jzgb4ttl.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>> +(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)))) >>>> >>>> In this part please remove the current group from the default implementation, >>>> because it looks too ugly, and it was not resized before this change, since >>>> tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face. >>> >>> If the simpler change offers feature parity, that sounds good to me. >> >> Thanks for the patch, I pushed it to master, then ameliorated it >> to keep backwards-compatibility for users customized these faces, >> but by default using your predicate on symbols. > > Thank you! How would users have customized tab-bar-auto-width-faces > since it was not a defcustom? I meant that customized it without using the Customization UI. Maybe a better word would be "configured", e.g. with 'setopt' ('setopt' supports non-customizable plain variables as 'setq' does, unlike 'set-variable' that refuses to change them). From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 03:12:59 2024 Received: (at 71883) by debbugs.gnu.org; 20 Aug 2024 07:12:59 +0000 Received: from localhost ([127.0.0.1]:59715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgJ34-0000AL-KZ for submit@debbugs.gnu.org; Tue, 20 Aug 2024 03:12:58 -0400 Received: from out-187.mta0.migadu.com ([91.218.175.187]:22828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgJ32-0000A4-HS for 71883@debbugs.gnu.org; Tue, 20 Aug 2024 03:12:57 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1724137897; 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=BxF/pZbq8zEB8ihY3cB0j3zwZshaIzoFW5zeU7CgLtI=; b=M8SU3DthNGWiV2lOAEPfv1IOyVnuU0S5Q5GKA8LFYbRwAQY7rpYiBcW2g3m0dPv0XHlEUg 3/V0m2tJBBDedEufSl4fN9LfsjO5YXuAveUFWlIKZo4KSAYN9lqgQxChHMA+pLsMveKQv7 nkD+5GDMhynbWAH6Mj2iEHRYBXtM6qU= From: Joseph Turner To: Juri Linkov Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function In-Reply-To: <86jzgb4ttl.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 20 Aug 2024 09:40:38 +0300") References: <87le2kaloz.fsf@breatheoutbreathe.in> <861q4ce1yb.fsf@mail.linkov.net> <877ce3damx.fsf@breatheoutbreathe.in> <86r0cb7l58.fsf@mail.linkov.net> <5aff3095-087f-493d-9251-8048b51280f9@alphapapa.net> <86msmzc7ne.fsf@mail.linkov.net> <86o77dox54.fsf@mail.linkov.net> <87a5ihgii9.fsf@breatheoutbreathe.in> <86jzhkgtb7.fsf@gnu.org> <865xt1lw66.fsf@mail.linkov.net> <87ikwttk96.fsf@breatheoutbreathe.in> <861q3h47ci.fsf@gnu.org> <87a5i5dqmd.fsf@breatheoutbreathe.in> <86plqmqgpa.fsf@mail.linkov.net> <87ed6xanny.fsf@breatheoutbreathe.in> <86o75o30ye.fsf@mail.linkov.net> <87ttfgc6ag.fsf@breatheoutbreathe.in> <86jzgb4ttl.fsf@mail.linkov.net> Date: Tue, 20 Aug 2024 00:11:33 -0700 Message-ID: <87seuzekii.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71883 Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>>>> +(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)))) >>>>> >>>>> In this part please remove the current group from the default implementation, >>>>> because it looks too ugly, and it was not resized before this change, since >>>>> tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face. >>>> >>>> If the simpler change offers feature parity, that sounds good to me. >>> >>> Thanks for the patch, I pushed it to master, then ameliorated it >>> to keep backwards-compatibility for users customized these faces, >>> but by default using your predicate on symbols. >> >> Thank you! How would users have customized tab-bar-auto-width-faces >> since it was not a defcustom? > > I meant that customized it without using the Customization UI. > Maybe a better word would be "configured", e.g. with 'setopt' > ('setopt' supports non-customizable plain variables as > 'setq' does, unlike 'set-variable' that refuses to change them). I see. Thank you! From unknown Sat Aug 16 10:45:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 17 Sep 2024 11:24:15 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator