The display-buffer
function seems to be used quite heavily within Emacs. It has a lot of options to determine where to open a new buffer (a new window, a new frame, an existing window, etc).
Emacs introduced a concept of tabs in 27.1. However, there doesn't appear to be an easy way to tell display-buffer
that you want new buffers to open in a tab, instead of just a new window.
Is there some way to configure display-buffer
to open all buffers in a new (or existing?) tab?
The solution from NickD suggests using a function like display-buffer-in-tab
.
I was able to get this working by setting display-buffer-base-action
like the following:
(setq display-buffer-base-action '(display-buffer-in-tab))
However, this doesn't seem to play nicely with functions like help
and magit-status
. They tend to open up too many tabs every time they are run.
More specific settings may be necessary per command or per new buffer.