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:25:21 -0700 Message-ID: <87ed6xanny.fsf@breatheoutbreathe.in> 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: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1725"; 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:26:59 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 1scOhs-0000Bj-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Aug 2024 14:26:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scOhZ-0005Lw-03; Fri, 09 Aug 2024 08:26:37 -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 1scOhX-0005EJ-3j for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 08:26: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 1scOhW-0001M3-QF for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 08:26: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:Date:References:In-Reply-To:From:To:Subject; bh=HKrYYRFE2FtdxxhFd5jQdbqKj6ajshgx070Og177IO4=; b=LMSuYRjAXFVSkbqcXv87Yzb6gJpIyZCCNzNFeSGo4oqK6bvNHwUQUpALl2uNyYPafJC/JIal42J7G0ghPzTvlZc4EfGCtrP8YbSfNeo+HRmpxwvSRPA98WkJcW7s0nLEe8qNIBD5uX2dSd+MrHJxcDMkMLAl9+A40kx0j2rqL4zWU+sP5moXANAFnxqR4ShALbJIbumQL4Lb4JF2XpmipsbRvtTqHOeoy/Fb9Iz386spyL5SLwmNqo9Ed9kRVPgPmZ8wQUhFq3/kqHPKKc6n3rHq6HjIi87PPzv6xUClIKY0xs9sTd3cdZaFdhBP8zUvHpBkqineXlOlWr8uk0xvTw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1scOhy-00061S-E7 for bug-gnu-emacs@gnu.org; Fri, 09 Aug 2024 08:27: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:27: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.172320639523106 (code B ref 71883); Fri, 09 Aug 2024 12:27:02 +0000 Original-Received: (at 71883) by debbugs.gnu.org; 9 Aug 2024 12:26:35 +0000 Original-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 Original-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= In-Reply-To: <86plqmqgpa.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 06 Aug 2024 09:59:51 +0300") 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:289967 Archived-At: 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