unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47501: [PATCH] Do not search the global keymap in project--keymap-prompt
@ 2021-03-30 17:02 Dario Gjorgjevski
  2021-04-05 16:15 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Dario Gjorgjevski @ 2021-03-30 17:02 UTC (permalink / raw)
  To: 47501

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]

Hi,

project--keymap-prompt searches project-prefix-map *plus* the global
keymap when constructing the prompt for project-switch-command.  This
can result in weird behavior; for example,

    (global-set-key (kbd "M-s r") 'rgrep)
    (require 'project)
    (define-key project-prefix-map (kbd "<f5>") 'rgrep)
    (push '(rgrep "rgrep") project-switch-commands)

might (or will?) cause project-switch-project to display "[M-s r] rgrep"
instead of the expected "[<f5>] rgrep".

The attached patch fixes the issue as per the documentation of
`where-is-internal'.

Best regards,
Dario


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Do not search the global keymap in project--keymap-prompt --]
[-- Type: text/x-diff, Size: 1088 bytes --]

From 6e63d66b85d702abc72a32bcbb4d4f00fd6e2a21 Mon Sep 17 00:00:00 2001
From: Dario Gjorgjevski <dario.gjorgjevski+git@gmail.com>
Date: Tue, 30 Mar 2021 18:50:23 +0200
Subject: [PATCH] Do not search the global keymap in project--keymap-prompt

* lisp/progmodes/project.el: (project--keymap-prompt) Pass
project--keymap-prompt as a list to where-is-internal so that the
global keymap is not searched at all.
---
 lisp/progmodes/project.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 4101962..e0d5412 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1321,7 +1321,7 @@ are legal even if they aren't listed in the dispatch menu."
                key tmp)))
      (let ((key (if key
                     (vector key)
-                  (where-is-internal cmd project-prefix-map t))))
+                  (where-is-internal cmd (list project-prefix-map) t))))
        (format "[%s] %s"
                (propertize (key-description key) 'face 'bold)
                label)))
-- 
2.31.0


[-- Attachment #3: Type: text/plain, Size: 128 bytes --]


-- 
$ keyserver=hkps://hkps.pool.sks-keyservers.net
$ keyid=744A4F0B4F1C9371
$ gpg --keyserver $keyserver --search-keys $keyid

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#47501: [PATCH] Do not search the global keymap in project--keymap-prompt
  2021-03-30 17:02 bug#47501: [PATCH] Do not search the global keymap in project--keymap-prompt Dario Gjorgjevski
@ 2021-04-05 16:15 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-04-05 16:15 UTC (permalink / raw)
  To: Dario Gjorgjevski; +Cc: 47501

Dario Gjorgjevski <dario.gjorgjevski@gmail.com> writes:

> The attached patch fixes the issue as per the documentation of
> `where-is-internal'.

Makes sense to me; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-05 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 17:02 bug#47501: [PATCH] Do not search the global keymap in project--keymap-prompt Dario Gjorgjevski
2021-04-05 16:15 ` Lars Ingebrigtsen

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git