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: Thu, 04 Jul 2024 20:57:23 +0300 Organization: LINKOV.NET Message-ID: <86o77dox54.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13261"; 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: 71883@debbugs.gnu.org, Ship Mints , Joseph Turner To: Adam Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 20:06:15 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 1sPQqT-0003Jr-QV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 20:06:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPQqI-00070n-4d; Thu, 04 Jul 2024 14:06:02 -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 1sPQqF-000704-J1 for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 14:05:59 -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 1sPQqF-0001Jv-Aw for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 14:05:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPQqH-0000rF-KW for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 14:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2024 18:06:01 +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.17201163143229 (code B ref 71883); Thu, 04 Jul 2024 18:06:01 +0000 Original-Received: (at 71883) by debbugs.gnu.org; 4 Jul 2024 18:05:14 +0000 Original-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 Original-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 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 60D8AC0002; Thu, 4 Jul 2024 18:04:42 +0000 (UTC) In-Reply-To: (Adam Porter's message of "Wed, 3 Jul 2024 14:50:24 -0500") 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:288386 Archived-At: >>>> 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.