From unknown Fri Jun 20 07:10:08 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#10459 <10459@debbugs.gnu.org> To: bug#10459 <10459@debbugs.gnu.org> Subject: Status: Overlay keymaps ignored until point is moved when overlay is created from timer Reply-To: bug#10459 <10459@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:10:08 +0000 retitle 10459 Overlay keymaps ignored until point is moved when overlay is = created from timer reassign 10459 emacs submitter 10459 Toby Cubitt severity 10459 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 19:49:49 2012 Received: (at submit) by debbugs.gnu.org; 9 Jan 2012 00:49:50 +0000 Received: from localhost ([127.0.0.1]:50479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rk3Qq-00066O-PQ for submit@debbugs.gnu.org; Sun, 08 Jan 2012 19:49:49 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35441) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rk2Iu-0004OZ-Kj for submit@debbugs.gnu.org; Sun, 08 Jan 2012 18:37:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rk2Id-0000j4-Rn for submit@debbugs.gnu.org; Sun, 08 Jan 2012 18:37:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12 autolearn=no version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:41528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rk2Id-0000j0-QJ for submit@debbugs.gnu.org; Sun, 08 Jan 2012 18:37:15 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rk2Id-0003gQ-4e for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2012 18:37:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rk2Ic-0000ic-7s for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2012 18:37:15 -0500 Received: from starfish.geekisp.com ([216.168.135.166]:20084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rk2Ic-0000iY-2f for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2012 18:37:14 -0500 Received: (qmail 27092 invoked by uid 1003); 8 Jan 2012 23:37:12 -0000 Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Sun, 08 Jan 2012 18:37:10 -0500 Date: Sun, 8 Jan 2012 16:14:54 +0100 To: bug-gnu-emacs@gnu.org Subject: Overlay keymaps ignored until point is moved when overlay is created from timer Message-ID: <20120108145806.GA26632@c3po> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-PGP-Key: http://www.dr-qubit.org/gpg-toby.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) From: Toby Cubitt X-Primary-Address: toby@dr-qubit.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 08 Jan 2012 19:49:47 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Toby Cubitt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 22:53:26 2012 Received: (at 10459) by debbugs.gnu.org; 9 Jan 2012 03:53:26 +0000 Received: from localhost ([127.0.0.1]:50505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rk6IX-0001mp-1Y for submit@debbugs.gnu.org; Sun, 08 Jan 2012 22:53:26 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57670) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rk6IG-0001mP-U3 for 10459@debbugs.gnu.org; Sun, 08 Jan 2012 22:53:22 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q093qtK7010956; Sun, 8 Jan 2012 22:52:55 -0500 Received: by pastel.home (Postfix, from userid 20848) id E9C2358F7E; Sun, 8 Jan 2012 22:52:54 -0500 (EST) From: Stefan Monnier To: Toby Cubitt Subject: Re: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer Message-ID: References: <20120108145806.GA26632@c3po> Date: Sun, 08 Jan 2012 22:52:54 -0500 In-Reply-To: <20120108145806.GA26632@c3po> (Toby Cubitt's message of "Sun, 8 Jan 2012 16:14:54 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4095=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4095> : streams <718030> : uri <1043323> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 10459 Cc: 10459@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) Yes, this is a known limitation: the set of active keymaps is computed before waiting for the next key sequence. You might be able to get around this problem by pushing some dummy event (which you then bind to `ignore' in some keymap) onto unread-command-event from your timer, just to force a refresh. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 09:35:51 2012 Received: (at 10459) by debbugs.gnu.org; 16 Jan 2012 14:35:51 +0000 Received: from localhost ([127.0.0.1]:59912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rmnf5-0008JU-B0 for submit@debbugs.gnu.org; Mon, 16 Jan 2012 09:35:51 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183]:13074) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rmnf1-0008JJ-MY for 10459@debbugs.gnu.org; Mon, 16 Jan 2012 09:35:48 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EANYyFE9FxKkV/2dsb2JhbABDrCyBCoEGgXIBAQQBViMFCwsOJhIUGA0kiA21WIldAgEBCAIMEQMJAQEGAQUeCgQBAgEBAgECAQIBAQEBAoJ4AQYCAwcBBAEBAQELAgcBAwMNAQIDAQEDAgMFBAWDRwSIO5pjhFI X-IronPort-AV: E=Sophos;i="4.71,518,1320642000"; d="scan'208";a="156990362" Received: from 69-196-169-21.dsl.teksavvy.com (HELO ceviche.home) ([69.196.169.21]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 16 Jan 2012 09:34:52 -0500 Received: by ceviche.home (Postfix, from userid 20848) id D49BE6610D; Mon, 16 Jan 2012 09:34:51 -0500 (EST) From: Stefan Monnier To: Toby Cubitt Subject: Re: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer Message-ID: References: <20120116114811.GA20689@c3po> Date: Mon, 16 Jan 2012 09:34:51 -0500 In-Reply-To: <20120116114811.GA20689@c3po> (Toby Cubitt's message of "Mon, 16 Jan 2012 12:48:11 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10459 Cc: 10459@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > I've tested this, and it does indeed work. Thanks Stefan. Cool. It's an ugly hack, but for now it's the best I can offer ;-( > At the moment, for the dummy event, I'm using a keyboard event for an > unlikely unicode character with every modifier set. Is there some better > choice than this? Use a symbol like `toby-cubitt-dummy-event'. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 14:39:08 2012 Received: (at 10459) by debbugs.gnu.org; 16 Jan 2012 19:39:08 +0000 Received: from localhost ([127.0.0.1]:60638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RmsOY-00075l-PA for submit@debbugs.gnu.org; Mon, 16 Jan 2012 14:39:08 -0500 Received: from sanddollar.geekisp.com ([216.168.135.167]:28808) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rml4S-0003YW-6r for 10459@debbugs.gnu.org; Mon, 16 Jan 2012 06:49:53 -0500 Received: (qmail 10926 invoked by uid 1003); 16 Jan 2012 11:48:57 -0000 Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Mon, 16 Jan 2012 06:48:55 -0500 Date: Mon, 16 Jan 2012 12:48:11 +0100 To: Stefan Monnier Subject: Re: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer Message-ID: <20120116114811.GA20689@c3po> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.dr-qubit.org/gpg-toby.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) From: Toby Cubitt X-Primary-Address: toby@dr-qubit.org X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 10459 X-Mailman-Approved-At: Mon, 16 Jan 2012 14:39:05 -0500 Cc: 10459@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.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. > > You might be able to get around this problem by pushing some dummy event > (which you then bind to `ignore' in some keymap) onto > unread-command-event from your timer, just to force a refresh. I've tested this, and it does indeed work. Thanks Stefan. At the moment, for the dummy event, I'm using a keyboard event for an unlikely unicode character with every modifier set. Is there some better choice than this? Toby -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 25 15:04:19 2012 Received: (at control) by debbugs.gnu.org; 25 Mar 2012 19:04:19 +0000 Received: from localhost ([127.0.0.1]:38551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBsji-0001NE-G2 for submit@debbugs.gnu.org; Sun, 25 Mar 2012 15:04:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:35847) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBsjg-0001N5-Lv for control@debbugs.gnu.org; Sun, 25 Mar 2012 15:04:17 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SBsFa-0004C0-UX for control@debbugs.gnu.org; Sun, 25 Mar 2012 14:33:11 -0400 Date: Sun, 25 Mar 2012 14:33:10 -0400 Message-Id: Subject: control message for bug 10459 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) merge 4081 10459 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 04 21:21:31 2014 Received: (at 10459-done) by debbugs.gnu.org; 5 Oct 2014 01:21:31 +0000 Received: from localhost ([127.0.0.1]:33344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaaVu-0001Yd-Fx for submit@debbugs.gnu.org; Sat, 04 Oct 2014 21:21:30 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:49582) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaaVs-0001YU-0G for 10459-done@debbugs.gnu.org; Sat, 04 Oct 2014 21:21:28 -0400 Received: by mail-lb0-f178.google.com with SMTP id w7so2730294lbi.9 for <10459-done@debbugs.gnu.org>; Sat, 04 Oct 2014 18:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=vs9Dtxe7d9plKbLNJ40/Twgh8SiRl7ynnfQHyldOnN4=; b=RCgIvT5Zz91Z5rhWksixanvbfxqhlVAwbvtsfExaOtSzhntIuqHNSfs/DJflfT7HLv Ltfp9DYE2xCfAQNYhgb0qh5bPlgB0y0gwkwk1bb3Y7mwA7lp/Fje9Ysem1ljRK4iaEQk 5ag/y0N1g77mBcXFRM5utr2aZQ5Ngre0eQWRu6WfjIC7gBRC+kkdisWYUok0lW905alK xjQYl8/adU0ta6lOudPhwfVFHXQt1N3YISPF/DC6ERIOsZPH+SaFgHzXivKG9EyaAbKo GH0TL57noF0361iOqVXqLbjNqECJPbko0vBvC8QPHYa49pjN+zvRj7JqPTYtD9SEw8p2 by6w== X-Received: by 10.112.235.199 with SMTP id uo7mr14876277lbc.50.1412472086767; Sat, 04 Oct 2014 18:21:26 -0700 (PDT) Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id c10sm4226347laa.41.2014.10.04.18.21.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 04 Oct 2014 18:21:26 -0700 (PDT) From: Dmitry Gutov To: Toby Cubitt Subject: Re: bug#10459: Overlay keymaps ignored until point is moved when overlay is created from timer References: <20120108145806.GA26632@c3po> <20120116114811.GA20689@c3po> Date: Sun, 05 Oct 2014 05:21:25 +0400 In-Reply-To: <20120116114811.GA20689@c3po> (Toby Cubitt's message of "Mon, 16 Jan 2012 12:48:11 +0100") Message-ID: <86zjdb8g6i.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 10459-done Cc: 10459-done@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. From unknown Fri Jun 20 07:10:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Nov 2014 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator