Subject: Re: bug#63648: 29.0.90; project.el: with switch-use-entire-map, switch-project errors on non-project commands

From: Juri Linkov <[email-masked]>
Date: Fri, 20 Oct 2023 09:44:37 +0300

> 'C-x d' will result in a warning echo, though, instead of just using
> 'd'. If you really prefer that, try experimenting with the below addition,
> but I'm wary of edge cases, since we want to keep supporting sub-maps like
> in bug#47620. It also might feel a little too "magical" now that there are
> more details printed (it also doesn't handle extremes like 'C-c C-x C-c'
> still).
>
> @@ -2003,7 +2003,9 @@ project--switch-project-command
>                                         (help-key-description choice
>                                         nil)))))
>          (setq choice (read-key-sequence (concat "Choose: " prompt)))
>          (when (setq command (lookup-key commands-map choice))
> -          (when (numberp command) (setq command nil))
> +          (when (numberp command)
> +            (setq command
> +                  (lookup-key commands-map (substring choice command))))

Wow, it works nicely for 'C-x p p C-x d'.
But strange it fails for 'C-x p p C-x v d'
with the same error:

  (wrong-type-argument commandp 1)