unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Toby Cubitt <tsc25@cantab.net>
To: 10459@debbugs.gnu.org
Subject: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer
Date: Sun, 8 Jan 2012 16:14:54 +0100	[thread overview]
Message-ID: <20120108145806.GA26632@c3po> (raw)

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





             reply	other threads:[~2012-01-08 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-08 15:14 Toby Cubitt [this message]
2012-01-09  3:52 ` bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer Stefan Monnier
2012-01-16 11:48   ` Toby Cubitt
2012-01-16 14:34     ` Stefan Monnier
2014-10-05  1:21     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120108145806.GA26632@c3po \
    --to=tsc25@cantab.net \
    --cc=10459@debbugs.gnu.org \
    --cc=toby-predictive-dated-1327275432.bb87aa@dr-qubit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).