emacs-devel
[Top][All Lists]
Advanced

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

Re: mouse-face and help echo support for xterm mouse


From: Stefan Monnier
Subject: Re: mouse-face and help echo support for xterm mouse
Date: Wed, 04 Nov 2020 09:13:07 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Toward proving that the code could be shared, I refactored the GPM mouse
> logic so that it was clearly apparent how to share it with
> handle-lisp-mouse-motion.  That patch is attached.  I'd like to make sure
> this looks like an appropriate change to make.  If so, I will finish up
> the patch.

Hmm... this `handle_one_term_event` seems weirdly complex.
I don't understand it enough to judge if your rewrite is OK.

> 1. To enable sharing logic, I need to encode a handful of assumptions that
>    I believe are true today (example: no need to handle quit-char in GPM
>   handling).  Do these assumptions look reasonable?

I don't know.  I don't even know why `hold_quit` is called that way:
I can't see any reason why it should hold "quit" events more than
anything else.

In the patch below I slightly tweaked the code to simplify the control
flow a tiny bit and to follow our coding convention on placement of
braces, and more importantly I added assertions which I believe always
hold along with comments pointing out things I don't understand.

Could someone help me clarify what's going on?

> 2. In what file should such a shared function go?  My initial thought is
>    a new file "mouse.c" as it would hold shared mouse logic.

I suspect it would end up being fairly empty, and while I hate the
monster xdisp.c file, I also don't really like tiny files, so I'd prefer
if we could find a better home for it.


        Stefan




reply via email to

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