help-gnu-emacs
[Top][All Lists]
Advanced

[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: Michael Heerdegen
Subject: Re: Explanation Request for the Function set-transient-map in subr.el
Date: Sun, 28 Nov 2021 20:17:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

xenodasein--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Thanks for your clarification on isearch issue.
>
> >> ((eq t keep-pred)
> >>   (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))))
> >>
>
> I'm still not clear why exactly this expression is used though: (eq
> this-command mc).

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.

Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]