From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#20074: edebug tracing can't be stopped with 'S' Date: 15 Mar 2015 19:55:10 -0000 Organization: muc.de e.V. Message-ID: <20150315195510.9240.qmail@mail.muc.de> References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1426449383 15586 80.91.229.3 (15 Mar 2015 19:56:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Mar 2015 19:56:23 +0000 (UTC) Cc: Mario Valencia To: 20074@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 15 20:56:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YXEdt-0003iy-GZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Mar 2015 20:56:09 +0100 Original-Received: from localhost ([::1]:44596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXEds-0004JQ-N2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Mar 2015 15:56:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXEdq-0004IZ-4T for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 15:56:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXEdm-0003jt-UA for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 15:56:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXEdm-0003jp-RE for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 15:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YXEdm-0000s3-7a for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2015 15:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Mar 2015 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20074 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20074-submit@debbugs.gnu.org id=B20074.14264493193284 (code B ref 20074); Sun, 15 Mar 2015 19:56:02 +0000 Original-Received: (at 20074) by debbugs.gnu.org; 15 Mar 2015 19:55:19 +0000 Original-Received: from localhost ([127.0.0.1]:47411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXEd4-0000qt-Ea for submit@debbugs.gnu.org; Sun, 15 Mar 2015 15:55:19 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:16090 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YXEcx-0000qe-LI for 20074@debbugs.gnu.org; Sun, 15 Mar 2015 15:55:16 -0400 Original-Received: (qmail 9241 invoked by uid 3782); 15 Mar 2015 19:55:10 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/10.1-RELEASE (amd64)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100504 Archived-At: Hello, Mario. In article I wrote: > In article 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 : >>> 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).