Subject: bug#54038: 29.0.50; doc-view cannot show different pages in different tabs

From: Juri Linkov <[email-masked]>
Date: Sat, 19 Feb 2022 19:35:33 +0200

> The problem is that when 'image-mode-winprops' does window cleanup,
> it doesn't take into account windows saved in tabs.

The current implementation:

  (when cleanup
    (setq image-mode-winprops-alist
  	  (delq nil (mapcar (lambda (winprop)
			      (let ((w (car-safe winprop)))
				(if (or (not (windowp w)) (window-live-p w))
				    winprop)))
  			    image-mode-winprops-alist))))

'window-live-p' doesn't check windows saved in window-configurations in tabs.

Maybe it should check tab window-configurations on all frames
by a new function 'window-configuration-windows'
(something like used in 'tab-bar-get-buffer-tab').

But then what about windows saved by 'window-configuration-to-register'?
Should they be checked by 'window-live-p' too?

Or maybe better to change 'image-mode-winprops-alist' to the hash
'image-mode-winprops-hash' where window keys are garbage-collected?
So when a window is deleted from all window-configurations,
it will be garbage-collected?