unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Juri Linkov <juri@linkov.net>, 69242@debbugs.gnu.org
Subject: bug#69242: project-any-command with overriding-local-map
Date: Mon, 19 Feb 2024 18:01:56 +0200	[thread overview]
Message-ID: <d72baed1-55b3-4de4-a1b1-d8bf38227126@gutov.dev> (raw)
In-Reply-To: <86frxrj83q.fsf@mail.linkov.net>

On 17/02/2024 19:17, Juri Linkov wrote:
> 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'.

I suppose that's because you are entering a sequence that belongs to a 
local map (diff-mode-map), and overriding-local-map overrides them 
entirely ("INSTEAD OF" in the docstring), rather than having a higher 
priority, which is overriding-terminal-local-map does.

> 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)))

LGTM, thanks. Let's see if this one triggers any other edge cases we 
didn't test for.





  reply	other threads:[~2024-02-19 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 17:17 bug#69242: project-any-command with overriding-local-map Juri Linkov
2024-02-19 16:01 ` Dmitry Gutov [this message]
2024-02-20  7:49   ` Juri Linkov
2024-02-22  3:42     ` Dmitry Gutov
2024-02-25  7:33       ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d72baed1-55b3-4de4-a1b1-d8bf38227126@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=69242@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).