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 #65 received at 50256 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: rudalics <at> gmx.at, larsi <at> gnus.org, 50256 <at> debbugs.gnu.org
Subject: Re: bug#50256: thing-at-mouse
Date: Wed, 01 Sep 2021 22:23:45 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: martin rudalics <rudalics <at> gmx.at>,  larsi <at> gnus.org,  50256 <at> debbugs.gnu.org
> Date: Wed, 01 Sep 2021 20:59:59 +0300
> 
> >> 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?
> 
> In bug#9923 'C-h m' switched to another buffer before calling
> mouse-set-point.

Then it's a bug in that command, I'd say.  You assume something about
last-input and what mouse-set-point and posn-set-point will do when
last-input is not a click event.  And that assumption turns out to be
false.  So instead of making that assumption, why not give the code a
valid event to work with instead?

posn-at-point cannot work correctly when current buffer and the
selected window's buffer are not the same, because they use display
code which is based on that contract.  If you break the contract by
the likes of with-current-buffer, you will be lucky not to crash, let
alone cause errors.




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.