Subject: bug#24514: closed (Re: 24.5; [WIP][PATCH] Lispy backtraces)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 12 Oct 2016 15:36:02 +0000

Your bug report

#24514: 24.5; [WIP][PATCH] Lispy backtraces

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24514: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24514
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: 24.5; [WIP][PATCH] Lispy backtraces
From: Vasilij Schneidermann <[email-masked]>
To: [email-masked]
Date: Wed, 12 Oct 2016 17:34:42 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Feature was fully implemented and committed to the respective branch.

Subject: 24.5; [WIP][PATCH] Lispy backtraces
From: Vasilij Schneidermann <[email-masked]>
To: [email-masked]
Date: Fri, 23 Sep 2016 01:14:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I wrote a minimal patch that increases the overall consistency in a
backtrace buffer by printing the call stack frames as S-Expressions.

Before:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p t)
  +(1 t)
  eval((+ 1 t) nil)
  eval-expression((+ 1 t) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

After:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p t)
  (debug error (wrong-type-argument number-or-marker-p t))
  (+ 1 t)
  (eval (+ 1 t) nil)
  (eval-expression (+ 1 t) nil)
  (funcall-interactively eval-expression (+ 1 t) nil)
  (call-interactively eval-expression nil nil)
  (command-execute eval-expression)

Now, this patch isn't perfect.  For some reason there's an extra debug
line in the second version, I've yet to investigate into the reason for
this.  The other problem is that while I can't imagine any reason to go
back to the original view of the backtrace, I cannot rule out that this
change might break other tools relying on it.  I'd appreciate any
feedback on this.
>From 232cb613a83f128d8ee90d7a52fcbde06fd29766 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <[email-masked]>
Date: Thu, 22 Sep 2016 23:01:21 +0200
Subject: [PATCH] Make backtraces great again

---
 lisp/emacs-lisp/debug.el | 2 +-
 src/eval.c               | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 22a3f39..4020620 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -279,7 +279,7 @@ That buffer should be current already."
   (goto-char (point-min))
   (delete-region (point)
 		 (progn
-		   (search-forward "\n  debug(")
+		   (search-forward "\n  (debug")
 		   (forward-line (if (eq (car args) 'debug)
                                      ;; Remove debug--implement-debug-on-entry
                                      ;; and the advice's `apply' frame.
diff --git a/src/eval.c b/src/eval.c
index 72facd5..e32e7a1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3409,8 +3409,9 @@ Output stream used is value of `standard-output'.  */)
       else
 	{
 	  tem = backtrace_function (pdl);
-	  Fprin1 (tem, Qnil);	/* This can QUIT.  */
 	  write_string ("(");
+	  Fprin1 (tem, Qnil);	/* This can QUIT.  */
+	  write_string (" ");
 	  {
 	    ptrdiff_t i;
 	    for (i = 0; i < backtrace_nargs (pdl); i++)
-- 
2.9.3