Subject: bug#9764: 24.0.90; Stop tracing in Edebug

From: Michael Heerdegen <[email-masked]>
Date: Wed, 15 Feb 2012 03:19:51 +0100

Dani Moncayo <[email-masked]> writes:

> From "emacs -Q":
>
> 1. Instrument the function [a] for Edebug ("C-u C-M-x" from the function).
> 2. Type "(fac 3) C-x C-e" (to begin Edebugging).
> 3. Type "t" (to start tracing).
> 4. Before the execution ends, type "S" (to stop tracing).
> --> (Observed) Tracing does not stop (SPC, "n" or any other command
> doesn't seem to work either).
> --> (Expected) Tracing stops, as described in [b].

I tried to debug this.  Have a look at `edebug-display'.  The user input
"S" typically happens here:

  ;; not edebug-break
  ((eq edebug-execution-mode 'trace)
   (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause.

in the `edebug-sit-for'.

The following code doesn't check for pending input.

And at the end of the defun, in the unwind clause of `unwind-protect',
`unread-command-events' gets reset to the value of
`edebug-outside-unread-command-events', canceling the user input.

HTH,

Michael.