From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function Date: Thu, 4 Jul 2024 17:11:44 -0400 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> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008d20a6061c72656d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Adam Porter , 71883@debbugs.gnu.org, Joseph Turner To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 23:14:20 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 1sPTmV-0009XJ-9o for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 23:14:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPTmF-0003FI-1l; Thu, 04 Jul 2024 17:14:03 -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 1sPTmD-0003Ep-3O for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 17:14:01 -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 1sPTmC-0000nw-Qz for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 17:14:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPTmE-0000Of-C3 for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 17:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2024 21:14: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.17201275861442 (code B ref 71883); Thu, 04 Jul 2024 21:14:02 +0000 Original-Received: (at 71883) by debbugs.gnu.org; 4 Jul 2024 21:13:06 +0000 Original-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 Original-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 Original-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) In-Reply-To: <86o77dox54.fsf@mail.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:288399 Archived-At: --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--