* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
@ 2022-06-14 17:27 Visuwesh
2022-06-14 17:30 ` Visuwesh
2022-06-14 17:40 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: Visuwesh @ 2022-06-14 17:27 UTC (permalink / raw)
To: 55977
Tags: patch
repeat-mode echoes unset keys in the help message since it doesn't check
for non-nil value of command bound to key; will attach patch once I get
the bug number.
In GNU Emacs 29.0.50 (build 16, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
of 2022-06-14 built on astatine
Repository revision: 9fb80aee176f6d5dc8fd33b63880b11a99a19657
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux 11 (bullseye)
Configured using:
'configure --with-modules --with-sound=alsa --with-x-toolkit=lucid
--with-json --without-xaw3d --without-gconf --without-libsystemd
--with-x --without-cairo'
Configured features:
ACL DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XFT
XIM XINPUT2 XPM LUCID ZLIB
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
2022-06-14 17:27 bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message Visuwesh
@ 2022-06-14 17:30 ` Visuwesh
2022-06-14 17:40 ` Eli Zaretskii
1 sibling, 0 replies; 7+ messages in thread
From: Visuwesh @ 2022-06-14 17:30 UTC (permalink / raw)
To: 55977
[-- Attachment #1: Type: text/plain, Size: 17 bytes --]
Patch attached.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-repeat-mode-Don-t-echo-unset-keys-in-help-message.patch --]
[-- Type: text/x-diff, Size: 932 bytes --]
From 245b353ca178c633c8fffaf0375a9bba99ba1917 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Tue, 14 Jun 2022 22:59:47 +0530
Subject: [PATCH] repeat-mode: Don't echo unset keys in help message
* repeat.el (repeat-echo-message-string): Check if the key is set.
(bug#55977)
---
lisp/repeat.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/repeat.el b/lisp/repeat.el
index ea4e3d0bd8..94ea9f7ac1 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -500,7 +500,7 @@ repeat-post-hook
(defun repeat-echo-message-string (keymap)
"Return a string with a list of repeating keys."
(let (keys)
- (map-keymap (lambda (key _) (push key keys)) keymap)
+ (map-keymap (lambda (key cmd) (and cmd (push key keys))) keymap)
(format-message "Repeat with %s%s"
(mapconcat (lambda (key)
(key-description (vector key)))
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
2022-06-14 17:27 bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message Visuwesh
2022-06-14 17:30 ` Visuwesh
@ 2022-06-14 17:40 ` Eli Zaretskii
2022-06-14 18:02 ` Visuwesh
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-06-14 17:40 UTC (permalink / raw)
To: Visuwesh; +Cc: 55977
> From: Visuwesh <visuweshm@gmail.com>
> Date: Tue, 14 Jun 2022 22:57:48 +0530
>
> repeat-mode echoes unset keys in the help message since it doesn't check
> for non-nil value of command bound to key; will attach patch once I get
> the bug number.
Thanks, but can you please show a recipe from "emacs -Q", to
understand better what problem are you trying to fix?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
2022-06-14 17:40 ` Eli Zaretskii
@ 2022-06-14 18:02 ` Visuwesh
2022-06-14 18:09 ` Visuwesh
0 siblings, 1 reply; 7+ messages in thread
From: Visuwesh @ 2022-06-14 18:02 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 55977
[செவ்வாய் ஜூன் 14, 2022 20:40] Eli Zaretskii wrote:
>> From: Visuwesh <visuweshm@gmail.com>
>> Date: Tue, 14 Jun 2022 22:57:48 +0530
>>
>> repeat-mode echoes unset keys in the help message since it doesn't check
>> for non-nil value of command bound to key; will attach patch once I get
>> the bug number.
>
> Thanks, but can you please show a recipe from "emacs -Q", to
> understand better what problem are you trying to fix?
Sure.
1. M-x repeat-mode RET.
2. C-h n.
3. M-: (define-key outline-navigation-repeat-map (kbd "C-n") nil).
4. C-c @ C-n. Notice how the help message still says C-n despite
being unbound, and when you type C-n the repeat map exits
contrary to what the message says.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
2022-06-14 18:02 ` Visuwesh
@ 2022-06-14 18:09 ` Visuwesh
2022-06-15 7:25 ` Juri Linkov
0 siblings, 1 reply; 7+ messages in thread
From: Visuwesh @ 2022-06-14 18:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 55977
[செவ்வாய் ஜூன் 14, 2022 23:32] Visuwesh wrote:
> [செவ்வாய் ஜூன் 14, 2022 20:40] Eli Zaretskii wrote:
>
>>> From: Visuwesh <visuweshm@gmail.com>
>>> Date: Tue, 14 Jun 2022 22:57:48 +0530
>>>
>>> repeat-mode echoes unset keys in the help message since it doesn't check
>>> for non-nil value of command bound to key; will attach patch once I get
>>> the bug number.
>>
>> Thanks, but can you please show a recipe from "emacs -Q", to
>> understand better what problem are you trying to fix?
>
> Sure.
>
> 1. M-x repeat-mode RET.
> 2. C-h n.
> 3. M-: (define-key outline-navigation-repeat-map (kbd "C-n") nil).
> 4. C-c @ C-n. Notice how the help message still says C-n despite
> being unbound, and when you type C-n the repeat map exits
> contrary to what the message says.
Oh, looks like if I give `define-key' a non-nil REMOVE argument, then
C-n is no longer displayed in the help message.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
2022-06-14 18:09 ` Visuwesh
@ 2022-06-15 7:25 ` Juri Linkov
2022-06-15 7:36 ` Visuwesh
0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2022-06-15 7:25 UTC (permalink / raw)
To: Visuwesh; +Cc: Eli Zaretskii, 55977
close 55977 29.0.50
thanks
>>>> repeat-mode echoes unset keys in the help message since it doesn't check
>>>> for non-nil value of command bound to key; will attach patch once I get
>>>> the bug number.
>>>
>>> Thanks, but can you please show a recipe from "emacs -Q", to
>>> understand better what problem are you trying to fix?
>>
>> Sure.
>>
>> 1. M-x repeat-mode RET.
>> 2. C-h n.
>> 3. M-: (define-key outline-navigation-repeat-map (kbd "C-n") nil).
>> 4. C-c @ C-n. Notice how the help message still says C-n despite
>> being unbound, and when you type C-n the repeat map exits
>> contrary to what the message says.
>
> Oh, looks like if I give `define-key' a non-nil REMOVE argument, then
> C-n is no longer displayed in the help message.
Indeed, the REMOVE removes a key, but nil is also a valid way to undefine a key,
so now your patch is pushed to master, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message
2022-06-15 7:25 ` Juri Linkov
@ 2022-06-15 7:36 ` Visuwesh
0 siblings, 0 replies; 7+ messages in thread
From: Visuwesh @ 2022-06-15 7:36 UTC (permalink / raw)
To: Juri Linkov; +Cc: Eli Zaretskii, 55977
[புதன் ஜூன் 15, 2022 10:25] Juri Linkov wrote:
> close 55977 29.0.50
> thanks
>
>>>>> repeat-mode echoes unset keys in the help message since it doesn't check
>>>>> for non-nil value of command bound to key; will attach patch once I get
>>>>> the bug number.
>>>>
>>>> Thanks, but can you please show a recipe from "emacs -Q", to
>>>> understand better what problem are you trying to fix?
>>>
>>> Sure.
>>>
>>> 1. M-x repeat-mode RET.
>>> 2. C-h n.
>>> 3. M-: (define-key outline-navigation-repeat-map (kbd "C-n") nil).
>>> 4. C-c @ C-n. Notice how the help message still says C-n despite
>>> being unbound, and when you type C-n the repeat map exits
>>> contrary to what the message says.
>>
>> Oh, looks like if I give `define-key' a non-nil REMOVE argument, then
>> C-n is no longer displayed in the help message.
>
> Indeed, the REMOVE removes a key, but nil is also a valid way to undefine a key,
> so now your patch is pushed to master, thanks.
Great, thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-06-15 7:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-14 17:27 bug#55977: 29.0.50; [PATCH] repeat-mode: Don't echo unset keys in help message Visuwesh
2022-06-14 17:30 ` Visuwesh
2022-06-14 17:40 ` Eli Zaretskii
2022-06-14 18:02 ` Visuwesh
2022-06-14 18:09 ` Visuwesh
2022-06-15 7:25 ` Juri Linkov
2022-06-15 7:36 ` Visuwesh
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).