From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function Date: Fri, 09 Aug 2024 05:15:38 -0700 Message-ID: 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> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=----N0P9I6MIA9SK9IVTRY7RE3HTJ9PIIA Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39487"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 09 14:17:03 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1scOYI-000A2X-GE for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Aug 2024 14:17:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scOXv-0007hB-Im; Fri, 09 Aug 2024 08:16:39 -0400 Original-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 1scOXr-0007gY-5t for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 08:16:35 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1scOXq-00085G-BP for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 08:16:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=lxDmkhAGvullpgmppIgQcGUVbeGeLO4uxFlOJ/MrXJ0=; b=v6SIzv6cTIzJOoD7WFEA0MN5OZKSRu5IJFL9PK6L/70hudJ4ZrX+I0xILFduXtkOrpmdt2q0DY54iEEehb35UKUfGfPAI2wuSlxTmwFMoWUv4GncQIaV+4yUpOAYHlIhfhhtSRmpo0G9dX5cDB7474jL+2XCunF3fBXFY9K1qBhbF3yZklJajUdBPTSNPdHk9Ko4dTebKQ/PXeenslO8HFxGIu6BI1kRKHPRnO6auJg+xxlMrRWQ70Foba++KpMN9WIw4tRsISjpV3ebwuhuTTT80Y7VDHAjy+Ls08Jwy2fhJQCGU+nrR/tWKm/4JmdUFWufVnwbp0mijZnSGu9S6w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1scOYI-0005jb-26 for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 08:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Aug 2024 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71883 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71883-submit@debbugs.gnu.org id=B71883.172320578121954 (code B ref 71883); Fri, 09 Aug 2024 12:17:02 +0000 Original-Received: (at 71883) by debbugs.gnu.org; 9 Aug 2024 12:16:21 +0000 Original-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 Original-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 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. In-Reply-To: <86plqmqgpa.fsf@mail.linkov.net> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289966 Archived-At: ------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--