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

>> 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):
>> @@ -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.

There is another use of 'overriding-local-map' in project.el:
in 'project--switch-project-command'.  Not sure if this should be
replaced with 'overriding-terminal-local-map' as well.

Also not sure how 'overriding-terminal-local-map' will affect
'universal-argument' that relies on 'overriding-terminal-local-map'.
Maybe project.el should use

  (internal-push-keymap map 'overriding-terminal-local-map)

like in 'set-transient-map'.  Ok, need to try and test this more.





  reply	other threads:[~2024-02-20  7:49 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
2024-02-20  7:49   ` Juri Linkov [this message]
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=86msrvfuci.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=69242@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    /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).