From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs 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 Message-ID: <87blx8iwwm.fsf@mouse.gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="7430"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 21867@debbugs.gnu.org To: Zachary Kanfer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 01 20:06:44 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1htFTO-0001m3-GY for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Aug 2019 20:06:42 +0200 Original-Received: from localhost ([::1]:58160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htFTN-0007iR-Aw for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Aug 2019 14:06:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54760) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htFSr-0007i9-MZ for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2019 14:06:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htFSn-0001m3-NI for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2019 14:06:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htFSk-0001lD-CK for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2019 14:06:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1htFSk-0004Jw-4s for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2019 14:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Aug 2019 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21867 X-GNU-PR-Package: emacs Original-Received: via spool by 21867-submit@debbugs.gnu.org id=B21867.156468273616546 (code B ref 21867); Thu, 01 Aug 2019 18:06:02 +0000 Original-Received: (at 21867) by debbugs.gnu.org; 1 Aug 2019 18:05:36 +0000 Original-Received: from localhost ([127.0.0.1]:55156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htFSK-0004Io-35 for submit@debbugs.gnu.org; Thu, 01 Aug 2019 14:05:36 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:43634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htFSH-0004If-W9 for 21867@debbugs.gnu.org; Thu, 01 Aug 2019 14:05:34 -0400 Original-Received: from 77.18.62.220.tmi.telenormobil.no ([77.18.62.220] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1htFSD-0002dB-Qz; Thu, 01 Aug 2019 20:05:32 +0200 In-Reply-To: (Zachary Kanfer's message of "Sun, 8 Nov 2015 23:58:01 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164246 Archived-At: Zachary Kanfer 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] > [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 s: C-x C-e ;; eval-last-sexp a ;; next-line ;; 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