Subject: bug#69242: project-any-command with overriding-local-map

From: Juri Linkov <[email-masked]>
Date: Sat, 17 Feb 2024 19:17:37 +0200

With 'project-switch-commands' customized to 'project-prefix-or-any-command'
tried to do such a useful thing as applying a diff to a sibling project
with the same source tree:

C-x v =
C-x p p RET
C-c RET a     (diff-apply-buffer)

But it failed with an undefined key.

And indeed evaluating in a *vc-diff* buffer:

  M-: (let ((overriding-local-map project-prefix-map)) (key-binding (read-key-sequence "? ") t))

returns nil for any longer than 1-key binding such as 'C-c C-a' or 'C-c RET a'.

Then found this patch fixes the problem completely (no idea why):

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index aa92a73336e..fe866312931 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1871,7 +1874,7 @@ project-any-command
   (interactive)
   (let* ((pr (project-current t))
          (prompt-format (or prompt-format "[execute in %s]:"))
-         (command (let ((overriding-local-map overriding-map))
+         (command (let ((overriding-terminal-local-map overriding-map))
                     (key-binding (read-key-sequence
                                   (format prompt-format (project-root pr)))
                                  t)))