GNU bug report logs - #79159
[PATCH] Do not display in the tab line tabs that are excluded.

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Sat, 2 Aug 2025 20:02:02 UTC

Severity: normal

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Full log


Message #59 received at 79159 <at> debbugs.gnu.org (full text, mbox):

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 79159 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#79159: [PATCH] Do not display in the tab line tabs that are
 excluded.
Date: Mon, 11 Aug 2025 22:29:36 -0600
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>> +(defvar tab-line-tabs-window-buffers-function
>> +  #'tab-line-tabs-window-buffers-default
>> +  "Function for get a list of window buffers.
>> +Used only for `tab-line-tabs-fixed-window-buffers'.")
>
> I wonder why do you need another indirection.  It should be
> sufficient to use tab-line-tabs-window-buffers-filter-function
> in the current implementation of tab-line-tabs-window-buffers,
> especially with the value 'identity' to keep current behavior.

That was to add a simple way to customize the listed buffers in
'tab-line-tabs-fixed-window-buffers', not to be another filter.  I've
reverted it anyways:

[0001-tab-line-Allow-to-hide-excluded-buffers-in-the-tab-l.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
>>> > +(defvar tab-line-tabs-window-buffers-filter-function
>>> > +  #'tab-line-tabs-window-buffers-filter-default
>>> > +  "Filter which buffers should be displayed in the tab line.")
>>> 
>>> Shouldn't this be defcustom?  Then you can add a const 'identity'
>>> to allow keeping excluded buffers.
>>
>> Didn't you say that keeping them produces buggy behavior?  If so, why
>> would we tempt users to produce bugs?
>
> It's not so simple.  Currently tab-line is disabled on these conditions:
>
>               (string-match-p "\\` " (buffer-name))
>               (memq major-mode tab-line-exclude-modes)
>               (buffer-match-p tab-line-exclude-buffers (buffer-name))
>               (get major-mode 'tab-line-exclude)
>               (buffer-local-value 'tab-line-exclude (current-buffer)))
>
> Buggy behavior is produced only on the first condition:
> when the buffer name begins with a space.
>
> So the default predicate should use exactly the same conditions
> in the filter to hide buffers on the tab-line.
>
> And also defcustom should provide another value to get back
> almost the same behavior as current, with one exception that
> buffers with names that begin with a space should be hidden too,
> i.e. the second value should match only one condition:
>
>               (string-match-p "\\` " (buffer-name))

From what I have tested, buffers that start with a space are unlikely to
appear on the tab line by default, so i don't think a new value is
necessary.

-- 
- E.G via Gnus and Org.

This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.