From unknown Fri Jun 20 07:19:35 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#4081 <4081@debbugs.gnu.org> To: bug#4081 <4081@debbugs.gnu.org> Subject: Status: Overlay keymap and timers Reply-To: bug#4081 <4081@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:19:35 +0000 retitle 4081 Overlay keymap and timers reassign 4081 emacs submitter 4081 Mihai Bazon severity 4081 normal thanks From mihai@bazon.net Sat Aug 8 02:46:05 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Aug 2009 09:46:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n789k2sN008808 for ; Sat, 8 Aug 2009 02:46:04 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZiUz-0000y0-Gv for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2009 05:46:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZiUy-0000xi-D8 for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2009 05:46:00 -0400 Received: from [199.232.76.173] (port=50551 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZiUx-0000xa-Vl for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2009 05:46:00 -0400 Received: from mx20.gnu.org ([199.232.41.8]:5873) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MZiUx-00020X-6m for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2009 05:45:59 -0400 Received: from ip-72-55-183-145.static.privatedns.com ([72.55.183.145] helo=v1.dynarch.com) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MZiUv-0007kN-Jl for bug-gnu-emacs@gnu.org; Sat, 08 Aug 2009 05:45:57 -0400 Received: by v1.dynarch.com (Postfix, from userid 5001) id BFBF01D80002; Sat, 8 Aug 2009 12:24:53 +0300 (EEST) Received: from v3.dynarch.com (ip-72-55-183-147.static.privatedns.com [72.55.183.147]) by v1.dynarch.com (Postfix) with SMTP id AEAEB1DCC5D for ; Sat, 8 Aug 2009 12:24:51 +0300 (EEST) Received: (nullmailer pid 23120 invoked by uid 65534); Sat, 08 Aug 2009 09:24:51 -0000 MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF8" Date: Sat, 8 Aug 2009 12:24:51 +0300 Subject: Overlay keymap and timers To: bug-gnu-emacs@gnu.org From: Mihai Bazon X-Mailer: XUHEKI - Dynarch.com WebMail Message-Id: <3404e64848e91742a2a6e2e51ca8a285@bazon.net> X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Hi folks, I identified a possible bug, just wondering if there's a known workaround. Please CC me in any reply as I'm not subscribed to the list. Short description =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D When creating overlays in a function called by run-with-timer, their keymap becomes available only *after* some key has been pressed. Sample code =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq counter 0) (setq my-keymap (make-sparse-keymap)) (define-key my-keymap (kbd "M-n")=20 (lambda() (interactive) (message "Got it %s!" (setq counter (+ counter 1))))) =20=20=20=20 (defun my-highlight () (interactive) (save-excursion (beginning-of-buffer) (while (search-forward-regexp "\\" nil t) (let ((overlay (make-overlay (- (point) 7) (point)))) (overlay-put overlay 'face 'highlight) (overlay-put overlay 'evaporate t) ;; using 'local-map doesn't make any difference (overlay-put overlay 'keymap my-keymap) (overlay-put overlay 'my-property t))))) =20=20=20=20 (defun my-highlight-with-timer () (interactive) (run-with-timer 0.5 nil 'my-highlight)) =20=20=20=20 (defun my-highlight-clear () (interactive) (remove-overlays (point-min) (point-max) 'my-property t)) Eval this code, then type "overlay" in some buffer and move the caret somewhere in the middle of the word. * Case 1. M-x my-highlight. The word gets colored. If you press M-n, it will display "Got it 1!" in the minibuffer -- works as expected. Now clear it with M-x my-highlight-clear. * Case 2. M-x my-highlight-with-timer. After half a second, the word gets colored. If we immediately press M-n now, we get "M-n is=20 undefined". However, pressing M-n a second time works. Clear it again with my-highlight-clear. * Case 3. M-x my-highlight-with-timer, then press some key such as C-f (make sure the cursor doesn't leave the overlay). Then pressing M-n works as expected. My guess is that the keymap becomes active the moment a key is released (?) (or in some post-command-hook?) and the cursor is within the overlay. So if set without a timer, it gets a chance to be activated straight away, but with a timer there isn't any key release to trigger it so it becomes active only after some key has been pressed. Not sure if this is a bug, but it's sure annoying and I've no idea how to work around it. Any help is appreciated. Cheers, -Mihai= From mihai@bazon.net Sun Aug 9 06:57:37 2009 Received: (at 4081) by emacsbugs.donarmstrong.com; 9 Aug 2009 13:57:37 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from v1.dynarch.com (ip-72-55-183-145.static.privatedns.com [72.55.183.145]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n79DvauP003391 for <4081@emacsbugs.donarmstrong.com>; Sun, 9 Aug 2009 06:57:37 -0700 Received: by v1.dynarch.com (Postfix, from userid 5001) id 163761DCC61; Sun, 9 Aug 2009 16:53:53 +0300 (EEST) Received: from v3.dynarch.com (ip-72-55-183-147.static.privatedns.com [72.55.183.147]) by v1.dynarch.com (Postfix) with SMTP id C39051DCC5D for <4081@emacsbugs.donarmstrong.com>; Sun, 9 Aug 2009 16:53:47 +0300 (EEST) Received: (nullmailer pid 1813 invoked by uid 65534); Sun, 09 Aug 2009 13:53:47 -0000 MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF8" Date: Sun, 9 Aug 2009 16:53:47 +0300 Subject: Overlay keymap and timers To: 4081@debbugs.gnu.org From: Mihai Bazon X-Mailer: XUHEKI - Dynarch.com WebMail Message-Id: <5f7538d77870fe4c3591660320e45259@bazon.net> Actually, it seems it hasn't anything to do with overlays: (defun my-set-keymap-with-timer () (interactive) (run-with-timer 0.5 nil (lambda() (use-local-map my-keymap) (message "Done setting keymap")))) If we eval the following and M-x my-set-keymap-with-timer, the keymap will only be enforced after the first keypress (i.e. first press of M-n says "M-n is undefined", but subsequently it works). Found another thread about this issue here: http://www.mail-archive.com/emacs-pretest-bug@gnu.org/msg12003.html Stallman says "we should consider that a serious problem". ;-) Cheers, -Mihai= From rgm@gnu.org Mon Aug 10 13:55:48 2009 Received: (at control) by emacsbugs.donarmstrong.com; 10 Aug 2009 20:55:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.5 required=4.0 tests=AWL,ONEWORD autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7AKtkh9030770 for ; Mon, 10 Aug 2009 13:55:48 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MabuD-0004wr-42; Mon, 10 Aug 2009 16:55:45 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19072.35153.46871.538804@fencepost.gnu.org> Date: Mon, 10 Aug 2009 16:55:45 -0400 From: Glenn Morris To: control Subject: control merge 4082 3420 reassign 4084 notemacs tags 3420 unreproducible forcemerge 1750 4109 reassign 4092 emacs,ns reassign 4070 emacs,ns merge 4093 4081 From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 25 15:03:57 2012 Received: (at control) by debbugs.gnu.org; 25 Mar 2012 19:03:57 +0000 Received: from localhost ([127.0.0.1]:38547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBsjN-0001Ln-3q for submit@debbugs.gnu.org; Sun, 25 Mar 2012 15:03:57 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:35842) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBsj3-0001Kq-1q for control@debbugs.gnu.org; Sun, 25 Mar 2012 15:03:55 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SBsEx-0004Aq-9Y for control@debbugs.gnu.org; Sun, 25 Mar 2012 14:32:31 -0400 Date: Sun, 25 Mar 2012 14:32:31 -0400 Message-Id: Subject: control message for bug 11088 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 11088 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 unknown Fri Jun 20 07:19:35 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