GNU bug report logs -
#50176
[PATCH] 28.0.50; repeat-mode does not clear echo-area after timeout
Previous Next
Reported by: Gabriel <gabriel376 <at> hotmail.com>
Date: Mon, 23 Aug 2021 22:31:01 UTC
Severity: normal
Tags: fixed, patch
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Description:
When repeat-mode is enabled and a repeat-exit-timeout is set, the
echo-area is not cleared in case the echo-area has some content and a
single repeat-command is executed.
Steps:
1) emacs -Q (from master branch)
2) eval
(setq repeat-exit-timeout 1)
(repeat-mode 1)
3) create some windows with 'C-x 2' and 'C-x 3'
4) 'C-x'
5) wait prefix "C-x" to appear on echo-area
6) 'o' (echo-area will now contain "C-x o [Repeat with o, O]")
7) wait a few seconds so 'repeat-exit-timeout' takes effect
Expected: the echo-area is cleared
Actual: the echo-area is not cleared
If 'o' is pressed again, it will run 'self-insert-command' even though
the echo-area is still showing "C-x o [Repeat with o, O]".
Now repeat steps 1-5 but press 'o' quickly to invoke the repeat command
multiple times (which will trigger other-window multiple times). The
echo-area changes to "Repeat o, O" and is properly cleaned after
'repeat-exit-timeout' seconds.
Patch:
I created a simple patch that seems to fix this probem. The
'string-prefix-p' was replaced with 'string-match-p' to handle cases
where echo-area contains some other message. This check seems very poor,
though, so any better approach is welcome.
[0001-Fix-to-clear-echo-area-after-repeat-exit-timeout.patch (text/x-patch, inline)]
From e6de15337bf4516740c0e790f6a2bfb3deaf9b5b Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376 <at> hotmail.com>
Date: Mon, 23 Aug 2021 19:05:58 -0300
Subject: [PATCH] Fix to clear echo-area after repeat-exit-timeout.
* lisp/repeat.el (repeat-echo-message): Use 'string-match-p'
to handle cases where echo-area contains other messages.
---
lisp/repeat.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/repeat.el b/lisp/repeat.el
index cec3cb643a..054eacf8ec 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -474,7 +474,7 @@ repeat-echo-message
(if (current-message)
(message "%s [%s]" (current-message) mess)
(message mess)))
- (when (string-prefix-p "Repeat with " (current-message))
+ (when (string-match-p "Repeat with " (current-message))
(message nil))))
(defvar repeat-echo-mode-line-string
--
2.32.0
This bug report was last modified 3 years and 273 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.