3

I mistakenly ran a keyboard macro with an Infinite Argument, which made the macro execute endlessly. Take the following example, which just inserts the character a:

C-x ( a C-x )

If I then run:

C-u 0 C-x e

in the *scratch* buffer, the newly defined keyboard macro will be executed over and over again.

I tried C-g several times, as well as ESC-ESC-ESC, but the execution did not stop, and I had to kill Emacs, as it was not responding. Is there any way to halt the execution of a macro without losing the Emacs session?

In case it makes a difference, the Emacs version I tried is 24.3.1.

Keta
  • 33
  • 3
  • When Emacs hangs it might be still possible to enter debugger by sending it a signal: http://emacs.stackexchange.com/questions/7565 - here's how to do it. – wvxvw Mar 09 '15 at 14:39
  • 1
    `C-g` should work (it just did for me). Try holding it down. – nanny Mar 09 '15 at 14:40

1 Answers1

3

C-g works for me, starting from emacs -Q (no init file). I did that with both Emacs 24.3 and a recent development snapshot for Emacs 25.

If you can give a recipe to reproduce what you see, starting from emacs -Q, consider sending a bug report: M-x report-emacs-bug.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • That's right, I tried it on my home computer (Emacs 24.3.50.1) and `C-g` worked fine. I will consider sending a bug report. Thanks! – Keta Mar 13 '15 at 17:46