Subject: Re: bug#50256: thing-at-mouse

From: Eli Zaretskii <[email-masked]>
Date: Thu, 02 Sep 2021 16:13:17 +0300

> Cc: [email-masked], [email-masked], [email-masked]
> From: martin rudalics <[email-masked]>
> Date: Thu, 2 Sep 2021 14:42:15 +0200
> 
>  >> pos_visible_p already does
>  >>
>  >>     if (XBUFFER (w->contents) != current_buffer)
>  >>       {
>  >>         old_buffer = current_buffer;
>  >>         set_buffer_internal_1 (XBUFFER (w->contents));
>  >>       }
>  >
>  > I'm asking if this is the desired behavior, when Lisp runs this inside
>  > with-current-buffer?
> 
> It is the _necessary_ behavior when WINDOW is not the selected window
> and its buffer is not current.

But in the case in point, WINDOWS _was_ the selected window.  That's
why pos-visible-in-window-p used PT.  Which is what you said was the
bug.  Or am I missing something?