Subject: bug#38624: 27.0.50; [wish] tab navigation via keyboard should mimic buffer navigation

From: Juri Linkov <[email-masked]>
Date: Mon, 16 Dec 2019 01:06:54 +0200

> this wish list bug is about the tab bar user interface, I'd like to
> navigate tabs via keyboard, probably without showing the tab bar:

Thanks for the feedback.  Tabs were designed to be usable even without
the tab bar, but this could be improved further indeed.

> Navigating tabs with "C-X t o" is error prone since it provides no
> feedback which tab is selected (different tabs may show identical window
> configurations at a specific point of time).  Perhaps it should show the
> name of the selected tab in the echo area?  Or the name of the
> tab could be shown in the mode line?

Most commands (new tab and close tab) already display the message,
but not when a tab is selected.  Thanks for noticing.  This is now
improved to show the name of the selected tab in the echo area.

> I'd prefer to navigate tabs like buffers via names and completion.
> This would be like switch-to-buffer, how about "C-X t t" as the default
> key binding?  This would happen in the echo area, therefore be less
> visual intrusive and keep the current window configuration visible
> till I choose the next one, while tab-list blanks the whole frame till I
> choose the next one from this list.

There is already the command like switch-to-buffer to select a tab by name
with completion.  The command name is 'tab-bar-select-tab-by-name'
(alias of 'tab-bar-switch-to-tab').  So you propose to bind it
to the key 'C-x t t'?  This key is the most convenient to type,
so it should be used for the most frequently used tab command.
Do you think 'tab-bar-switch-to-tab' would be the most frequently
used command?

> M-x tab-list creates a temporary tab, which looks like a buffer in a
> window, but is not shown for instance as a buffer in ibuffer.  Other
> than ibuffer or list-buffers which split the window and therefore
> provide some visual context, tab-list destroys this context.

Actually, tab-list was designed to not destroy the window configuration.
Unlike ibuffer or list-buffers that split the window, tab-list can't do
the same.  If tab-list will split the window, then after selecting
another tab in the list and later going back to the same tab, will
still display the window with tab-list, and the same window will be
presented in every tab that would be annoying.  Thus tab-list
takes care to not break user's window configurations.

> The names of the tabs are somehow centred vertically and horizontally,
> which irritates me.

They are centered to resemble the window list displayed by window managers
in the center of the screen when switching windows.  If you don't like this,
maybe there could be an option to display the list in the top left corner
of the frame?

> I would prefer tab-list to create a buffer which mimics list-buffers or
> better ibuffer.  This could be bound to "C-X t C-t".  Then I would have
> the choice to have a dedicated tab which shows this buffer or switch to
> it in a tab.  Perhaps it should be possible or even default to bury this
> tab list before switching to the next tab, in order to restore the
> windows configuration in the tab current when calling tab-list.

I don't understand how would use this dedicated tab to switch to it
from another tab.  Or do you want to use tab-list for other purposes,
not for selecting a tab from the list?

> Then for instance in ibuffer I can kill a line with C-K and yank it in
> another buffer.  This is not possible with the tab-list.  It only marks
> the tab on this line for deletion (which is ok) but does not copy it to
> the kill ring.

tab-list was modeled after list-buffers where C-k marks the buffer
for deletion.

There are so many features in ibuffer, many of them don't exist in
list-buffers, so I expect people will create packages that would
provide equivalents of many of them for tabs.