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 15:23:12 -0400 Message-ID: References: <86a5em4w18.fsf@mail.linkov.net> <861pzy3fot.fsf@mail.linkov.net> <86ttcu20e5.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000cf0cd50625a2841b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18802"; 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 20:24: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 1t5rp6-0004iX-UC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Oct 2024 20:24:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5rp2-0006vw-Ex; Tue, 29 Oct 2024 15:24:08 -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 1t5rox-0006vb-Gh for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:24:03 -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 1t5row-00045K-LO for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:24:03 -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=sQ+NkdECBC2fMkQBZR/CxwzQmhZ7yNuWylSkY26CJZc=; b=qOKDqGdQbFW++jwT4gVk/DtBhtliukuqhoqBWsC8RwZdgmn8MOlcGDWs492WTvG+AOaL9PUFFrmLMQ+4CQTil4NsLMpkT9LPFnexvp1cB7bAtARLbPluJklPKi2fhCkuQLNj/gbDPIIHZDGJYcTDKuFPasFwSqDFNBP04IKpo6peNPoV9QlUvRdl7P3hduTbSI3i/BHwLumUmyDXfTq6NHtptHxioWN5NLvjIo1wgGhoz04jjj/ZDUIWA6bCnwHXCtphDMhk+0OeC+mv5nl1l8nmG0lc1Z73Ukff7/O1LJDs8EPkAhP7rXo0BP+XdAYaMrfYPKGepM6PjeQe7Et6QA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5row-0007Ry-G3 for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:24: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 19:24: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.173022980828623 (code B ref -1); Tue, 29 Oct 2024 19:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2024 19:23:28 +0000 Original-Received: from localhost ([127.0.0.1]:58276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5roO-0007Rb-8s for submit@debbugs.gnu.org; Tue, 29 Oct 2024 15:23:28 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5roM-0007RV-NN for submit@debbugs.gnu.org; Tue, 29 Oct 2024 15:23:27 -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 1t5roM-0006uH-CM for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:23:26 -0400 Original-Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t5roK-00044F-Iv for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:23:26 -0400 Original-Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-4a479773730so1442114137.2 for ; Tue, 29 Oct 2024 12:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730229803; x=1730834603; 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=sQ+NkdECBC2fMkQBZR/CxwzQmhZ7yNuWylSkY26CJZc=; b=Umv67bBI2X1BPLp8tt2OnmYBQhycLpeHo0MUHsEMUIawZKq1vUBCPRT862qAtfhQLc aTsYH/VlzLpdUh6IYzrwJnlkf4Y10Gi1p5QpS5EtlHZcq841N9OZec5c/psRsUJ5X6AM /qH8RDR5NoA4CiU26qwK+4mwvQx7vbBDnEGMQOMWpEoziVvTXNYC6sTfJ663/MDfGpHH kNlUtygmhnAkcC+y2/Nom0UxSf9X+u1IqvONVxz0Mta5OucVH7uggf9rcWwhxizb4bbp BkREIP7VQHQLZjZ3TQxl+y5HWHkQhGJQdPkgb5YPZ8J3fF7G+s6Mrpkf0ptEsq48CNCj HUrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730229803; x=1730834603; 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=sQ+NkdECBC2fMkQBZR/CxwzQmhZ7yNuWylSkY26CJZc=; b=KLtRZ0nBrHyPbMONHeHAGJML0CZ9bgtWLu/Eu1nf2gUs2YYAgbDO86kB9wU4tvSBDo KsIuXCSacdzRUGjlfBv5aIIw4/cq3U80YyonUS79DNvi/EtVeTskW0BTIjrCi7OgARrX xHdr/Rho0iH0OlSF+f+/MaF810KT0iCguS0vVqhG8GMtCk4SiJlXV19vy2igbd6G4ubC 4Kr7QVV2sUu307B04/yUIy6EJ6l76sEN+XhegwkQ6JgQnzsf0qenmj6UBB4ZI/J87MPu BbKnpPXCb0alz34jtNfjgF8giZomT73s2Kquo2+8HqWqYeRrAvgAPL997jC6VmBS/uSq ehQw== X-Gm-Message-State: AOJu0Ywn4x98Yrg2MElOwjJPbUlNkj9LXMX/Q/jXnFb25qhy8SqaCjuv FJ2c5Mm/dJ7IVH4jMUiTDFHuAWILHkWPYd7EbBCT7rK4AXTgX6G03L/fk5kjtfZILLL9rbYtxHo 7sTBu8oCQ3GcX1vB4uFH8Ah3IK/GbJg== X-Google-Smtp-Source: AGHT+IGLMVATs7bxZZGWc+kyzIKAI0icgvhJN6lJDNr2FwJqGGQe+jYVPPUlRHIcuK12kdZPFepsA13JPIt92cchE8A= X-Received: by 2002:a05:6102:6c5:b0:4a4:7257:e71e with SMTP id ada2fe7eead31-4a8cfb4b70emr12247500137.7.1730229803353; Tue, 29 Oct 2024 12:23:23 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2a; envelope-from=shipmints@gmail.com; helo=mail-vs1-xe2a.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:294529 Archived-At: --000000000000cf0cd50625a2841b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 wr= ote: > 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 u= se > 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. > > My pre-close case is currently limited to just "lock" testing to inhibit > closing and is different. > > On Tue, Oct 29, 2024 at 3:09=E2=80=AFPM Juri Linkov wro= te: > >> > I think my proposed patch is more natural for implied-open tabs (with >> the >> > tab bar showing or not, doesn't really matter) or explicitly opened >> ones. >> > Just invoke when the tabs are created seems the best route and the one >> that >> > people would expect reading the code. >> > >> > I'll have a look at the close hooks again in a bit. I do know the >> behavior >> > of the pre-close hook is good for my uses. >> >> Since the behavior of the pre-close hook is good for your uses, >> then the best solution for you would be to introduce a new similar hook: >> 'tab-bar-tab-pre-open-functions' that will be called in the first tab as >> well. >> > --000000000000cf0cd50625a2841b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In a pre-open hook, I'd expect to be able to deny a new tab being op= ened, 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 officiall= y created even if not yet visible.

On Tue, Oct 29, 2024 at 3:18=E2=80= =AFPM Ship Mints <shipmints@gmail= .com> wrote:
That's not a good assumption, though. The motivation behind putt= ing the open hook call after the tabs are set on the frame is to allow user= s to use the frame tabs as they would for tabs created at any other time wi= th no special casing. I don't think we need a special case, just treat = all tabs the same, first or beyond.

My pre-close case is currently limited to just "= ;lock" testing to=C2=A0inhibit closing and is different.
On Tue, = Oct 29, 2024 at 3:09=E2=80=AFPM Juri Linkov <juri@linkov.net> wrote:
> I think my proposed patch is = more natural for implied-open tabs (with the
> tab bar showing or not, doesn't really matter) or explicitly opene= d ones.
> Just invoke when the tabs are created seems the best route and the one= that
> people would expect reading the code.
>
> I'll have a look at the close hooks again in a bit. I do know the = behavior
> of the pre-close hook is good for my uses.

Since the behavior of the pre-close hook is good for your uses,
then the best solution for you would be to introduce a new similar hook: 'tab-bar-tab-pre-open-functions' that will be called in the first t= ab as well.
--000000000000cf0cd50625a2841b--