unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24514: 24.5; [WIP][PATCH] Lispy backtraces
@ 2016-09-22 23:14 Vasilij Schneidermann
  2016-09-23  2:22 ` Clément Pit--Claudel
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Vasilij Schneidermann @ 2016-09-22 23:14 UTC (permalink / raw)
  To: 24514

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

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.

[-- Attachment #2: 0001-Make-backtraces-great-again.patch --]
[-- Type: text/x-diff, Size: 1342 bytes --]

From 232cb613a83f128d8ee90d7a52fcbde06fd29766 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <v.schneidermann@gmail.com>
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


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-10-12 15:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 23:14 bug#24514: 24.5; [WIP][PATCH] Lispy backtraces Vasilij Schneidermann
2016-09-23  2:22 ` Clément Pit--Claudel
2016-09-23  7:51   ` Vasilij Schneidermann
2016-09-23 13:22     ` Clément Pit--Claudel
2016-09-23  8:12   ` Vasilij Schneidermann
2016-09-23  9:44   ` Eli Zaretskii
2016-09-23  9:55     ` bug#24515: " Vasilij Schneidermann
2016-09-23 10:06       ` Eli Zaretskii
2016-09-23 13:25       ` Clément Pit--Claudel
2016-09-23 16:33         ` John Wiegley
     [not found] ` <mailman.2864.1474586229.22741.bug-gnu-emacs@gnu.org>
2016-09-23 18:47   ` Alan Mackenzie
2016-09-23 20:43 ` Richard Stallman
2016-09-27 19:16 ` Vasilij Schneidermann
2016-09-28 15:28   ` Eli Zaretskii
2016-09-30 10:29     ` Vasilij Schneidermann
2016-09-30 13:26       ` Eli Zaretskii
2016-10-12 15:34   ` Vasilij Schneidermann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).