From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.bugs Subject: bug#24514: 24.5; [WIP][PATCH] Lispy backtraces Date: Tue, 27 Sep 2016 21:16:03 +0200 Message-ID: <20160927191603.GA610@odonien.localdomain> References: <20160922231447.GA3833@odonien.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" X-Trace: blaine.gmane.org 1475003918 7803 195.159.176.226 (27 Sep 2016 19:18:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Sep 2016 19:18:38 +0000 (UTC) User-Agent: Mutt/1.7.0 (2016-08-17) To: 24514@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 27 21:18:35 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boxtV-0008MI-9S for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Sep 2016 21:18:21 +0200 Original-Received: from localhost ([::1]:53063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boxtT-0006Sk-OC for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Sep 2016 15:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boxsJ-0005e7-2e for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2016 15:17:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boxsE-0000pZ-SW for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2016 15:17:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boxsE-0000pG-Nn for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2016 15:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1boxsE-0003DR-Eg for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2016 15:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Sep 2016 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24514-submit@debbugs.gnu.org id=B24514.147500378612294 (code B ref 24514); Tue, 27 Sep 2016 19:17:02 +0000 Original-Received: (at 24514) by debbugs.gnu.org; 27 Sep 2016 19:16:26 +0000 Original-Received: from localhost ([127.0.0.1]:37384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boxre-0003CD-HR for submit@debbugs.gnu.org; Tue, 27 Sep 2016 15:16:26 -0400 Original-Received: from mail-wm0-f49.google.com ([74.125.82.49]:38598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boxrc-0003Bt-SJ for 24514@debbugs.gnu.org; Tue, 27 Sep 2016 15:16:25 -0400 Original-Received: by mail-wm0-f49.google.com with SMTP id l132so30469696wmf.1 for <24514@debbugs.gnu.org>; Tue, 27 Sep 2016 12:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rgku3my9D0iOcMhi6cbUf8WRJvpynlEoQmxmoc9oAus=; b=uE3Xvi/4svLeoKpQHJ1Mk+6/ctQH30L/nlnRm8ctmwbBvuRCZDt9jDMp4rAoxmPL8X ck/PEPqPlTQYgZ8L0ibldlImGQyp92vb3EDo2OrSwppXGLu4DPbDM7cH3cpJNHCNGr/h RWAe2lbvO1+sGyLBLYWBCTPLWyGnDCXBsVW4MDLhlgF6rMk1+dW0baubWy3qauOIQJLy qulC1s7u2PzQx6SAbnYZjZqFxCbGWTuHJePjny1Bcde+lPS5riasITL45taCuVVEhoFx hYLqKc+VpPWDMzNFRIW2nzgbZdnnKmyn4hBmdk3BSm1k26HinuCMdqVv7KJHcWPd36rd 06Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rgku3my9D0iOcMhi6cbUf8WRJvpynlEoQmxmoc9oAus=; b=hNFJAPbN80zUy4Wu70hP4AG3p4gxMurtZ45iO+dWw+7iWyl9dM3YfLacK0QIWa4E1w Oel2WAhA//Nnrjl2QXVRq2IRx/3KOR7RQy6T0Rgx9E7vn5v7GzBVcXm6q/t9H1rCO+pu kUxobO7kLAvsJIj+e+US5y++O5cy3F1ex07U2tVRre3lrY+zdVnXZ9/SPWdT7lVpjGiI xeGml9DgNJjv23vk54r81Te/8vC5wBKFoCCwvad/nHT38f+PYAu81i/Beida0GK4oz6B urvdAOKtKJybd/3F75LclUS3ido4QZ4wgPvFnQLPOAhErL/m61lwamnLchwV7HAXNRgm 5RbQ== X-Gm-Message-State: AA6/9RlZEGuCXuH6j9hVnHYe9hRHzEfoQdyDWvPSZGdJXkIzDQZmiyYfU8HbVK/0ns/tyw== X-Received: by 10.28.154.142 with SMTP id c136mr4616189wme.102.1475003778741; Tue, 27 Sep 2016 12:16:18 -0700 (PDT) Original-Received: from localhost (dslb-088-077-124-050.088.077.pools.vodafone-ip.de. [88.77.124.50]) by smtp.gmail.com with ESMTPSA id b193sm11455205wmg.18.2016.09.27.12.16.17 for <24514@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Sep 2016 12:16:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20160922231447.GA3833@odonien.localdomain> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:123727 Archived-At: --KsGdsel6WgEHnImy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hello again, I've updated the patch as suggested to make the behavior configurable. I'm pretty sure though that the customization option's name is terrible. Any suggestions for a better one? --KsGdsel6WgEHnImy Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Make-backtraces-great-again.patch" >From 7b953b3ec64b26edd812d0ad3e4e01bad4f94193 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Thu, 22 Sep 2016 23:01:21 +0200 Subject: [PATCH] Make backtraces great again --- lisp/emacs-lisp/debug.el | 4 +++- lisp/emacs-lisp/edebug.el | 4 +++- src/eval.c | 12 ++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 22a3f39..c481ee2 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -279,7 +279,9 @@ That buffer should be current already." (goto-char (point-min)) (delete-region (point) (progn - (search-forward "\n debug(") + (search-forward (if debugger-lispy-backtrace + "\n (debug " + "\n debug(")) (forward-line (if (eq (car args) 'debug) ;; Remove debug--implement-debug-on-entry ;; and the advice's `apply' frame. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index c283c16..a2e9c00 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3797,7 +3797,9 @@ Otherwise call `debug' normally." (forward-line 1) (delete-region last-ok-point (point))) - ((looking-at "^ edebug") + ((looking-at (if debugger-lispy-backtrace + "^ (edebug" + "^ edebug")) (forward-line 1) (delete-region last-ok-point (point)) ))) diff --git a/src/eval.c b/src/eval.c index 72facd5..fc6e5a6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3409,13 +3409,17 @@ Output stream used is value of `standard-output'. */) else { tem = backtrace_function (pdl); + if (debugger_lispy_backtrace) + write_string ("("); Fprin1 (tem, Qnil); /* This can QUIT. */ - write_string ("("); + if (!debugger_lispy_backtrace) + write_string ("("); { ptrdiff_t i; for (i = 0; i < backtrace_nargs (pdl); i++) { - if (i) write_string (" "); + if (i || debugger_lispy_backtrace) + write_string(" "); Fprin1 (backtrace_args (pdl)[i], Qnil); } } @@ -3838,6 +3842,10 @@ This is nil when the debugger is called under circumstances where it might not be safe to continue. */); debugger_may_continue = 1; + DEFVAR_BOOL ("debugger-lispy-backtrace", debugger_lispy_backtrace, + doc: /* Non-nil means display call stack frames as lists. */); + debugger_lispy_backtrace = 0; + DEFVAR_LISP ("debugger", Vdebugger, doc: /* Function to call to invoke debugger. If due to frame exit, args are `exit' and the value being returned; -- 2.9.3 --KsGdsel6WgEHnImy--