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".
Indeed it does: the list of active keymaps is computed right before calling
`read', i.e. right when going idle at the end of the previous command.
It would probably be good to delay it, but this is not very high priority.
I've added it to the TODO list.