GNU bug report logs - #6256
24.0.50; read-event in `repeat' command

Previous Next

Package: emacs;

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 6256 <at> debbugs.gnu.org
Subject: bug#6256: 24.0.50; read-event in `repeat' command
Date: Mon, 18 Oct 2010 14:40:17 -0400
>> If you want to test for yourself, then:
>> 1. Load the Bookmark+ files (see below).

It's not exactly self-contained and going through all those links to
finally download each file is rather inconvenient.  So in order to help
me help you, in the future, please try and make it easier.  E.g. with
a single download, and then a single load-file.

>> 4. Now try C-x p followed by repeated mouse-wheel down or up 
>> movements.  You should see the same movement to each bookmark
>> in turn, and the same position messages.  With your code the wheel
>> repetition does not work.

Indeed it doesn't work.

>>  With the code I sent it does work.
>> This is the `while' condition I sent (again):

>> (while (let ((evt  (read-event)))
>> (and (equal (event-basic-type evt)
>> (event-basic-type repeat-repeat-char))
>> (equal (event-modifiers evt)
>> (event-modifiers repeat-repeat-char))))

But that doesn't work either in my tests: the problem is that the
last-command-event was `mouse-4' (i.e. the up event) whereas read-event
returns `down-mouse-4' (a subsequent read-event would return the
`mouse-4').

For my case, replacing the read-event by `read-key' happens to make
it work (see patch below).  Please confirm whether or not it fixes it
for you, and if it doesn't, please show me the values of
`repeat-repeat-char' and `evt' in the above test.


        Stefan


=== modified file 'lisp/repeat.el'
--- lisp/repeat.el	2010-09-11 18:23:45 +0000
+++ lisp/repeat.el	2010-10-18 18:34:24 +0000
@@ -335,7 +335,7 @@
 	(setq real-last-command 'repeat)
 	(setq repeat-undo-count 1)
 	(unwind-protect
-	    (while (let ((evt (read-event))) ;FIXME: read-key maybe?
+	    (while (let ((evt (read-key)))
                      ;; For clicks, we need to strip the meta-data to
                      ;; check the underlying event name.
                      (eq (or (car-safe evt) evt)





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.