From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25860: 25.1; Double macro execution Date: Sun, 26 Feb 2017 17:33:27 +0200 Message-ID: <83h93hq854.fsf@gnu.org> References: <87zihbbrxr.fsf@linux-m68k.org> <8737f14k68.fsf@gmail.com> <87y3wte87y.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1488123323 8191 195.159.176.226 (26 Feb 2017 15:35:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Feb 2017 15:35:23 +0000 (UTC) Cc: 25860@debbugs.gnu.org, eggert@cs.ucla.edu, tino.calancha@gmail.com, jwiegley@gmail.com, wasserwerk.studio@googlemail.com, schwab@linux-m68k.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 26 16:35:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ci0qo-0000t2-Kj for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Feb 2017 16:35:06 +0100 Original-Received: from localhost ([::1]:47286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci0qu-0000nL-M6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Feb 2017 10:35:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci0qn-0000m5-FD for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2017 10:35:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci0qk-0004so-CL for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2017 10:35:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ci0qk-0004sa-91 for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2017 10:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ci0qj-0000zI-WC for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2017 10:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Feb 2017 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25860 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 25860-submit@debbugs.gnu.org id=B25860.14881232533723 (code B ref 25860); Sun, 26 Feb 2017 15:35:01 +0000 Original-Received: (at 25860) by debbugs.gnu.org; 26 Feb 2017 15:34:13 +0000 Original-Received: from localhost ([127.0.0.1]:56898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ci0px-0000xz-GM for submit@debbugs.gnu.org; Sun, 26 Feb 2017 10:34:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ci0pu-0000xm-N4 for 25860@debbugs.gnu.org; Sun, 26 Feb 2017 10:34:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci0pm-0004HL-CS for 25860@debbugs.gnu.org; Sun, 26 Feb 2017 10:34:05 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci0pZ-00048X-49; Sun, 26 Feb 2017 10:33:49 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2003 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ci0pY-0005Ge-2m; Sun, 26 Feb 2017 10:33:48 -0500 In-reply-to: <87y3wte87y.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:129818 Archived-At: > From: npostavs@users.sourceforge.net > Cc: Marek Twardochlib , 25860@debbugs.gnu.org, eggert@cs.ucla.edu, jwiegley@gmail.com, Andreas Schwab , eliz@gnu.org > Date: Sun, 26 Feb 2017 02:12:33 -0500 > > --- i/src/keyboard.c > +++ w/src/keyboard.c > @@ -3029,14 +3029,6 @@ read_char (int commandflag, Lisp_Object map, > Vunread_post_input_method_events > = nconc2 (XCDR (tem), Vunread_post_input_method_events); > } > - /* When we consume events from the various unread-*-events lists, we > - bypass the code that records input, so record these events now if > - they were not recorded already. */ > - if (!recorded) > - { > - record_char (c); > - recorded = true; > - } > > reread_first: > > This was added in [1: 30a6b1f814]. Obviously just removing it will > reintroduce the bug it fixed, I'm not sure what the proper fix should > be. Like below? I admit that I don't see myself as an expert on all the complexity that goes on in keyboard.c and friends. With this change, kmacro-tests.el still passes, but I'm not sure that's good enough (e.g., can a macro define another macro when it runs? if so, this change will get in the way). Comments and test cases welcome. Thanks. diff --git a/src/keyboard.c b/src/keyboard.c index 0245dfa..ec4dee0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3245,7 +3245,7 @@ record_char (Lisp_Object c) } } } - else + else if (NILP (Vexecuting_kbd_macro)) store_kbd_macro_char (c); /* recent_keys should not include events from keyboard macros. */