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

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

Re: keymap changes in run-with-timer


From: Stefan Monnier
Subject: Re: keymap changes in run-with-timer
Date: Fri, 13 Apr 2007 09:57:35 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

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


        Stefan




reply via email to

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