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: Eli Zaretskii
Subject: Re: mouse-face and help echo support for xterm mouse
Date: Wed, 04 Nov 2020 17:19:57 +0200

> Date: Tue, 03 Nov 2020 22:54:32 -0800
> Cc: "Jared Finder via \"Emacs development discussions.\"" 
> <emacs-devel@gnu.org>
> From: Jared Finder via "Emacs development discussions." <emacs-devel@gnu.org>
> 
> 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.

Thanks, see below.

> Two specific questions:
> 
> 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?

Not sure why is this important.  You want to remove the hold_quit
stuff from the code?  I don't see that it complicates the code, so I'd
suggest not to waste your time on worrying about it.  Just leave it
alone.

> 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.

No, new file for a single function is too much.  dispnew.c, I guess.

>        while (gpm = Gpm_GetEvent (&event), gpm == 1) {
> -       nread += handle_one_term_event (tty, &event, &gpm_hold_quit);
> +       nread += handle_one_term_event (tty, &event);

As explained above, I'd leave the signature alone, because it is not
guaranteed that every subroutine we call here doesn't need to use it.

> -  if (ie.kind != NO_EVENT)

I also don't think it's a good idea to remove this test.  The
functions you call don't guarantee to always return a meaningful
event, and the assertion you leave instead is too drastic: imagine
that it happens to some innocent user.

> +    kbd_buffer_store_event_hold (&ie, NULL);

If we eventually decide not to use the hold_quit stuff, you can just
call kbd_buffer_store_event here.

Thanks.



reply via email to

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