Subject: bug#10459: closed (Re: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 05 Oct 2014 01:22:03 +0000

Your bug report

#10459: Overlay keymaps ignored until point is moved when overlay is created from timer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
10459: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10459
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer
From: Dmitry Gutov <[email-masked]>
To: Toby Cubitt <[email-masked]>
Cc: [email-masked], Stefan Monnier <[email-masked]>
Date: Sun, 05 Oct 2014 05:21:25 +0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

> On Sun, Jan 08, 2012 at 10:52:54PM -0500, Stefan Monnier wrote:
>> Yes, this is a known limitation: the set of active keymaps is computed
>> before waiting for the next key sequence.

This has been fixed around the start of 24.4 development: the set of
keymaps is recomputed at the start of a key sequence.

The examples in this and merged bugs work for me now. Please feel free
to reopen if you see a case where the problem's not fixed.

Subject: Overlay keymaps ignored until point is moved when overlay is created from timer
From: Toby Cubitt <[email-masked]>
To: [email-masked]
Date: Sun, 8 Jan 2012 16:14:54 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Emacs versions known to be affected:
------------------------------------
23.2.1, 24 (recent bzr checkout).

Steps to reproduce:
-------------------

1. Define the following function:

(defun test ()
  (interactive)
  (run-with-timer 
   2 nil
   (lambda ()
     (setq overlay (make-overlay 4 8))
     (overlay-put overlay 'face '(background-color . "black"))
     (let ((map (make-sparse-keymap)))
       (overlay-put overlay 'keymap map)
       (define-key map "t" (lambda () (interactive) 
			     (message "overlay keymap binding")))))))

2. Position point somewhere between 4 and 8.

3. M-x test

4. type "t" (*without* moving point first)

Expected output:
----------------
Overlay keymap binding should display the message "overlay keymap binding".

Actual output:
--------------
Default `self-insert-command' binding inserts character "t" into the buffer.

Additional information:
-----------------------
Note that moving the point, e.g. one character to the right and then back,
in between septs 3. and 4. seems to activate the overlay keymap binding,
so that typing "t" in step 4. displays the correct message.

-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain