Subject: bug#51384: 28.0.60; substitute-command-keys finds global binding for undo instead of in specified keymap

From: Robert Pluim <[email-masked]>
Date: Fri, 16 Sep 2022 11:58:34 +0200

>>>>> On Fri, 16 Sep 2022 11:29:26 +0200, Lars Ingebrigtsen <[email-masked]> said:

    Lars> Robert Pluim <[email-masked]> writes:
    >> I donʼt think any of the advertised bindings caused a problem, but
    >> Iʼll double check.

    Lars> Thanks; feel free to push after checking.

Iʼm about half way through. Itʼs one of those situations where maybe
youʼre tempted to code up a solution using el-search, but that might
take longer than doing it manually 😀

    >> -                              (where-is-internal fun keymap t))))
    >> +                                 (where-is-internal fun (ensure-list keymap) t)))

    Lars> You later said that that's not correct -- but in which cases isn't it?

Test case:

(substitute-command-keys "\\<undo-repeat-map>\\[undo]")

My model was wrong. I thought keymap was either nil or bound to a
keymap, but `undo-repeat-map' is a list of value

(keymap (117 . undo))

hence the need to do

(and keymap (list keymap))

Robert
--