Subject: Re: bug#75935: tab-bar-select-tab buffer-list and buried-buffer-list bug

From: Juri Linkov <[email-masked]>
Date: Thu, 30 Jan 2025 09:35:18 +0200

> Happy to submit a patch for this but first wanted to discuss it to make
> sure there's agreement.
>
> (defun tab-bar-select-tab (&optional tab-number)
> ...
>             (when wc-bl  (set-frame-parameter nil 'buffer-list wc-bl))
>             (when wc-bbl (set-frame-parameter nil 'buried-buffer-list
> wc-bbl))
>
> What this skips is that if either the originating window-configuration
> buffer-list or its twin is nil, that the frame's parameters are not
> properly reset to nil.
>
> This is a function that we've had to work around in an ELPA package by
> advising tab-bar--tab to first clear these frame parameters before
> tab-bar-select-tab goes to set them when selecting the specified tab. This
> avoids the bug, but is annoying. This advice has been in place for three
> years without issue.
>
> The patch would eliminate the 'when' conditions.
>
> What do you think?

Thanks for finding this bug!

A week ago I fixed a similar bug in 6b71d0b1786
where needed to reset tab-bar-history-back to nil
after selecting the specified tab.
We should do the same for buffer-lists as well.

So you proposed the right fix.  Please submit a patch.
Then I will push all your other patches too.