[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Explanation Request for the Function set-transient-map in subr.el
From: |
xenodasein |
Subject: |
Re: Explanation Request for the Function set-transient-map in subr.el |
Date: |
Sun, 28 Nov 2021 21:48:47 +0100 (CET) |
> This tests whether the user typed a key-sequence from `map` as opposed
> to some other one.
>
> E.g. when you use `text-scale-adjust`, you want to "stay" in the
> transient map as long as the user uses one of the keys in the `map`
> (basically, +, -, or 0) and if the user types some other key, we
> immediately/automatically exit from this transient map.
>
> Stefan
> As Stefan and the comment tried to describe: this checks whether the
> execution of current command happened using a key binding from the
> transient MAP.
> What are the possible values of mc here on the last line?
> This test is done to fullfill this part of the docstring:
>| [...] if the optional argument KEEP-PRED is t, MAP stays active if a
>| key from MAP is used
> If this is the case, it's as you described, and the test succeeds. But
> when the current command has not been invoked using a binding in the
> transient map, mc is `nil' and the `eq'ality test fails as we want to
> disable the transient map.
But then, isn't that second expression redundant? Lookup key is already looking
in our transient map, if it succeeds mc will be non-nil and equal this-command,
if it does not, 'and' will return nil anyway?
- Explanation Request for the Function set-transient-map in subr.el, xenodasein, 2021/11/11
- Re: Explanation Request for the Function set-transient-map in subr.el, Stefan Monnier, 2021/11/12
- FWD: Explanation Request for the Function set-transient-map in subr.el, xenodasein, 2021/11/14
- Re: FWD: Explanation Request for the Function set-transient-map in subr.el, xenodasein, 2021/11/14
- Re: Explanation Request for the Function set-transient-map in subr.el, xenodasein, 2021/11/28
- Re: Explanation Request for the Function set-transient-map in subr.el, xenodasein, 2021/11/28
- Re: Explanation Request for the Function set-transient-map in subr.el, xenodasein, 2021/11/28
- Re: Explanation Request for the Function set-transient-map in subr.el, Michael Heerdegen, 2021/11/29