From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Severe lossage from unread-command-events Date: Thu, 06 Aug 2015 17:33:25 +0200 Message-ID: <87fv3w2zzu.fsf@fencepost.gnu.org> References: <87egjh4u1h.fsf@fencepost.gnu.org> <83pp30sd5l.fsf@gnu.org> <87k2t831gf.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1438875215 12018 80.91.229.3 (6 Aug 2015 15:33:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Aug 2015 15:33:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 06 17:33:35 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZNNAk-0004lf-1Z for ged-emacs-devel@m.gmane.org; Thu, 06 Aug 2015 17:33:34 +0200 Original-Received: from localhost ([::1]:45574 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNNAj-0005fh-7q for ged-emacs-devel@m.gmane.org; Thu, 06 Aug 2015 11:33:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNNAd-0005fP-TG for emacs-devel@gnu.org; Thu, 06 Aug 2015 11:33:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNNAc-0003XV-IY for emacs-devel@gnu.org; Thu, 06 Aug 2015 11:33:27 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNNAc-0003XC-EU for emacs-devel@gnu.org; Thu, 06 Aug 2015 11:33:26 -0400 Original-Received: from localhost ([127.0.0.1]:39942 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZNNAb-0004oF-PJ; Thu, 06 Aug 2015 11:33:26 -0400 Original-Received: by lola (Postfix, from userid 1000) id 22766E0E47; Thu, 6 Aug 2015 17:33:25 +0200 (CEST) In-Reply-To: <87k2t831gf.fsf@fencepost.gnu.org> (David Kastrup's message of "Thu, 06 Aug 2015 17:01:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188506 Archived-At: David Kastrup writes: > Eli Zaretskii writes: > >>> From: David Kastrup >>> Date: Wed, 05 Aug 2015 17:46:50 +0200 >>>=20 >>> run the included test file using >>>=20 >>> emacs -Q -l timer-test.el >>>=20 >>> and then open the generated dribble file /tmp/mydrib. On my computer, >>> it looks something like >>>=20 >>> 00000000000000000011111111111111111112222222222222222222233333333333333= 334444444444444444445555555555555555566666666666666666677777777777777777788= 88888888888888899999999999999999 >>>=20 >>> which means that of 4000 events having an effect in the scratch buffer, >>> about 5% (a non-deterministic amount) are actually recorded in the >>> dribble file. In particular, it looks like only the first of several >>> events placed into unread-command-events at one point of time will ever >>> see the dribble file. While I am only moderately interested in actually >>> generating a useful dribble file, the same holds for macro recording. >>> And I have an actual application which is severely impacted here. >>>=20 >>> Note that _all_ of the events (usually) are actually processed as input >>> in the *scratch* buffer. It is only the recording of them which falls >>> really, really flat on its face. >> >> My reading of the code in read_char is that when we consume events >> from unread-command-events, we don't always record the events we find >> there. > > Well, according to how I read the variable description of > unread-command-events, some are bounced back there from input which has > already been recorded. The description reads: > > Documentation: > List of events to be read as the command input. > These events are processed first, before actual keyboard input. > Events read from this list are not normally added to =E2=80=98this-co= mmand-keys=E2=80=99, > as they will already have been added once as they were read for the > first time. > An element of the form (t . EVENT) forces EVENT to be added to that l= ist. > > My test programs used (t . EVENT) after just using EVENT did not do the > trick either. However, I don't think most of the other uses of > unread-command-events I have seen bother doing so. It might or might > not be a red herring. > >> Does the following na=C3=AFve attempt at fixing this give good results? = If >> not, can you tell why not, or show a test case where it misbehaves? > > I'll be giving it a try. The code in keyboard.c is complex to a degree > where I do not trust myself to venture a guess regarding the nature of > the right fix. Or whether the code is in need of reorganization before > one can hope to get it right anyway. Another data point would be Artur Malabarba's message about executing keyboard macros which I answered in . >From glancing over your proposed fix, it's very much focused on dealing with recording only. Which has the advantage of not causing changes elsewhere. Artur's message, however, would suggest that there might be a necessity for changes elsewhere. I have no idea whether those changes would be related or concern the same code. I just wanted to bring this up while I remember. Artur's original report stated that he "noticed" the problems "recently". If that means that they started _occuring_ recently, they are probably an unrelated issue. --=20 David Kastrup