Subject: bug#67171: 30.0.50; (At least) some VC commands fail with project-prefix-or-any-command

From: Juri Linkov <[email-masked]>
Date: Wed, 06 Dec 2023 19:10:03 +0200

> So... something like this?
>
> @@ -1861,9 +1861,10 @@ project-any-command
>      (when command
>        ;; We could also check the command name against "\\`project-",
>        ;; and/or (get command 'project-command).
> -      (map-keymap
> -       (lambda (_evt cmd) (if (eq cmd command) (setq found t)))
> -       project-prefix-map)
> +      (unless (get command 'project-switch-with-default-directory)
> +        (map-keymap
> +         (lambda (_evt cmd) (if (eq cmd command) (setq found t)))
> +         project-prefix-map))
>        (if found
>            (let ((project-current-directory-override root))
>              (call-interactively command))

Why not let-bind both variables for all commands:
'project-current-directory-override' and 'default-directory'?

Then project commands will pick up the first:

  (or project-current-directory-override default-directory)

And non-project commands will just ignore
'project-current-directory-override'.