unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master e5d76634a2: Make remapped keys work in set-transient-map
       [not found] ` <20220523111011.525EAC051FF@vcs2.savannah.gnu.org>
@ 2022-05-23 12:41   ` Stefan Monnier
  2022-05-24 12:56     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2022-05-23 12:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master e5d76634a2: Make remapped keys work in set-transient-map
  2022-05-23 12:41   ` master e5d76634a2: Make remapped keys work in set-transient-map Stefan Monnier
@ 2022-05-24 12:56     ` Lars Ingebrigtsen
  2022-05-24 14:00       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-24 12:56 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

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

Yes, I guess.  Now fixed.

> 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`.

I was unable to convince myself one way or another here, so I left this
logic as is, but feel free to adjust if you think that won't regress
anything.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master e5d76634a2: Make remapped keys work in set-transient-map
  2022-05-24 12:56     ` Lars Ingebrigtsen
@ 2022-05-24 14:00       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2022-05-24 14:00 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

>> 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`.
> I was unable to convince myself one way or another here,

That makes two of us.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-24 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <165330421099.23674.7590022790639219967@vcs2.savannah.gnu.org>
     [not found] ` <20220523111011.525EAC051FF@vcs2.savannah.gnu.org>
2022-05-23 12:41   ` master e5d76634a2: Make remapped keys work in set-transient-map Stefan Monnier
2022-05-24 12:56     ` Lars Ingebrigtsen
2022-05-24 14:00       ` Stefan Monnier

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).