GNU bug report logs - #50256
thing-at-mouse

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 29 Aug 2021 17:44:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #107 received at 50256 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50256 <at> debbugs.gnu.org, larsi <at> gnus.org, juri <at> linkov.net
Subject: Re: bug#50256: thing-at-mouse
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);

diff --git a/src/window.c b/src/window.c
index cb8fe5fcdb..bfbed01749 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2199,8 +2199,6 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
     posint = -1;
   else if (!NILP (pos))
     posint = fix_position (pos);
-  else if (w == XWINDOW (selected_window))
-    posint = PT;
   else
     posint = marker_position (w->pointm);

martin




This bug report was last modified 3 years and 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.