GNU bug report logs -
#6256
24.0.50; read-event in `repeat' command
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Mon, 24 May 2010 15:13:02 UTC
Severity: normal
Found in version 24.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> I was thinking that that code would work because it remains abstract (in
> principle). It just decomposes the event into its components and compares
> those. There is (in principle) nothing platform-specific about it.
In principle, your message call should have generated a message.
In principle my
(eq (or (car-safe evt) evt)
(or (car-safe repeat-repeat-char)
repeat-repeat-char))
is 100% equivalent (tho more efficient) to your
(and (equal (event-basic-type evt)
(event-basic-type repeat-repeat-char))
(equal (event-modifiers evt)
(event-modifiers repeat-repeat-char))))
But obviously, there's more at play here.
>> That on X11, the second event is *not* the same as the first because
>> mouse wheel send first a down and then an up event.
> I see. So it sounds like we need an abstraction to deal with that -
> I'd think that would be useful anyway. After all, there is no good
> reason to distinguish the first wheel rotation (in a given direction).
> At least there is no good reason to _always_ do that, even if someone
> might find a reason why that might be useful sometimes.
[ You're misunderstanding. ]
I know how to deal with the X11 side. It's dealt with, the code works.
Let's concentrate on your case. E.g.:
>> You could also try
>> (while (let ((evt (read-event)))
>> (message "EVT: %S, R-R-CHAR: %S" evt repeat-repeat-char)
>> (and (equal (event-basic-type evt)
>> (event-basic-type repeat-repeat-char))
>> (equal (event-modifiers evt)
>> (event-modifiers repeat-repeat-char))))
>> (repeat repeat-arg))
Or adding the suggested `message' calls before/after read-key or
elsewhere to try and see what are the values of repeat-repeat-char at
various places rather than try and guess them.
Stefan
This bug report was last modified 14 years and 271 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.