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#74087: Bug patch: invoke tab-bar-tab-post-open-functions during tabs initialization Date: Tue, 29 Oct 2024 16:05:20 -0400 Message-ID: References: <86a5em4w18.fsf@mail.linkov.net> <861pzy3fot.fsf@mail.linkov.net> <86ttcu20e5.fsf@mail.linkov.net> <86froe3d66.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000088d4b80625a31be7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20158"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74087@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 29 21:06:13 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 1t5sTj-00052R-88 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Oct 2024 21:06:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5sTe-0000Ot-TO; Tue, 29 Oct 2024 16:06:06 -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 1t5sTa-0000OX-Sq for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 16:06:02 -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 1t5sTa-0008Tk-KN for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 16:06:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=MnRieOOZ41+P7K45UFm9Y6Xdht6VD06mcd8v1h9pD3E=; b=JMpTh2exrBb76V4QKqle0LH8ElXOqU+p40qt2ozGCDEl4cup9qmMd+rFGSHr8+RBCHw/l4piK2p+cFB6R+6euTBxXOK4oqhQUoEmr9kIlI6H5EJRxsmkz5TLu12pTfeR1NL/cE+ji+KUHlt/PixfAhtIjGWVtydrZwY3b8jyXF2Yuzc9o5ItceWHAYOuKQXmTpPaMoRE/wzlSD2r9GTnnnr8IrROeE3PPVvsvxYnqUKpfieX+nVkcF/y5wIqFonhsyNLtI1GtLh2v5uw8C9u8H704gC5hzeyFHakT3jZrQxMN77wo2yT0ee7thTwlt241r09YTUPhmsQgq3x5gSW4w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5sTa-0000Mi-Cu for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 16:06: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: Tue, 29 Oct 2024 20:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74087 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17302323371389 (code B ref -1); Tue, 29 Oct 2024 20:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2024 20:05:37 +0000 Original-Received: from localhost ([127.0.0.1]:58499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5sTB-0000ML-5m for submit@debbugs.gnu.org; Tue, 29 Oct 2024 16:05:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5sT9-0000MF-KR for submit@debbugs.gnu.org; Tue, 29 Oct 2024 16:05:36 -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 1t5sT9-0000Ir-Bm for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 16:05:35 -0400 Original-Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t5sT7-0008S7-Mu for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 16:05:35 -0400 Original-Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3e60825aa26so3488488b6e.1 for ; Tue, 29 Oct 2024 13:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730232332; x=1730837132; darn=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=MnRieOOZ41+P7K45UFm9Y6Xdht6VD06mcd8v1h9pD3E=; b=GyeOYqTR9uGsVZNIFNZ/4dI6p87xiwkFcw9yQp8vQsiFCdhFSluB9NfX3nO7El36l9 AO3PFtyyqzfkk70nMCIdLL4p1/4qrP82sjm7McUU5HoRKKjsEoIxEBl65XLmCqq8pDh+ C0Jr19ZDUJmaCsigRUMo7NizsrANqQePWg1CHt2ln1AiEUgvLvXA3gpz7ikhx8Zf/ONt AMoL1Fqy+0s7ANIuLjB1M9O72gRiL3dPyFe6mc1wEbQOznf5MdOu5FYmBTC6sZTPvZWj GMiofeyjZXC7QXkRlcCrcxsl2KmTSFQCHM7Flhlra+yAuBkBL8wjJy9TZyqdFVxvAf2d pSFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730232332; x=1730837132; 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=MnRieOOZ41+P7K45UFm9Y6Xdht6VD06mcd8v1h9pD3E=; b=BzTBaI7UnKeMBPKKxh4YryPdnIIEnJklT7OaZCzumQm0AklCLySoYNJRq3z0NMsG92 PcBPBhjDMssDJXgp4yjpfSXX+dv0s/cR0KSOVEHE6kwJS3PUsufxPtzsLdoEQxapgUva dL4TvTPJaPcsKGMHq0MSW9BUFAidoQmD1Ny+u32YaTtsI499vTTus3LcMa31oZaZsiqe FlDoH6E0k5BeomAuHIUGQQWJnxzgkI8FCPngJTVPUgZUM6TTNZVJ72O0xNUtSmHxjA5a XvDvC8R5WEZeNuY8c23BeU01FeYDPA8HVEqtMcgZX8YHfzumkZtFNxYWQAyWodv9SFhy JuHQ== X-Gm-Message-State: AOJu0Yw4ppbEuGEpwsEJQRyu47S2X9tRtfnmhxgG0+g7ybMIO7alr0fy NYJLRQxX3Xe2ZP4Wl/dg7oC8kcaCbVk9/zqe7pLeA/k4AWbsAcz/pU41YNwDOO1GmmfAIv5OfY+ yEKTL4Ec3qJUFZzISxVkdtxs86HM= X-Google-Smtp-Source: AGHT+IF93HwopKNmctvsfa5hUSPNJkzfOsmGej5swpImylrzGd/JZAKlHHjSAqUlBMvxBEUIQI5BpYw1E+zgOhI8/wI= X-Received: by 2002:a05:6808:3995:b0:3e6:5ee:f197 with SMTP id 5614622812f47-3e6384565e1mr14067083b6e.14.1730232332110; Tue, 29 Oct 2024 13:05:32 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=shipmints@gmail.com; helo=mail-oi1-x230.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:294534 Archived-At: --00000000000088d4b80625a31be7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Plus, the patch treats both initial and secondary tab opening identically with no special casing. That's key for users. On Tue, Oct 29, 2024 at 4:04=E2=80=AFPM Ship Mints wr= ote: > But the patch works and tabs have been set and the initial tab has been > assigned and passed to the hook. Works fine. I'm missing your concern. > > On Tue, Oct 29, 2024 at 3:49=E2=80=AFPM Juri Linkov wro= te: > >> > A pre-open tab hook, though, might be useful for pinning cases if it >> would >> > allow influencing the tab position as a function value. I could think = on >> > that separately from the proposed patch and see if I can simplify >> pinning >> > as a result (which is already a pain in the neck and quite imperfect). >> > >> > On Tue, Oct 29, 2024 at 3:23=E2=80=AFPM Ship Mints wrote: >> > >> > In a pre-open hook, I'd expect to be able to deny a new tab being >> > opened, for example, if I want a tab-bar with a fixed set of tabs. >> That >> > seems like a different use-case from operating on a tab after it's >> > officially created even if not yet visible. >> > >> > On Tue, Oct 29, 2024 at 3:18=E2=80=AFPM Ship Mints >> wrote: >> > >> > That's not a good assumption, though. The motivation behind >> putting >> > the open hook call after the tabs are set on the frame is to >> allow >> > users to use the frame tabs as they would for tabs created at >> any >> > other time with no special casing. I don't think we need a >> special >> > case, just treat all tabs the same, first or beyond. >> >> The hook 'tab-bar-tab-post-open-functions' can't be called from >> 'tab-bar-tabs' >> because no new tab is opened from 'tab-bar-tabs'. The initial tab >> already exists. >> >> What could be done in 'tab-bar-tabs' is to call a completely new hook >> named >> 'tab-bar-init'. >> > --00000000000088d4b80625a31be7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Plus, the patch treats both initial and secondary tab opening identicall= y with no special casing. That's key for users.

On Tue, Oct 29, 20= 24 at 4:04=E2=80=AFPM Ship Mints <shipmints@gmail.com> wrote:
But the patch works and tabs have been set and the i= nitial tab has been assigned and passed to the hook. Works fine. I'm mi= ssing your concern.

On Tue, Oct 29, 2024 at 3:49=E2=80=AFPM Juri Linko= v <juri@linkov.net<= /a>> wrote:
&= gt; A pre-open tab hook, though, might be useful for pinning cases if it wo= uld
> allow influencing the tab position as a function value. I could think = on
> that separately from the proposed patch and see if I can simplify pinn= ing
> as a result (which is already a pain in the neck and quite imperfect).=
>
> On Tue, Oct 29, 2024 at 3:23=E2=80=AFPM Ship Mints <
shipmints@gmail.com> wrote= :
>
>=C2=A0 =C2=A0 =C2=A0In a pre-open hook, I'd expect to be able to de= ny a new tab being
>=C2=A0 =C2=A0 =C2=A0opened, for example, if I want a tab-bar with a fix= ed set of tabs. That
>=C2=A0 =C2=A0 =C2=A0seems like a different use-case from operating on a= tab after it's
>=C2=A0 =C2=A0 =C2=A0officially created even if not yet visible.
>
>=C2=A0 =C2=A0 =C2=A0On Tue, Oct 29, 2024 at 3:18=E2=80=AFPM Ship Mints = <shipmints@gmai= l.com> wrote:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0That's not a good assumption, tho= ugh. The motivation behind putting
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the open hook call after the tabs are= set on the frame is to allow
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0users to use the frame tabs as they w= ould for tabs created at any
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0other time with no special casing. I = don't think we need a special
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case, just treat all tabs the same, f= irst or beyond.

The hook 'tab-bar-tab-post-open-functions' can't be called from= 'tab-bar-tabs'
because no new tab is opened from 'tab-bar-tabs'.=C2=A0 The initial= tab already exists.

What could be done in 'tab-bar-tabs' is to call a completely new ho= ok named
'tab-bar-init'.
--00000000000088d4b80625a31be7--