[Top][All Lists]

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

Re: master 2d15641: * lisp/mouse.el (context-menu-map): Fix when menu is

From: Juri Linkov
Subject: Re: master 2d15641: * lisp/mouse.el (context-menu-map): Fix when menu is a command (bug#50851)
Date: Wed, 29 Sep 2021 10:04:05 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> -     (defn (key-binding key t)))
>> +     (defn (save-excursion (mouse-set-point event) (key-binding key t))))
> Could you add a comment explaining why it is safe to do that even though
> it can mess with the selected window(&frame)?

Before pushing this change, I've tested whether it works
when a context menu item is clicked in a non-selected window
after 'C-h k', and everything was fine.  But probably
I don't understand what problem it might cause.

> [ IIRC you used a similar chunk of code recently in that vicinity, so
>   I guess my question applies to that as well.  ]

Maybe a similar change was using window-point in event-end?
But then window-point in event-end will help to use the right
buffer's point in the above change with (mouse-set-point event).

reply via email to

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