From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.devel Subject: [PATCH] Document tab opening/closing hooks and variables Date: Tue, 10 Dec 2019 13:33:27 -0800 Message-ID: <878snjeuhk.fsf@cochranmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="33796"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 10 22:33:50 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ien8f-0008dW-Ja for ged-emacs-devel@m.gmane.org; Tue, 10 Dec 2019 22:33:49 +0100 Original-Received: from localhost ([::1]:36304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ien8e-000617-D7 for ged-emacs-devel@m.gmane.org; Tue, 10 Dec 2019 16:33:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41320) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ien8X-00060p-KC for emacs-devel@gnu.org; Tue, 10 Dec 2019 16:33:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ien8W-00058H-CG for emacs-devel@gnu.org; Tue, 10 Dec 2019 16:33:41 -0500 Original-Received: from mail.cochranmail.com ([64.140.150.170]:41602) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ien8W-00055R-3k for emacs-devel@gnu.org; Tue, 10 Dec 2019 16:33:40 -0500 Original-Received: from SoraLaptop (unknown [71.212.134.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.cochranmail.com (Postfix) with ESMTPSA id C47611F0B for ; Tue, 10 Dec 2019 13:33:33 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.140.150.170 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243289 Archived-At: --=-=-= Content-Type: text/plain Hi all, As promised, I've written information on tab-bar-post-open-functions, tab-bar-close-last-tab-choice, tab-bar-prevent-close-functions, and tab-bar-post-close-functions in the manual. Suggestions and comments welcome, as usual. Thanks, -- ~Robert Cochran --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Document-tab-opening-closing-hooks-and-variables.patch Content-Description: Patch to document new tab open/close custom variables >From 95f26f10030dca8954be16a540d6d699f4567131 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Tue, 10 Dec 2019 13:25:08 -0800 Subject: [PATCH] Document tab opening/closing hooks and variables * doc/emacs/frame.texi (Tab Bats): Document tab-bar-post-open-functions, tab-bar-close-last-tab-choice, tab-bar-prevent-close-functions, and tab-bar-pre-close-functions. --- doc/emacs/frames.texi | 44 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 3a98df7de9..1af06dd308 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1313,8 +1313,9 @@ Tab Bars @item C-x t 0 @kindex C-x t 0 @findex tab-close -Close the selected tab (@code{tab-close}). It has no effect if there -is only one tab. +Close the selected tab (@code{tab-close}). Its effect when there is +only one tab is determined by the variable +@code{tab-bar-close-last-tab-choice}. @item C-x t o @kindex C-x t o @@ -1329,6 +1330,45 @@ Tab Bars @kindex C-x t 1 @findex tab-close-other Close all tabs on the selected frame, except the selected one. +@end table + + The following customizable variables provide more fine-grained +control over tab opening and closing: + +@table @code +@item tab-bar-post-open-functions +@vindex tab-bar-post-open-functions +A list of functions to be called to perform any final setup tasks just +after the tab is opened. Each function is called with the new tab as +an argument, and this new tab will be the current tab. + +@item tab-bar-close-last-tab-choice +@vindex tab-bar-close-last-tab-choice +Determines what to do when the last tab on a frame is going to be +closed. The value @code{nil} means to do nothing and display a +message in the minibuffer, as when attempting to close the only window +in a frame. The value @code{delete-frame} closes the entire +containing frame, as it does in most modern web browsers. The value +@code{tab-bar-mode-disable} will disable tab-bar-mode. If the value +is a function, it will be called with the tab to be closed as an +argument. + +@item tab-bar-prevent-close-functions +@vindex tab-bar-prevent-close-functions +A list of functions to be called to determine whether or not to close +the tab. Each function is called with the tab to be closed and a +boolean argument indicating whether or not it is the last tab. If any +of the functions return non-@code{nil}, the tab is not closed and no +cleanup is performed, including any actions determined by +@code{tab-bar-close-last-tab-choice}. + +@item tab-bar-pre-close-functions +@vindex tab-bar-pre-close-functions +A list of functions to be called to perform any cleanup tasks just +before the tab is closed. Each function is called with the tab to be +closed and a boolean argument indicating whether or not it is the last +tab. + @end table @node Dialog Boxes -- 2.23.0 --=-=-=--