Subject: bug#79159: [PATCH] Do not display in the tab line tabs that are excluded.

From: Eli Zaretskii <[email-masked]>
Date: Sun, 03 Aug 2025 08:13:41 +0300

> From: Elijah Gabe Pérez <[email-masked]>
> Date: Sat, 02 Aug 2025 14:00:27 -0600
> 
> tab-line by default displays all the tabs in the tab line, however this
> also includes the tab that are excluded in 'tab-line-exclude-modes' and
> 'tab-line-exclude-buffers', which IMO makes no sense.

I think "makes no sense" is in the eyes of the beholder.  These
variables determine which buffers should have the tab-line shown in
their windows, they don't mean these buffers should not be reachable
via the tab-line in other buffers.  Hiding them in all tab-lines means
you cannot switch to those buffers except via "C-x b" or somesuch.
That is not the intent of these variables, AFAIU.  Their intent is to
disable tab-line in buffers where showing the tab-line makes no sense.
The default value of tab-line-exclude-modes is a good example of that.

But I won't object to adding a knob to have the behavior you want, if
Juri agrees, and there are no other objections.  However, this must be
an opt-in behavior, by default off.

> Currently, it only works for 'tab-line-tabs-fixed-window-buffers'.

Which IMO is a limitation that should be lifted, for this feature to
make sense.  I expect to see bug reports if we don't.

> +*** 'tab-line-tabs-fixed-window-buffers' now hides the excluded tabs.
> +All the buffers included in 'tab-line-exclude-buffers' and
> +'tab-line-exclude-modes' will not appear in the tab line only if
> +'tab-line-tabs-function' is set to 'tab-line-tabs-fixed-window-buffers'.

A buffer cannot be "included" in a list of modes, so talking about a
buffer included in tab-line-exclude-modes is confusing.  I suggest to
reword:

  *** Excluded buffers are no longer shown in tab-lines of other buffers.
  Buffers that match 'tab-line-exclude-buffers' and buffers whose
  modes are in 'tab-line-exclude-modes' will not appear in tab-lines
  of other buffers.

Also, why isn't there either "+++" (and a suitable change to the
manual) or "---" for this entry?  We don't want to defer the decision
whether and how to document the changes in the manuals to the time
when a release will be prepared, we want to make the necessary
documentation changes right away.  So let's please decide now whether
this change deserves to be mentioned in the manuals, and act
accordingly.

Thanks.