Subject: Re: bug#6991: Please keep bytecode out of *Backtrace* buffers

From: Stefan Monnier <[email-masked]>
Date: Mon, 26 Jun 2017 10:54:06 -0400

> Ah, sorry, my memory of the old code got a little fuzzy, it doesn't
> correspond to backtrace--print-frame (that function only contains the
> code which reads the :debug-on-exit flag).  It's actually replacing the
> code removed in this hunk:

> @@ -301,10 +319,7 @@ (defun debugger-setup-buffer (args)
>         (setq pos (point))
>         (setq debugger-value (nth 1 args))
>         (prin1 debugger-value (current-buffer))
> -       (insert ?\n)
> -       (delete-char 1)
> -       (insert ? )
> -       (beginning-of-line))
> +       (insert ?\n))
>        ;; Watchpoint triggered.
>        ((and `watchpoint (let `(,symbol ,newval . ,details) (cdr args)))
>         (insert

> So it's another instance of operating on the backtrace frame object
> directly, instead of manipulating the text after printing (i.e.,
> unsetting the :debug-on-exit flag instead of erasing its representation
> "*" in the buffer).

Ah, yes, I see it now, thanks.  It's a good change, then: the new code
is more clear.  I wonder why we do that, tho:
the previous code didn't have a comment, so I'm left guessing that maybe
it's that we don't want to advertise as "will stop when exiting foo"
a function which we're exiting?

> Also, as I'm looking at this, I wonder if I should replace the (prin1
> debugger-value ...) calls with (funcall debugger-print-function ...)

Sounds right.

> too.  Hmm, and I probably shouldn't have moved those print-*
> let-bindings at all because they could be relevant to the code printing
> "frame 0".

Good point.

        Stefan