From: Robert Cochran <robert-emacs@cochranmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] Document tab opening/closing hooks and variables
Date: Tue, 10 Dec 2019 13:33:27 -0800 [thread overview]
Message-ID: <878snjeuhk.fsf@cochranmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 266 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to document new tab open/close custom variables --]
[-- Type: text/x-patch, Size: 2936 bytes --]
From 95f26f10030dca8954be16a540d6d699f4567131 Mon Sep 17 00:00:00 2001
From: Robert Cochran <robert-git@cochranmail.com>
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
next reply other threads:[~2019-12-10 21:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 21:33 Robert Cochran [this message]
2019-12-11 17:25 ` [PATCH] Document tab opening/closing hooks and variables Eli Zaretskii
2019-12-11 18:15 ` Robert Cochran
2019-12-15 23:01 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878snjeuhk.fsf@cochranmail.com \
--to=robert-emacs@cochranmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.