reddit / emacs

display-buffer-action for tab bar?

public_image_limited 路 2022-04-26 11:20
I'd like to automatically associate new buffers with tab bars, e.g. by re-using an existing tab bar for all buffers of some kind, or by opening a new one if there is none yet associated with it. I wanted it to be rather primitive, so I do not want to install an extra package, if possible. I thought a perfect way to implement this would be using `display-buffer-alist`, but a quick browse of the manual reveals there's noting tab bar specific in there. Any thought how I could hack my way nonetheless?
karthink 路 2022-04-26 13:26
You can use a combination of `display-buffer-reuse-window`, `display-buffer-in-tab` and `display-buffer-in-new-tab` in `display-buffer-alist` to get what you want.
public_image_limited 路 2022-04-26 13:38
Thanks, I will try! Obviously missed `display-buffer-in-tab` 馃榾
mclearc 路 2022-04-27 20:51
I know you don't want to install an external package but you might look at [https://github.com/mclear-tools/tabspaces](https://github.com/mclear-tools/tabspaces). 'tab-bar-tab-post-open-functions' basically functions as a hook, which might also be useful.
public_image_limited 路 2022-04-27 21:02
I have no time to test it right now, but that sounds close to what I want. Thanks for the hint!
public_image_limited 路 2022-04-28 14:17
Just found out that `display-buffer-in-{new-}-tab` are not documented in the Info manual, which is unusual...