> If I may interject a bit, I think it would be better if the tab is > closed (i.e., tab-bar-close-tab is called) and another tab is > displayed when the dedicated buffer is killed if its the only one in > a window. Thanks, good suggestion. > For example, I changed `window--delete` on my machine to > have this > > (if (and tab-bar-mode > (> (length (tab-bar-tabs)) 1)) > (tab-bar-close-tab) > (delete-frame frame)) > > In your patch, `tab-bar-window-delete-frame-p` doesn't do that, nor > should it as it is a predicate. Maybe > `window-delete-frame-predicate-functions` should be renamed to > `window-delete-frame-actions` or something and `tab-bar-close-tab` > should be called in `tab-bar-window-delete-frame-p` (removing `-p` > probably) -- in fact, the `delete-frame` code itself could be added as > such an action, if we are not averse to changes to the interface. It should be sufficient to rename it to just 'window-delete-frame-functions'. Then it's not a predicate, and also follows the naming convention of hooks having the '-functions' suffix. > Also, just FYI, your patch doesn't allow the branches with > `auto-hide-function` and `frame-auto-hide-function` to be called when > `kill` is nil. I don't know the side-effects of not calling these > functions in such cases, but might be worth checking. Probably the frame should not be hidden after closing the tab, so these branches should not be handled. Ok, here is the patch that supports your initial case: