bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#6256: 24.0.50; read-event in `repeat' command


From: Stefan Monnier
Subject: bug#6256: 24.0.50; read-event in `repeat' command
Date: Mon, 18 Oct 2010 14:40:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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






reply via email to

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