bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21867: 25.0.50; lossage's log doesn't treat characters read by read-


From: Lars Ingebrigtsen
Subject: bug#21867: 25.0.50; lossage's log doesn't treat characters read by read-char as separate commands
Date: Thu, 01 Aug 2019 20:05:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Zachary Kanfer <address@hidden> writes:

> The way that lossage now shows different commands on different lines is
> really useful, but I found a way where it's not treating two different
> things as different commands. To reproduce:
>
> emacs -Q
>
> open the scratch buffer
>
> insert this whole s-expression:
>
> (read-char)
>
> Then, with point at the end of that line, type:
>
> C-x C-e a C-h l
>
> This evaluates the (read-char) sexp which reads the `a` typed, then
> views lossage.
>
> The last lines of lossage are:
>
>  C-x C-e [eval-last-sexp]
>  a C-h l [view-lossage]
>
> Note that the log line calling view-lossage also includes "a", the
> command read by read-char. I would expect the lossage buffer to be
> something like this:
>
>  C-x C-e [eval-last-sexp]
>  a [char read by read-char]
>  C-h l [view-lossage]
>
> This does not happen with read-string; one gets logs like:
>
>  C-x C-e [eval-last-sexp]
>  p [self-insert-command]
>  a [self-insert-command]
>  n [self-insert-command]
>  t [self-insert-command]
>  s [self-insert-command]
>  <return> [exit-minibuffer]
>  C-h l [view-lossage]

(I'm going through old bug reports that have unfortunately not gotten
any responses.)

I'm seeing the same thing in Emacs 27 -- C-x C-e on the `(read-char)'
and then a couple of <down>s:

 C-x C-e                ;; eval-last-sexp
 a <down>               ;; next-line
 <down>                 ;; next-line

This is what's returned by `recent-keys':

 24 5
 (nil . eval-last-sexp)
 97 down
 (nil . next-line)
 down
 (nil . next-line)

97 is the ?a.

The reason is that `read-char' does this:

  /* Store these characters into recent_keys, the dribble file if any,
     and the keyboard macro being defined, if any.  */
  record_char (c);
  recorded = true;
  if (! NILP (also_record))
    record_char (also_record);

But...  it's not clear what `read-char' should put into recent_keys
here, which is a not-very-clear structure.  Perhaps (nil . "char read by
read-char") after the char and then adjust `view-lossage'?

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]