From unknown Mon Jun 23 02:26:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40096: 26.3; set-transient-map does not work with remapped bindings Resent-From: Uros Perisic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Mar 2020 03:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40096 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 40096@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158441481619330 (code B ref -1); Tue, 17 Mar 2020 03:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Mar 2020 03:13:36 +0000 Received: from localhost ([127.0.0.1]:38012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jE2ff-00051i-Ta for submit@debbugs.gnu.org; Mon, 16 Mar 2020 23:13:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:53808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jE210-0003wa-0N for submit@debbugs.gnu.org; Mon, 16 Mar 2020 22:31:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55459) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jE20y-00062w-ES for bug-gnu-emacs@gnu.org; Mon, 16 Mar 2020 22:31:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jE20x-000606-34 for bug-gnu-emacs@gnu.org; Mon, 16 Mar 2020 22:31:32 -0400 Received: from mail-vk1-xa42.google.com ([2607:f8b0:4864:20::a42]:46842) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jE20w-0005mL-SZ for bug-gnu-emacs@gnu.org; Mon, 16 Mar 2020 22:31:31 -0400 Received: by mail-vk1-xa42.google.com with SMTP id s139so5523347vka.13 for ; Mon, 16 Mar 2020 19:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=BsexcBi6vEKHrvjzkkGiZdZ3FTlPUok681QUxZ+Bp5o=; b=N3iHy+j/aJVZGrhj04ZNeMuiympUoOkS4fBNAjqMgspGLTmeXF0TVxoRmwp7pVINlS SB+HikM4rB3MSCJrt2iI4HUatgNZ4BrGxuZ9itYFf/BQa9bw52Aebtg6miGi0TIwZhsa FTPYLP7cU3XTr2dns2Nw0TrVhrkVHmzhIbdXrofVSIKUMH6dThndY998tLZgyr6SCh0v u0ig5SRzR37YhFwui+v/3vhD4B5MEDePEEzYsekPLMIZZ3H8aCRnAaTP969zTvYwnUy8 JoQstSXlZc+/DDjvK7d0uiGSs2yi+5YpvGSwxacpa/ZT9PtwGLaojth7yKINtBPcyAvS Lnpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BsexcBi6vEKHrvjzkkGiZdZ3FTlPUok681QUxZ+Bp5o=; b=X/azShlZq9iqpT0/eM0nwHGETv7mAGYGBcUsiCeIa5VBQUJnblalXQWJReKR8a4ezn savN+JFXDbWZsdqVqIhLrXQzGfFX1xDsQ+7rxZqmxIbs9dDjB29vEgki7F2UNstzcd8u L0MYuOFF6v+NlvsL3Dk3CW2HFjZDe4/O65BoE5rZffa9GKzJ0Q5iQ/xaoObRkBZFZJc7 1U7SnOmqNmVK2C+M6Is9Mau6qzKAcQxubOnqxgRPxB07Dp+EPmau+KX2Qps+G4QnKT5A 7qY9IpnpafzeU/hNounqF2vVVLM9i3WJynzhRu6+N2uHuCW8CmzAnSCof/UX9BvZpp+e LxyA== X-Gm-Message-State: ANhLgQ0FfOTOp/z77PCdwY7kELv9pfn5FcBY0wCm94Tm7CVxMsLMGWTP nFjZ0YevN+p5INgqfsD0WF+wqcYKJB41HLl0snOjZi7i0kA= X-Google-Smtp-Source: ADFU+vuS//FhLJXExG8OxkvwsKDguJSYmiQi7Fi9o+u/higE+9XO0N2CO16COvashKWFAr5geB4HjcJ6uhvOjRYhziw= X-Received: by 2002:a1f:c188:: with SMTP id r130mr2203945vkf.94.1584412288887; Mon, 16 Mar 2020 19:31:28 -0700 (PDT) MIME-Version: 1.0 From: Uros Perisic Date: Tue, 17 Mar 2020 10:32:21 +0800 Message-ID: Content-Type: multipart/alternative; boundary="000000000000a82d7005a103bb8c" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::a42 X-Spam-Score: 0.3 (/) X-Mailman-Approved-At: Mon, 16 Mar 2020 23:13:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) --000000000000a82d7005a103bb8c Content-Type: text/plain; charset="UTF-8" `set-transient-keymap' states that "if the optional argument KEEP-PRED is t, MAP stays active if a key from MAP is used". This is not the case. If one of the keys on the keymap is bound using the special [remap ] vector, the map is deactivated. I think the reason is that this test fails: #+BEGIN_SRC elisp (let ((mc (lookup-key map (this-command-keys-vector)))) ;; If the key is unbound `this-command` is ;; nil and so is `mc`. (and mc (eq this-command mc))) #+END_SRC Here's a recipe to reproduce it starting form emacs -Q: #+BEGIN_SRC elisp (setq mymap (make-sparse-keymap)) (defun message-foo () (interactive) (message "foo")) (defun message-bar () (interactive) (message "bar")) (define-key mymap "f" #'message-foo) (set-transient-map mymap t) ;; continually press f and note that foo is constantly messaged ;; press any other letter and it will stop (define-key mymap [remap message-foo] #'message-bar) (set-transient-map mymap t) ;; note that pressing f only echoes foo once #+END_SRC In GNU Emacs 26.3 (build 1, x86_64-unknown-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29 built on a-hel-fi Windowing system distributor 'The X.Org Foundation', version 11.0.12007000 System Description: Void Linux Configured using: 'configure --with-x-toolkit=gtk3 --with-xwidgets --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --bindir=/usr/bin --mandir=/usr/share/man --infodir=/usr/share/info --localstatedir=/var --with-file-notification=inotify --with-modules --with-jpeg --with-tiff --with-gif --with-png --with-xpm --with-rsvg --without-imagemagick --with-xml2 --with-gnutls --with-sound --with-m17n-flt --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu 'CFLAGS=-fno-PIE -mtune=generic -O2 -pipe -g' 'CPPFLAGS= ' 'LDFLAGS=-no-pie -Wl,--as-needed '' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LCMS2 Important settings: value of $LC_COLLATE: C value of $LC_MESSAGES: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix --000000000000a82d7005a103bb8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

`set-transient-keymap' states that "if the op= tional argument KEEP-PRED
is t, MAP stays active if a key from MAP is us= ed". This is not the
case. If one of the keys on the keymap is boun= d using the special
[remap <function>] vector, the map is deactiva= ted.

I think the reason is that this test fails:
#+BEGIN_SRC elis= p
(let ((mc (lookup-key map (this-command-keys-vector))))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ;; If the key is unbound `this-command` is
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; ni= l and so is `mc`.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (and mc (eq this-command mc)))
#+= END_SRC

Here's a recipe to reproduce it starting form emacs -Q:<= br>#+BEGIN_SRC elisp
(setq mymap (make-sparse-keymap))
(defun message= -foo () (interactive) (message "foo"))
(defun message-bar () (= interactive) (message "bar"))
(define-key mymap "f" = #'message-foo)
(set-transient-map mymap t)
;; continually press f= and note that foo is constantly messaged
;; press any other letter and = it will stop
(define-key mymap [remap message-foo] #'message-bar)(set-transient-map mymap t)
;; note that pressing f only echoes foo onc= e
#+END_SRC

In GNU Emacs 26.3 (build 1, x86_64-unknown-linux-gnu,= GTK+ Version 3.24.10)
=C2=A0of 2019-08-29 built on a-hel-fi
Windowin= g system distributor 'The X.Org Foundation', version 11.0.12007000<= br>System Description: Void Linux

Configured using:
=C2=A0'co= nfigure --with-x-toolkit=3Dgtk3 --with-xwidgets --prefix=3D/usr
=C2=A0--= sysconfdir=3D/etc --sbindir=3D/usr/bin --bindir=3D/usr/bin
=C2=A0--mandi= r=3D/usr/share/man --infodir=3D/usr/share/info --localstatedir=3D/var
= =C2=A0--with-file-notification=3Dinotify --with-modules --with-jpeg --with-= tiff
=C2=A0--with-gif --with-png --with-xpm --with-rsvg --without-imagem= agick
=C2=A0--with-xml2 --with-gnutls --with-sound --with-m17n-flt
= =C2=A0--host=3Dx86_64-unknown-linux-gnu --build=3Dx86_64-unknown-linux-gnu<= br>=C2=A0'CFLAGS=3D-fno-PIE -mtune=3Dgeneric -O2 -pipe -g' 'CPP= FLAGS=3D '
=C2=A0'LDFLAGS=3D-no-pie -Wl,--as-needed ''
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTIN= GS GLIB NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOL= KIT_SCROLL_BARS GTK3 X11
XDBE XIM MODULES THREADS XWIDGETS LCMS2

= Important settings:
=C2=A0 value of $LC_COLLATE: C
=C2=A0 value of $L= C_MESSAGES:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-s= ystem: utf-8-unix
--000000000000a82d7005a103bb8c-- From unknown Mon Jun 23 02:26:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40096: 26.3; set-transient-map does not work with remapped bindings Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 May 2022 11:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40096 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Uros Perisic Cc: 40096@debbugs.gnu.org Received: via spool by 40096-submit@debbugs.gnu.org id=B40096.165330413020769 (code B ref 40096); Mon, 23 May 2022 11:09:01 +0000 Received: (at 40096) by debbugs.gnu.org; 23 May 2022 11:08:50 +0000 Received: from localhost ([127.0.0.1]:47448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nt5ve-0005Ov-94 for submit@debbugs.gnu.org; Mon, 23 May 2022 07:08:50 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nt5vb-0005Oc-Uz for 40096@debbugs.gnu.org; Mon, 23 May 2022 07:08:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SlPKCgS6HBDh44ArtdHZ7xMS14DlmNgn32DIoFKY7Jc=; b=Vr1yOWp2KRctaDIeszkZGNOI1u +O+OKAalx62P/e7iKfHS4BOFiMWD8J5XSH2+BEJw0VcAJzJRSCiKANyYmMoFEfAiaGrr1LylSrXU4 XY1U/dTDErA0zS0UMrG/EeYIQa1aA5UnbWDs3u988xZF8XYPERVwJNgO7XXrXjilNiFU=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nt5vS-0001ER-Ui; Mon, 23 May 2022 13:08:41 +0200 From: Lars Ingebrigtsen References: X-Now-Playing: The Durutti Column's _Love in the Time of Recession_: "Lock-Down" Date: Mon, 23 May 2022 13:08:37 +0200 In-Reply-To: (Uros Perisic's message of "Tue, 17 Mar 2020 10:32:21 +0800") Message-ID: <87a6b8o6a2.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Uros Perisic writes: > Here's a recipe to reproduce it starting form emacs -Q: > #+BEGIN_SRC elisp > (setq mymap (make-sparse-keymap)) > (defun message-foo () (interactive) (message "foo")) > (defun message-bar () (intera [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) Uros Perisic writes: > Here's a recipe to reproduce it starting form emacs -Q: > #+BEGIN_SRC elisp > (setq mymap (make-sparse-keymap)) > (defun message-foo () (interactive) (message "foo")) > (defun message-bar () (interactive) (message "bar")) > (define-key mymap "f" #'message-foo) > (set-transient-map mymap t) > ;; continually press f and note that foo is constantly messaged > ;; press any other letter and it will stop > (define-key mymap [remap message-foo] #'message-bar) > (set-transient-map mymap t) > ;; note that pressing f only echoes foo once > #+END_SRC Thanks for the clear recipe. I've now fixed this in Emacs 29. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon May 23 07:08:57 2022 Received: (at control) by debbugs.gnu.org; 23 May 2022 11:08:57 +0000 Received: from localhost ([127.0.0.1]:47451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nt5vk-0005PI-HP for submit@debbugs.gnu.org; Mon, 23 May 2022 07:08:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nt5vi-0005Oo-5y for control@debbugs.gnu.org; Mon, 23 May 2022 07:08:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AvcJKwv1KnDFNye3tvQ2CPaH9b1kpsiJNWacEc5t/wg=; b=Rc076//+Ok48bUsgD0diLVrMbx XztrSt2S6fxnx4vCCCjlHlLthefuE98BaUGNNoIxi3xbA3LsRQt9OLiZCyB1b9FBWBBExNRkNxLQ/ Fv2LrJbGCL9oolfLI1WKXflenvSlLXnL6tGiB/NaDNu3RSUtTukiFXwWenwZ+m1q8wfw=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nt5va-0001EZ-Ga for control@debbugs.gnu.org; Mon, 23 May 2022 13:08:48 +0200 Date: Mon, 23 May 2022 13:08:44 +0200 Message-Id: <878rqso69v.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #40096 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 40096 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) close 40096 29.1 quit