From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function Date: Tue, 06 Aug 2024 09:59:51 +0300 Organization: LINKOV.NET Message-ID: <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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12792"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: adam@alphapapa.net, 71883@debbugs.gnu.org, Eli Zaretskii , shipmints@gmail.com To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 06 09:06:12 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 1sbEGq-00035a-38 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Aug 2024 09:06:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbEGY-0004WL-0j; Tue, 06 Aug 2024 03:05:55 -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 1sbEGK-0004V2-2m for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 03:05:40 -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 1sbEGI-0000md-UQ for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 03:05:39 -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:Date:References:In-Reply-To:From:To:Subject; bh=F9eG/Fz1rH1qXGWazDE2md4cWfIzT4v57D5PCN+sImw=; b=aDOb/19HWZw0X7iespvJgGb8ImTRYntJini/vSqsHwfxQltEq3amdn/GtLY5Sh3RMgzIrcIPEcv4gRPVarnvlqW5xg/Bg8wui/hhAgz4hbcV8+mocriCa3K99viKQzRN/vRxyMOmfZgwRDjCaSBNWVSkztOTH43zu0AoR6pqs52Rj+peTaWOWr/IqqFVVh/Rux082eFHD4OZt0pR5GTYw2xjkXp2dz94CgCHj6Bzwx10V7gXimoLTCF8qDzD03neGk7P4Z1WSlO0UJ41mVqB2BZJptDT8YXwmF954YudctoFguH51mUQoEvPO60npsgrpi+IIx5/E91Lnhsay4GoBg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbEGg-0001CA-Al for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 03:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Aug 2024 07:06: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.17229279564578 (code B ref 71883); Tue, 06 Aug 2024 07:06:02 +0000 Original-Received: (at 71883) by debbugs.gnu.org; 6 Aug 2024 07:05:56 +0000 Original-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 Original-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 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 410F51BF206; Tue, 6 Aug 2024 07:04:57 +0000 (UTC) In-Reply-To: <87a5i5dqmd.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Thu, 25 Jul 2024 16:00:10 -0700") X-GND-Sasl: juri@linkov.net 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:289817 Archived-At: 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.