this question is related to the question How to know my buffer's visible/focused status?.
I would like to check if there exists a frame in which a given buffer is visible.
I tried the following but it gives true even if scratch
is invisible.
(get-buffer-window (find-buffer-visiting "*scratch*") 'visible)
(get-buffer-window "*scratch*" 'visible)