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

From: Juri Linkov <[email-masked]>
Date: Sun, 10 Aug 2025 21:35:35 +0300

> +(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.

> +(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.

> @@ -598,7 +626,10 @@ tab-line-tabs-fixed-window-buffers
>                                (lambda (buf idx) (puthash buf idx index-table))
>                                old-buffers)
>                               index-table))
> -         (new-buffers (sort (tab-line-tabs-window-buffers)
> +         (buffers (funcall
> +                   tab-line-tabs-window-buffers-filter-function
> +                   (funcall tab-line-tabs-window-buffers-function)))
> +         (new-buffers (sort buffers

Then the above change is not needed too.