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

From: Dmitry Gutov <[email-masked]>
Date: Thu, 7 Dec 2023 02:01:39 +0200

On 06/12/2023 19:10, Juri Linkov wrote:
>> 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'.

I think that would still regress bug#58784.

And project-current-directory-override was really only added to benefit 
such rare cases.