Subject: bug#50256: thing-at-mouse

From: Eli Zaretskii <[email-masked]>
Date: Wed, 01 Sep 2021 20:54:06 +0300

> Cc: [email-masked], [email-masked], [email-masked]
> From: martin rudalics <[email-masked]>
> Date: Wed, 1 Sep 2021 18:21:00 +0200
> 
>  >> (progn
>  >>     (with-current-buffer "*Messages*"
>  >>       (goto-char (point-min)))
>  >>     (pop-to-buffer "*Messages*")
>  >>     (with-current-buffer "*scratch*"
>  >>       (pos-visible-in-window-p nil nil t)))
>  >>
>  >> This reports visibility for the position of point in *scratch* and not
>  >> that of the window point of the selected *Messages* window.
>  >
>  > But you've switched to *scratch* in the selected window, so why is
>  > that a problem?
> 
> I have only run `with-current-buffer'.  The selected window shows
> *Messages*.

Then what is the semantics of the code snippet above, and why did you
call with-current-buffer the second time?  What did you want to
accomplish, except make a point?

IOW, what kind of real-life situation needs such a code?

> (pos-visible-in-window-p nil nil t) should never return nil as it
> does in the above recipe.

Why not?