bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50256: thing-at-mouse


From: Eli Zaretskii
Subject: bug#50256: thing-at-mouse
Date: Thu, 02 Sep 2021 18:59:24 +0300

> Cc: larsi@gnus.org, juri@linkov.net, 50256@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> Date: Thu, 2 Sep 2021 16:43:02 +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?
> 
> No.  The above was meant in response to your earlier:
> 
>    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.
> 
> I mean that we needn't do that because pos_visible_p already does it.
> So I'd just propose to do the trivial (line numbers are not trunk's);

Yes, but I'd prefer that we first established what is the desired
behavior in this case:

>    (pop-to-buffer "*Messages*")
>    (with-current-buffer "*scratch*"
>      (pos-visible-in-window-p nil nil t)))

IOW, what to do when WINDOW is the selected window, but the current
buffer is not the buffer shown in WINDOW?

Would you please humor me with an answer to my question?  I'd also
like to hear from Lars and Juri about this.  Without the agreement
about the behavior in that use case, I don't see how we can reason
about the fix.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]