I've managed to write a timer that reliably causes keyboard input not to be accepted until I press Ctrl-G.

The issue is, I don't know what causes the timer to lock up, what the stack frame is when it's locked up, or how to unlock it.

  • (signal 'quit) resolves the issue but this isn't a reasonable fix.
  • Using gdb doesn't point to a function which is blocking input.
  • toggle-debug-on-quit doesn't give a useful stack trace.

In Python I can press Ctrl-C to get a stack trace of the code being executed. Why doesn't Emacs let me interrupt my timer's code with C-g?

  • What do you mean by "(signal 'quit) resolves the issue"? How/when can your code decide to call (signal 'quit)? – Stefan May 29 '19 at 18:11
  • 1
    timer code always runs with inhibit-quit bound to a non-nil value (so that it doesn't get accidentally aborted just because the user hit C-g at that moment for some completely unrelated reason (e.g. to get out of a minibuffer)). – Stefan May 29 '19 at 18:13
  • Have you tried sending SIGUSR2 to Emacs? – user12563 May 30 '19 at 12:27

Maybe toggle-debug-on-quit will help.

Toggle whether to enter Lisp debugger when C-g is pressed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.