bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20074: edebug tracing can't be stopped with 'S'


From: Alan Mackenzie
Subject: bug#20074: edebug tracing can't be stopped with 'S'
Date: 15 Mar 2015 19:55:10 -0000
User-agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/10.1-RELEASE (amd64))

Hello, Mario.

In article <address@hidden> I wrote:

> In article <address@hidden> you wrote:
>> [-- text/plain, encoding quoted-printable, charset: UTF-8, 72 lines --]

>> The manual should have a note indicating this is unimplemented
>> functionality, and the feature should be put in the emacs to-do list. I
>> consider this to be high priority. Also please don't forget to include my
>> email as a recipient for messages in this bug.

>> 2015-03-13 3:36 GMT-06:00 Mario Valencia <address@hidden>:

>>> So is this going to be fixed or what?

> What is happening is that while tracing, edebug is waiting for an input
> event with "(sit-for 1)".  When you type the "S", sit-for pushes it onto
> `unread-command-events' and returns.  Unfortunately, before calling the
> recursive edit into the edebug command loop, `unread-command-events' gets
> bound to nil, thus edebug doesn't see the "S".  The motivation here is
> probably to separate the "outside" event queue from edebug's event queue.

> Here is a fix (which Eli will probably call a workaround ;-).  In trace
> mode, the top event (if any) is pulled off the "outside"
> `unread-command-events' and pushed onto edebug's binding of it.

Please disregard the above paragraphs and the patch in my last email.  They
were wrong.

What is actually happening is that while tracing, a "(sit-for 1)" in
edebug--display-1, when you press "S", pushes that event onto
`unread-command-events'.  However, there is nothing to trigger the entry
into the recursive edit.  Because `unread-command-events' is locally
bound in this defun, the "S" simply disappears when the enclosing `let'
form terminates.

The fix is to test the result of `sit-for', and to set `edebug-stop' when
a key was pressed.

Please try this out:

diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 1091877..c3c4035 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2506,7 +2528,8 @@ MSG is printed after `::::} '."
                (t (setq edebug-stop t))))
              ;; not edebug-break
              ((eq edebug-execution-mode 'trace)
-              (sit-for edebug-sit-for-seconds)) ; Force update and pause.
+              (if (not (sit-for edebug-sit-for-seconds))
+                 (setq edebug-stop t))) ; Force update and pause.
              ((eq edebug-execution-mode 'Trace-fast)
               (sit-for 0)))            ; Force update and continue.



-- 
Alan Mackenzie (Nuremberg, Germany).







reply via email to

[Prev in Thread] Current Thread [Next in Thread]