unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: master e5d76634a2: Make remapped keys work in set-transient-map
Date: Mon, 23 May 2022 08:41:25 -0400	[thread overview]
Message-ID: <jwvbkvotoe3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20220523111011.525EAC051FF@vcs2.savannah.gnu.org> (Lars Ingebrigtsen's message of "Mon, 23 May 2022 07:10:11 -0400 (EDT)")

Lars Ingebrigtsen [2022-05-23 07:10:11] wrote:
> index 6538d79050..0fc1156d40 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))))

The remapping could also come from [remap <mc>] bindings in some other
active keymap so maybe we should skip passing `map` to
`command-remapping`.

Then again, maybe we don't really need to check (eq this-command mc)
at all, and just make sure `lookup-key` found a binding in `map`.


        Stefan




       reply	other threads:[~2022-05-23 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165330421099.23674.7590022790639219967@vcs2.savannah.gnu.org>
     [not found] ` <20220523111011.525EAC051FF@vcs2.savannah.gnu.org>
2022-05-23 12:41   ` Stefan Monnier [this message]
2022-05-24 12:56     ` master e5d76634a2: Make remapped keys work in set-transient-map Lars Ingebrigtsen
2022-05-24 14:00       ` Stefan Monnier

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=jwvbkvotoe3.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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).