all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vasilij Schneidermann <v.schneidermann@gmail.com>
To: 24514@debbugs.gnu.org
Subject: bug#24514: 24.5; [WIP][PATCH] Lispy backtraces
Date: Tue, 27 Sep 2016 21:16:03 +0200	[thread overview]
Message-ID: <20160927191603.GA610@odonien.localdomain> (raw)
In-Reply-To: <20160922231447.GA3833@odonien.localdomain>

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

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?

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

From 7b953b3ec64b26edd812d0ad3e4e01bad4f94193 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  |  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


  parent reply	other threads:[~2016-09-27 19:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
     [not found]     ` <82e39377-f31b-698c-5a9a-343868686799@gmail.com>
     [not found]       ` <20161202005226.GA4215@odonien.localdomain>
2016-12-02  1:23         ` bug#24514: 24.5; " Clément Pit--Claudel
2016-12-02  2:24           ` Stefan Monnier
2016-12-03 22:15             ` Clément Pit--Claudel
2016-12-04 15:30               ` Eli Zaretskii
2016-12-04 19:27                 ` Clément Pit--Claudel
2016-12-04 20:41                   ` Eli Zaretskii
2016-12-04 22:14                     ` Clément Pit--Claudel
2016-12-05  3:30                       ` Eli Zaretskii
2016-12-05  6:02                         ` Lisp-friendly backtraces [was: Lispy backtraces] Clément Pit--Claudel
2016-12-05 13:20                           ` Stefan Monnier
2016-12-05 14:14                             ` Clément Pit--Claudel
2016-12-05 14:37                               ` Stefan Monnier
2016-12-05 16:31                                 ` Clément Pit--Claudel
2016-12-05 16:54                                   ` Eli Zaretskii
2016-12-05 16:23                               ` Eli Zaretskii
2016-12-05 18:59                                 ` Clément Pit--Claudel
2016-12-06 18:55                                   ` Eli Zaretskii
2016-12-07  8:27                                     ` Clément Pit--Claudel
2016-12-12 22:42                                       ` Clément Pit--Claudel
2016-09-23  8:12   ` bug#24514: 24.5; [WIP][PATCH] Lispy backtraces 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160927191603.GA610@odonien.localdomain \
    --to=v.schneidermann@gmail.com \
    --cc=24514@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.