GNU bug report logs - #25860
25.1; Double macro execution

Previous Next

Package: emacs;

Reported by: Marek Twardochlib <wasserwerk.studio <at> googlemail.com>

Date: Fri, 24 Feb 2017 13:13:01 UTC

Severity: normal

Tags: confirmed

Found in version 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 25860 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 25860 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu, jwiegley <at> gmail.com,
 Marek Twardochlib <wasserwerk.studio <at> googlemail.com>,
 Andreas Schwab <schwab <at> linux-m68k.org>, eliz <at> gnu.org
Subject: Re: bug#25860: 25.1; Double macro execution
Date: Sun, 26 Feb 2017 02:12:33 -0500
tags 25860 confirmed
quit

Tino Calancha <tino.calancha <at> gmail.com> writes:
> Thank you for the additional information.
> You are right.  This is a regression introduced in Emacs 25.1.
>
> I] Not observed with Emacs-24.5.
> II] I reproduce the issue with Emacs-25.1.
> *)  I see the issue with Emacs-25.1 even after loading kmacro.el
>     from Emacs-24.5.  That seems to point to changes in the
>     C source code; maybe some changes in src/macro.c?
>
> I am having some difficulties to do a bisect to track down
> changes in macro.c.  Maybe someone can do it much faster and find
> the commit causing this issue.

I traced the execution in gdb, the code removed in the following diff
seems to be the culprit:

--- 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.

1: 2015-08-10 21:15:03 +0300 30a6b1f81412044aa7dda5573b0142a0a03c4fd3
  Fix recording of events pushed onto unread-command-events



Slightly simpler reproduction: evaluate

    (defun insert-a ()
      (interactive)
      (execute-kbd-macro "a" 1))
    (define-key global-map [f12] 'insert-a)

then f3 f12 f4 C-x e




This bug report was last modified 7 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.