From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#69242: project-any-command with overriding-local-map Date: Tue, 20 Feb 2024 09:49:49 +0200 Organization: LINKOV.NET Message-ID: <86msrvfuci.fsf@mail.linkov.net> References: <86frxrj83q.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40168"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 69242@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 20 08:59:52 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcL2d-000AKB-Ia for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Feb 2024 08:59:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcL2V-0007PH-Rg; Tue, 20 Feb 2024 02:59:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcL2U-0007Oc-4x for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 02:59:42 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcL2T-0007e6-SO for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 02:59:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcL2p-00065v-DZ for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 03:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Feb 2024 08:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69242 X-GNU-PR-Package: emacs Original-Received: via spool by 69242-submit@debbugs.gnu.org id=B69242.170841598423349 (code B ref 69242); Tue, 20 Feb 2024 08:00:03 +0000 Original-Received: (at 69242) by debbugs.gnu.org; 20 Feb 2024 07:59:44 +0000 Original-Received: from localhost ([127.0.0.1]:44235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcL2V-00064X-SO for submit@debbugs.gnu.org; Tue, 20 Feb 2024 02:59:44 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:36289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcL2T-00064E-FU for 69242@debbugs.gnu.org; Tue, 20 Feb 2024 02:59:43 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 3185B1BF207; Tue, 20 Feb 2024 07:58:52 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Mon, 19 Feb 2024 18:01:56 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280312 Archived-At: >> 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.