From e5d76634a2159bc2ae6d1af859b736b834f63f30 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 23 May 2022 13:08:17 +0200 Subject: [PATCH] Make remapped keys work in set-transient-map * lisp/subr.el (set-transient-map): Make remapped keys work in transient maps (bug#40096). --- lisp/subr.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 6538d790507..0fc1156d40c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6043,6 +6043,10 @@ to deactivate this transient map, regardless of KEEP-PRED." t) ((eq t keep-pred) (let ((mc (lookup-key map (this-command-keys-vector)))) + ;; We may have a remapped command, so chase + ;; down that. + (when (and mc (symbolp mc)) + (setq mc (or (command-remapping mc nil map) mc))) ;; If the key is unbound `this-command` is ;; nil and so is `mc`. (and mc (eq this-command mc)))) -- 2.39.2