GNU bug report logs -
#21867
25.0.50; lossage's log doesn't treat characters read by read-char as separate commands
Previous Next
Full log
Message #34 received at 21867 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Or maybe a special symbol?
The following patch does this. Does this look like the thing to do?
The test case, with this patch, now looks like this:
C-e ;; move-end-of-line
C-x C-e ;; eval-last-sexp
a ;;
C-h l ;; view-lossage
I've looked at other in-tree usages of `recent-keys', and it doesn't
look like this should affect anything else.
diff --git a/lisp/help.el b/lisp/help.el
index 039d0c44e4..0cd2aecba5 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -471,6 +471,9 @@ view-lossage
((and (consp key) (null (car key)))
(format ";; %s\n" (if (symbolp (cdr key)) (cdr key)
"anonymous-command")))
+ ((eq key 'non-command-character)
+ ;; This comes from `read-char'.
+ "\n")
((or (integerp key) (symbolp key) (listp key))
(single-key-description key))
(t
diff --git a/src/keyboard.c b/src/keyboard.c
index db5ca4e547..4e13bec5dd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2091,7 +2091,6 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, bool *used_mouse_menu,
struct timespec *end_time);
-static void record_char (Lisp_Object c);
static Lisp_Object help_form_saved_window_configs;
static void
@@ -3192,7 +3191,7 @@ help_char_p (Lisp_Object c)
/* Record the input event C in various ways. */
-static void
+void
record_char (Lisp_Object c)
{
/* quail.el binds this to avoid recording keys twice. */
@@ -11069,6 +11068,8 @@ syms_of_keyboard (void)
DEFSYM (Qundefined, "undefined");
+ DEFSYM (Qnon_command_character, "non-command-character");
+
/* Hooks to run before and after each command. */
DEFSYM (Qpre_command_hook, "pre-command-hook");
DEFSYM (Qpost_command_hook, "post-command-hook");
diff --git a/src/lisp.h b/src/lisp.h
index f437609fe1..ef03935b7a 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4375,6 +4375,7 @@ fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string)
extern void init_keyboard (void);
extern void syms_of_keyboard (void);
extern void keys_of_keyboard (void);
+extern void record_char (Lisp_Object);
/* Defined in indent.c. */
extern ptrdiff_t current_column (void);
diff --git a/src/lread.c b/src/lread.c
index eec88760d4..88a27531eb 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -679,8 +679,11 @@ read_filtered_event (bool no_switch_frame, bool ascii_required,
/* Read until we get an acceptable event. */
retry:
do
- val = read_char (0, Qnil, (input_method ? Qnil : Qt), 0,
- NUMBERP (seconds) ? &end_time : NULL);
+ {
+ val = read_char (0, Qnil, (input_method ? Qnil : Qt), 0,
+ NUMBERP (seconds) ? &end_time : NULL);
+ record_char (Qnon_command_character);
+ }
while (FIXNUMP (val) && XFIXNUM (val) == -2); /* wrong_kboard_jmpbuf */
if (BUFFERP (val))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 5 years and 297 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.