[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#11088: 24.0.94; minor mode cannot be cleanly turned off in idle time
bug#11088: 24.0.94; minor mode cannot be cleanly turned off in idle timer
Sun, 25 Mar 2012 14:28:21 -0400
Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)
> 1. emacs -q -l t.el
> 2. C-c w
> 3. let emacs idle for more than 2 seconds
> 4. type `l'
> You should still see the message "hello world" printed, which is odd
> since I expect the minor mode turned off by now.
> (defvar test-mode-map
> (let ((map (make-sparse-keymap)))
> (define-key map "l" (lambda () (interactive) (message "Hello World")))
> (define-minor-mode test-mode ""
> :global t
> (if test-mode
> (run-with-idle-timer 2 nil 'test-mode -1)))
> (global-set-key "\C-cw" 'test-mode)
It's a known problem: the set of active keymaps is computed before Emacs
starts waiting for the next key-sequence and is not recomputed after
running idle timers and process filters.