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: Manipulating unread-command-events Date: Wed, 15 Jul 2015 15:24:21 +0200 Message-ID: <87io9lfta2.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436966679 6306 80.91.229.3 (15 Jul 2015 13:24:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jul 2015 13:24:39 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 15 15:24:39 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 1ZFMfu-0001cK-Nu for ged-emacs-devel@m.gmane.org; Wed, 15 Jul 2015 15:24:38 +0200 Original-Received: from localhost ([::1]:36006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFMft-0008NH-Rn for ged-emacs-devel@m.gmane.org; Wed, 15 Jul 2015 09:24:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFMff-0008Mf-OT for emacs-devel@gnu.org; Wed, 15 Jul 2015 09:24:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFMfe-00032a-OR for emacs-devel@gnu.org; Wed, 15 Jul 2015 09:24:23 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFMfe-00032M-L5 for emacs-devel@gnu.org; Wed, 15 Jul 2015 09:24:22 -0400 Original-Received: from localhost ([127.0.0.1]:35300 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZFMfe-0000b1-74 for emacs-devel@gnu.org; Wed, 15 Jul 2015 09:24:22 -0400 Original-Received: by lola (Postfix, from userid 1000) id 914D2E0DE0; Wed, 15 Jul 2015 15:24:21 +0200 (CEST) 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:187881 Archived-At: Hi, I have a package creating events for Midi input and it works by pushing the created events into unread-command-events, sometimes several events in one go. This works only so-so, and particularly badly when recording in keyboard macros (not only there, but the lossage there is much worse than elsewhere). If you do git grep '(setq unread-command-events' in the Emacs sources, it's rather obvious that _lots_ of Emacs internals do not bother retaining any pending input in unread-command-events and just plaster over whatever might have been stored there before. When looking closer at all of the resulting lines, it is rather the majority of uses which overwrite any pending input there (the situation looks slightly worse than it is because some good uses employ `push' rather than `setq', but not all that many). Any idea how to salvage that situation? As it is, keyboard macro recording is unusable when input is delivered from non-keyboard sources. It probably loses about 10% of input for simultaneously delivered events. -- David Kastrup