Subject: bug#68235: 29.1.90; Switching tabs stops following process output in selected window

From: Juri Linkov <[email-masked]>
Date: Tue, 09 Apr 2024 09:53:41 +0300

> I'll call it `window-restore-killed-buffer-windows' and install in a
> week unless new issues come up.

I found one interesting problem with `window-restore-killed-buffer-windows'.
Here is a reproducible test case:

0. emacs -Q
1. cd etc/images/
2. RET to visit the first image
3. C-x t 2
4. n to visit the next image
5. C-x t o

The previous tab shows:

  "This window displayed the buffer ‘ **lose**’."

What it expected here instead of **lose**
is the real file buffer with the previous image.

The problem is that 'image-next-file' calls 'find-alternate-file'
that does such buffer renaming:

    (if (get-buffer " **lose**")
	(kill-buffer " **lose**"))
    (rename-buffer " **lose**")

and 'rename-buffer' changes the buffer's last name to **lose**.