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#74087: Bug patch: invoke tab-bar-tab-post-open-functions during tabs initialization Date: Wed, 30 Oct 2024 20:30:02 +0200 Organization: LINKOV.NET Message-ID: <86h68tsbal.fsf@mail.linkov.net> References: <86a5em4w18.fsf@mail.linkov.net> <861pzy3fot.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="37772"; 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: 74087@debbugs.gnu.org To: Ship Mints Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 30 19:35:43 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 1t6DXj-0009gY-LD for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Oct 2024 19:35:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6DXA-0004Cn-51; Wed, 30 Oct 2024 14:35: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 1t6DX5-0004C7-SO for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2024 14:35: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 1t6DX5-0002sG-JA for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2024 14:35:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=lOq2duW7sCZy6/Lm2B0qXivsc/AjzmSGkpHkxjUIuew=; b=cQEaxtNV9OeWOZiTO3OuLfun/Tz7j6sHOncdjCv+eMml8S2pllX1tPB0F1vZ7PONPpdqabiyyQH28HMLfnr5sH5tZ0R97wf/W5uA9h8raqFGq3xEZrTlJoraIQS63pmZLfKcuTfOvHXXNPGgyMajf2K6eFB4kU9IX0wnlAeTlhjR0HWMXvMf01FvXaZmWdKO7jKtQiZ7A2qdnPmDaITCRsVSH5XRHY/AYjIt7SlQ+0B0pG2qtd6AqaC3B3ozg7nfuDF6Q4+YK/6lm6mTdCDLuCX4fSLwvwP0mGoeKMIqtwwEaO5H8ng+Amqe3Ow9vyV8tO5TjX1u6DbHRQw/5Yv8oQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t6DX4-00041H-R3 for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2024 14:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Oct 2024 18:35: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.173031329215400 (code B ref -1); Wed, 30 Oct 2024 18:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Oct 2024 18:34:52 +0000 Original-Received: from localhost ([127.0.0.1]:36614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6DWu-00040H-C6 for submit@debbugs.gnu.org; Wed, 30 Oct 2024 14:34:52 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6DWs-00040B-N8 for submit@debbugs.gnu.org; Wed, 30 Oct 2024 14:34:51 -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 1t6DWs-0004BR-Dy for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2024 14:34:50 -0400 Original-Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6DWq-0002q1-1A for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2024 14:34:50 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id F2083240009; Wed, 30 Oct 2024 18:34:41 +0000 (UTC) In-Reply-To: (Ship Mints's message of "Wed, 30 Oct 2024 09:44:02 -0400") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::221; envelope-from=juri@linkov.net; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:294577 Archived-At: >> Calling the close hooks currently doesn't look correct: >> >> (run-hook-with-args 'tab-bar-tab-pre-close-functions >> (nth close-index tabs) >> last-tab-p) >> (if last-tab-p >> (pcase tab-bar-close-last-tab-choice >> ('nil >> (user-error "Attempt to delete the sole tab in a frame")) >> >> where first it makes an attempt to close the tab, calls the hook, >> then fails with the user-error. I think the hook should be called >> when the tab is really closed. > > You're right about tab-bar-tab-pre-close-functions being called > prematurely. There seem to be almost no calls to it in the wild that I > could find. Now is a good time to correct this. This could be corrected when someone will ask for it.