GNU bug report logs - #11088
24.0.94; minor mode cannot be cleanly turned off in idle timer

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sun, 25 Mar 2012 15:04:02 UTC

Severity: normal

Merged with 4081, 4093, 10459

Found in version 24.0.94

Fixed in version 24.4

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11088 in the body.
You can then email your comments to 11088 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to cyd <at> stupidchicken.com, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#11088; Package emacs. (Sun, 25 Mar 2012 15:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to cyd <at> stupidchicken.com, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Sun, 25 Mar 2012 15:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.94; minor mode cannot be cleanly turned off in idle timer
Date: Sun, 25 Mar 2012 22:32:03 +0800
[Message part 1 (text/plain, inline)]
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.

[t.el (application/emacs-lisp, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11088; Package emacs. (Sun, 25 Mar 2012 19:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 11088 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 11088 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>
Subject: Re: bug#11088: 24.0.94;
	minor mode cannot be cleanly turned off in idle timer
Date: Sun, 25 Mar 2012 14:28:21 -0400
> 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")))
>     map))

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


        Stefan




Merged 4081 4093 11088. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 25 Mar 2012 19:04:02 GMT) Full text and rfc822 format available.

Merged 4081 4093 10459 11088. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 25 Mar 2012 19:05:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11088; Package emacs. (Mon, 26 Mar 2012 12:04:01 GMT) Full text and rfc822 format available.

Message #15 received at 11088 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11088 <at> debbugs.gnu.org
Subject: Re: bug#11088: 24.0.94;
	minor mode cannot be cleanly turned off in idle timer
Date: Mon, 26 Mar 2012 19:31:27 +0800
On 2012-03-26 02:28 +0800, Stefan Monnier wrote:
> 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.

Stefan,

Could you document this limitation in run-with-timer or
run-with-idle-timer? I could do it but I might not understand the
problem well. Thanks.

Leo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11088; Package emacs. (Mon, 26 Mar 2012 18:36:02 GMT) Full text and rfc822 format available.

Message #18 received at 11088 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Leo <sdl.web <at> gmail.com>
Cc: 11088 <at> debbugs.gnu.org
Subject: Re: bug#11088: 24.0.94;
	minor mode cannot be cleanly turned off in idle timer
Date: Mon, 26 Mar 2012 14:03:40 -0400
>> 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.

> Could you document this limitation in run-with-timer or
> run-with-idle-timer?  I could do it but I might not understand the
> problem well. Thanks.

I don't think it's worth the trouble to try and document the problem
everywhere where it might appear (timers, process filters, process
sentinels, or any code run by them such as font-lock code, ...).

Better would be to fix it (basically, delay the initialization of
nmaps/submaps/defs in keyboard.c:read_key_sequence to after we did the
first "read_char").


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11088; Package emacs. (Tue, 27 Mar 2012 01:54:01 GMT) Full text and rfc822 format available.

Message #21 received at 11088 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 11088 <at> debbugs.gnu.org
Subject: Re: bug#11088: 24.0.94;
	minor mode cannot be cleanly turned off in idle timer
Date: Tue, 27 Mar 2012 09:21:58 +0800
On 2012-03-27 02:03 +0800, Stefan Monnier wrote:
> I don't think it's worth the trouble to try and document the problem
> everywhere where it might appear (timers, process filters, process
> sentinels, or any code run by them such as font-lock code, ...).
>
> Better would be to fix it (basically, delay the initialization of
> nmaps/submaps/defs in keyboard.c:read_key_sequence to after we did the
> first "read_char").

Is there a plan to fix it? If so wonderful. I am in the impression there
isn't thus the suggestion.

Leo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11088; Package emacs. (Tue, 27 Mar 2012 03:42:02 GMT) Full text and rfc822 format available.

Message #24 received at 11088 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: 11088 <at> debbugs.gnu.org
Subject: Re: bug#11088: 24.0.94;
	minor mode cannot be cleanly turned off in idle timer
Date: Mon, 26 Mar 2012 23:09:42 -0400
>> Better would be to fix it (basically, delay the initialization of
>> nmaps/submaps/defs in keyboard.c:read_key_sequence to after we did the
>> first "read_char").
> Is there a plan to fix it?

Thank you so much for volunteering.
Looking forward to your patch,


        Stefan ;-)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Nov 2014 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.