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:18:49 -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="0000000000002a62280625a275de" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2015"; 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:20:23 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 1t5rlP-0000Hx-BI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Oct 2024 20:20:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5rl8-0006cc-2V; Tue, 29 Oct 2024 15:20: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 1t5rl6-0006bE-Gw for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:20:04 -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 1t5rl4-0003ln-A3 for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:20: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=xl2Oajy1FdP3CWLrD8JU5pxGXL8PglKQMZ1POjj0mMs=; b=BSysENG4kus95DEru3+5u95hXPAHeSOpr8BBLORKs5ut+m1Kqw5AZjzRVepjYuzoxqaHdo2S5PJ2nz486KG0GXsHAZEJu9ebiwuc8oEJLAlNm7pyHBTEfp3pexIX6lU6n4Lw8oBh9UOl4ErUt/xYqdy83hqewnjxZm6BQF8Ow3zADCOfqSId1hShbbrY6TZIwIIyvwdJMCZDyPOzX0xsf7fNbxUQHuBypqKt35acsgxY7eOacsiY58CUQlZK1UA6fMdfQ9cMbXbe9XERAk8LXl7QHmLNgzA469x26gH+2pxaJwLCd5BAwIhBwx5GJzp87B4rUV3fhw5E1Z6Lg9oWbg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5rl4-0007JN-2e for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:20: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:20:01 +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.173022954728076 (code B ref -1); Tue, 29 Oct 2024 19:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2024 19:19:07 +0000 Original-Received: from localhost ([127.0.0.1]:58253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5rkA-0007Im-Ek for submit@debbugs.gnu.org; Tue, 29 Oct 2024 15:19:06 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5rk7-0007Ig-R8 for submit@debbugs.gnu.org; Tue, 29 Oct 2024 15:19:04 -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 1t5rk7-0006Sx-IJ for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:19:03 -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 1t5rk6-0003gu-2x for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 15:19:03 -0400 Original-Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-4a47d1a62bdso1694003137.0 for ; Tue, 29 Oct 2024 12:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730229541; x=1730834341; 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=xl2Oajy1FdP3CWLrD8JU5pxGXL8PglKQMZ1POjj0mMs=; b=KIxo3fRZVkp8paI9/ERAyxOLqlrYZpgTAZcJO69exYNKnKPmhVRIWqAYqeewQnsKfQ 6qFQztXWvip/2HsWGjg3dsa6L9U/wUvYoiMJ51xEMZIwu2rA79enFJrRQQcC1HDtxlph Id2S8Nt/DPTz6SKHdiFtO0C3eemRufIM8RQC+tj8tyNdHKTpCLgve4PJP1SzAuf4fe6Z 7Wil65Os0zOzPpazps7l381I0pipF5oXtMjrN9ciS+H+gYZ275kGN0Of7LVpFJm6voZf YN/Mfu802GkXt5Qb2Wm6LsqLer7GbJu3hZb8zZi4nm4MDJ0hD0xISYk9ARX6e7RGjE9Y HppQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730229541; x=1730834341; 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=xl2Oajy1FdP3CWLrD8JU5pxGXL8PglKQMZ1POjj0mMs=; b=nsOnB4JGDNz5udNpbhpAMvjWy/SikLxk/+6jByL8UQQ77Tpif0Vw43IAwLk129xArz n3UHImGuvrfaKQRhY0xiwTaeNoEoSvDhiz9DB8Y2yFccHpIn5s4FXpKDrdNkNVhCxr1N Hv22eqSxivBcgDRUB7iXHVbBvNSiX7wyGf5APnWKcsqNbnciC8T8g4oReANBGsmbPUAJ XOW/eqvVHZT2XB0ivDxhfkqGnvgu4JAozf4Vbpp4x34jofYdYOPgDWs7EiZx53mf8X94 0v3g82x4apVlsdkEsl5BKRXMkMSQ5L733L6uwf8hR8RSziS6hX3/Pj7iOkkkjohq0MI7 zJNw== X-Gm-Message-State: AOJu0YyWI+NihDjpfYgNZXecLiNepf/TyFmPYV3Xw9Wlbom0da02/Xj/ 2/d2Sk3Nhe/AtnaL4oWoZdsGTe8Uf3m++N+/At2PR44Pt7cKZUKLKRWI+AX48ek8HKGuWRTaDGW DONY4fYs4O1BVMkT9lZ+9XnInwJQ47w== X-Google-Smtp-Source: AGHT+IHeHgB8//SqTzG53QE9KmpiXhCnhO379KPz5IkRAOQGVE7CDWoBLGToKGuUsZ3I3cVb5Txj38DJzg2fagKq2sg= X-Received: by 2002:a05:6102:2925:b0:4a4:6ec4:7d31 with SMTP id ada2fe7eead31-4a8cfd3075bmr12836961137.20.1730229540903; Tue, 29 Oct 2024 12:19:00 -0700 (PDT) In-Reply-To: <86ttcu20e5.fsf@mail.linkov.net> 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:294528 Archived-At: --0000000000002a62280625a275de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. 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 wrote= : > > I think my proposed patch is more natural for implied-open tabs (with t= he > > tab bar showing or not, doesn't really matter) or explicitly opened one= s. > > 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. > --0000000000002a62280625a275de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 n= o 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 "loc= k" 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 impli= ed-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.
--0000000000002a62280625a275de--