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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 02 Sep 2021 10:46:04 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: martin rudalics <[email-masked]>,  [email-masked],  [email-masked]
> Date: Thu, 02 Sep 2021 09:32:56 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >>    "The argument POSITION defaults to the current position
> >>     of point in WINDOW; WINDOW defaults to the selected window."
> >> 
> >> If the current buffer is not shown in WINDOW, the first part of this
> >> sentence is wrong.
> >
> > So the only problem is that of inaccurate documentation?
> 
> The doc string makes sense to me (that is, if it did what it said, it'd
> be good).  That it doesn't do this is a bug, in my opinion.

Our doc strings didn't descend on us from Mt Sinai, and aren't carved
in stone.  They were written by people, and may include hidden
assumptions those people had in mind that could make other people
interpret them incorrectly.  So to decide that the code is wrong and
the documentation is right, we need more evidence than just what the
current documentation literally says.

If we want to support the current documentation to the letter, the
only way of doing that I know of is to force WINDOW to display the
current buffer, at least internally, i.e. to switch to the WINDOW's
buffer for the duration of pos-visible-in-window-p.  If that leaves
everyone happy, it could be done relatively easily, but then I wonder
why does the code in question with-current-buffer, and what would
break when pos-visible-in-window-p internally switches back to the
buffer shown in WINDOW?