From: Robert Pluim <rpluim@gmail.com>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: Eli Zaretskii <eliz@gnu.org>, 61149@debbugs.gnu.org
Subject: bug#61149: 29.0.60; keymap-local-set rejects key sequences
Date: Mon, 30 Jan 2023 08:59:03 +0100 [thread overview]
Message-ID: <87fsbszc54.fsf@gmail.com> (raw)
In-Reply-To: <871qndbbrn.fsf@rub.de> (Stephen Berman's message of "Sun, 29 Jan 2023 16:28:44 +0100")
>>>>> On Sun, 29 Jan 2023 16:28:44 +0100, Stephen Berman <stephen.berman@gmx.net> said:
Stephen> ... but not in your non-interactive case; so maybe this instead:
Stephen> diff --git a/lisp/keymap.el b/lisp/keymap.el
Stephen> index 791221f2459..48ec91d03c8 100644
Stephen> --- a/lisp/keymap.el
Stephen> +++ b/lisp/keymap.el
Stephen> @@ -98,6 +98,8 @@ keymap-local-set
Stephen> (let ((map (current-local-map)))
Stephen> (unless map
Stephen> (use-local-map (setq map (make-sparse-keymap))))
Stephen> + (unless (stringp key)
Stephen> + (setq key (key-description key)))
Stephen> (keymap-set map key command)))
`keymap-global-set' has the same type of issue. How about this
instead:
diff --git a/lisp/keymap.el b/lisp/keymap.el
index 791221f2459..1a339598f0c 100644
--- a/lisp/keymap.el
+++ b/lisp/keymap.el
@@ -79,7 +79,7 @@ keymap-global-set
(interactive
(let* ((menu-prompting nil)
(key (read-key-sequence "Set key globally: " nil t)))
- (list key
+ (list (key-description key)
(read-command (format "Set key %s to command: "
(key-description key))))))
(keymap-set (current-global-map) key command))
@@ -94,7 +94,12 @@ keymap-local-set
The binding goes in the current buffer's local map, which in most
cases is shared with all other buffers in the same major mode."
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
- (interactive "KSet key locally: \nCSet key %s locally to command: ")
+ (interactive
+ (let* ((menu-prompting nil)
+ (key (read-key-sequence "Set key locally: " nil t)))
+ (list (key-description key)
+ (read-command (format "Set key %s to command: "
+ (key-description key))))))
(let ((map (current-local-map)))
(unless map
(use-local-map (setq map (make-sparse-keymap))))
Robert
--
next prev parent reply other threads:[~2023-01-30 7:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 13:44 bug#61149: 29.0.60; keymap-local-set rejects key sequences Eli Zaretskii
2023-01-29 14:35 ` Stephen Berman
2023-01-29 15:28 ` Stephen Berman
2023-01-30 7:59 ` Robert Pluim [this message]
2023-01-30 8:46 ` Stephen Berman
2023-01-30 9:47 ` Robert Pluim
2023-01-30 13:14 ` Eli Zaretskii
2023-01-30 13:25 ` Robert Pluim
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fsbszc54.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=61149@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=stephen.berman@gmx.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.