From: Robert Cochran <robert-emacs@cochranmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org, "T.V Raman" <raman@google.com>
Subject: Re: [PATCH] Enable persistent naming for tabs
Date: Wed, 30 Oct 2019 11:35:37 -0700 [thread overview]
Message-ID: <8736faozd2.fsf@cochranmail.com> (raw)
In-Reply-To: <87wocruqmb.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 27 Oct 2019 00:46:36 +0300")
Juri Linkov <juri@linkov.net> writes:
>> It occurred to me in the process of writing this up that it might be
>> useful to provide hook variables for creating and closing tabs -
>> 'tab-bar-tab-open-hook' and 'tab-bar-tab-close-hook' perhaps? Standard
>> fare on those - a list of functions that take the tab as an argument,
>> probably called as the last task of tab creation and the first task of
>> tab closing? Thoughts?
>
> Not sure if this could be a hook on tab-bar basic events,
> or a customizable function. Also not clear whether to call it
> before or after the main body.
>
> We need to collect more examples of use cases to decide
> on the implementation.
I believe it better to be a hook personally, though admittedly that kind
of depends on how exactly you want to use the functionality. A hook
allows for several interested parties to be able to act on a tab
create/close instead of just one. This allows better for dynamically
adding or removing situationally dependent behavior. For example, maybe
I want to kill some/all of the buffers in the tab when I close it, but
only under certain circumstances, like if it's a tab containing non-file
'work' buffers like those of Magit or mpd. Another is if I open a new
tab, and I want to be prompted to name the tab automatically depending
on the buffers that exist at the time of creation - I have a tendency to
segregate all of my Magit buffers for a repository into a single tab,
and I usually rename the tab so that no matter what Magit sub-buffer I'm
on, the tab still has a consistent name. I can see myself doing similar
for other 'task-oriented' sets of windows and buffers such as gdb, mpd,
etc.
Either way, I suggest that we call any type of user-defined function on
tab creation at the end of the function body, and any type of
user-defined function on tab deletion at the beginning of the function
body. IMO there's nothing reasonable to do on tab creation until after
most of the work has been done already anyways, and that it's too late
to do anything on tab close except at the very beginning, when it's
still an open tab.
Thanks,
--
~Robert Cochran
next prev parent reply other threads:[~2019-10-30 18:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 1:03 [PATCH] Enable persistent naming for tabs Robert Cochran
2019-10-10 21:43 ` Juri Linkov
[not found] ` <87ftjz6v4d.fsf@cochranmail.com>
2019-10-13 19:53 ` Juri Linkov
2019-10-15 21:45 ` Juri Linkov
2019-10-20 16:17 ` Juri Linkov
2019-10-20 23:54 ` T.V Raman
2019-10-21 21:34 ` Juri Linkov
2019-10-23 16:22 ` Robert Cochran
2019-10-23 20:41 ` Juri Linkov
2019-10-25 15:47 ` Robert Cochran
2019-10-25 16:01 ` Robert Cochran
2019-11-03 22:08 ` Robert Cochran
2019-11-03 22:37 ` Juri Linkov
2019-10-26 21:46 ` Juri Linkov
2019-10-30 18:35 ` Robert Cochran [this message]
2019-10-30 21:52 ` Juri Linkov
2019-10-30 23:05 ` Juri Linkov
2019-10-31 1:50 ` Robert Cochran
2019-10-31 21:17 ` Juri Linkov
2019-10-27 23:10 ` Juri Linkov
-- strict thread matches above, loose matches on Subject: below --
2019-10-08 22:26 Robert Cochran
2019-10-09 16:02 ` Eli Zaretskii
2019-10-09 22:58 ` Juri Linkov
2019-10-23 20:53 ` Kalman Reti
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736faozd2.fsf@cochranmail.com \
--to=robert-emacs@cochranmail.com \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
--cc=raman@google.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).