Subject: Re: bug#37667: 27.0.50; Tab Bar display problems with more than 5 tabs

From: Juri Linkov <[email-masked]>
Date: Mon, 14 Oct 2019 01:39:28 +0300

>> 1. Use something like word-wrap in the tab-bar to wrap
>>    to the second line non-broken tabs at tab boundaries;
>
> Yes, that's a possibility and shouldn't be hard to implement.

I'd like to keep the tab-bar multi-line.  No other application has
multi-line tab-bar - no web browsers, no other editors.  This could be
a unique Emacs feature that allows easier tab switching without
truncating tab names like web browsers do.  Even now it looks good,
but could be improved to wrap tabs better.

>> 2. Disable wrapping to the second line since it's not supported in -nw;
>
> Why isn't it supported on TTY frames, btw?  It seemed to me that the
> infrastructure is there, i.e. we can have FRAME_TAB_BAR_LINES(f) > 1,
> it's just that the code doesn't consider this possibility.

Is it possible for TTY frames to use the same code that implements
wrapping in multi-line tab-bar on graphical displays?

>> 3. Then truncate tab names to fit all tabs into the first line;
>
> This is not scalable.

I see that no one likes truncation of tab names.  Maybe this is because
buffer names in Emacs usually are not too long.

>> 4. Or don't truncate but allow scrolling tabs with mouse wheel;
>
> Yes, this could work as well (but scrolling should be possible not
> only with the mouse).  The implementation could simply hscroll the
> tab-bar window, including automatic hscrolling when the current tab is
> far from the leftmost one.  Maybe this alternative is the easiest
> one.  The only difficulty here is with TTY frames.

Maybe after adding a new option that disables multi-line
so tabs are displayed on one line, hscrolling could help
to center around the current tab.

5. There is another alternative: display arrow buttons on both sides
   of the tab-bar, clicking on arrows will hscroll tabs.

6. Or even better: clicking on such arrow buttons will pop up a menu of
   remaining tabs that don't fit into one-line tab-bar.
   This is like implemented recently for Info-history where clicking on
   the tool-bar arrow pops up a menu of previous Info nodes.  The same way
   clicking on the arrows on the tab-bar could pop up a menu of tabs whose
   names don't fit into the one-line tab-bar at both sides of the current tab.