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 #34 received at 25860 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: 25860 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu, tino.calancha <at> gmail.com,
 jwiegley <at> gmail.com, wasserwerk.studio <at> googlemail.com, schwab <at> linux-m68k.org
Subject: Re: bug#25860: 25.1; Double macro execution
Date: Sun, 26 Feb 2017 17:33:27 +0200
> From: npostavs <at> users.sourceforge.net
> Cc: Marek Twardochlib <wasserwerk.studio <at> googlemail.com>,  25860 <at> debbugs.gnu.org,  eggert <at> cs.ucla.edu,  jwiegley <at> gmail.com,  Andreas Schwab <schwab <at> linux-m68k.org>,  eliz <at> 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.  */




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.