emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Enable persistent naming for tabs


From: Juri Linkov
Subject: Re: [PATCH] Enable persistent naming for tabs
Date: Wed, 30 Oct 2019 23:52:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> 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.

Maybe we need to add the prefix 'pre-' to indicate that the hook
is called before the command is executed, with a name e.g.:

  tab-bar-pre-close-tab-functions (tab)

This might require an additional utility function to get all buffers
from the tab (it could collect buffers by traversing readable window-state),
with a name:

  tab-bar-tab-buffers (tab)

Such function is also needed for checking if a buffer exists in a tab
to prevent killing a buffer in the current tab with C-x k
when such buffer is still shown in some other tab.

> 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.

This looks like calling after the tab is created, so maybe a name like

  tab-bar-post-new-tab-functions (tab)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]