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

From: Juri Linkov <[email-masked]>
Date: Wed, 23 Feb 2022 19:46:59 +0200

>> Maybe a more immediate solution would be simply to iterate all tabs
>> on all frames, and to check whether they contain a window.  But still
>> I can't find a function to check whether a window is in a window configuration.
>> Does such a function exist?
>
> No.  The only agent that has access to all window configurations is the
> garbage collector.  Do you want to collect garbage each time you want to
> know whether a window is part of a window configuration?
>
>> Like in bug#54038 (about having access to windows in window configurations),
>> the problem is that there is no way to update and even peek inside
>> a window configuration.  In bug#54038 the cleanup function can't tell
>> if a window is still live in a window configuration.
>
> We might be able to provide such a function but can you tell me why you
> would need it and how you would use it?

It could be used in 'image-mode-winprops':

  (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)
           new function =>              (window-live-in-all-window-configurations w))
				    winprop)))
  			    image-mode-winprops-alist))))