[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
keymap changes in run-with-timer
From: |
Nikolaj Schumacher |
Subject: |
keymap changes in run-with-timer |
Date: |
Fri, 13 Apr 2007 10:45:05 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (darwin) |
Hello,
selecting a keymap (e.g. when changing minor-mode, creating 'keymap
overlays, setting overriding-local-map, use-local-map) in a
run-with-timer or run-with-idle-timer event doesn't take immediate
effect.
Consider the following example:
(run-with-timer 3 nil '(lambda ()
(let ((map (make-sparse-keymap)))
(define-key map "x" "y")
(use-local-map map))
(message "timer fired")))
After the message "timer fired", pressing the "x" key still inserts an
"x". Only beginning with the second time it will insert a "y".
Changing the /content/ of a keymap like this:
(run-with-timer 3 nil '(lambda ()
(define-key (current-local-map) "x" "y")
(message "timer fired")))
works immediately, though.
regards,
Nikolaj Schumacher
In GNU Emacs 22.0.97.2 (i386-apple-darwin8.9.1, Carbon Version 1.6.0)
of 2007-04-05 on wednesday
Windowing system distributor `Apple Inc.', version 10.4.9
configured using `configure
'--prefix=/Applications/Emacs.app/Contents/Resources' '--with-carbon'
'--without-x' '--libexecdir=/Applications/Emacs.app/Contents/MacOS/libexec'
'CFLAGS=-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DUSE_ATSUI''
- keymap changes in run-with-timer,
Nikolaj Schumacher <=