From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#6991: Please keep bytecode out of *Backtrace* buffers Date: Mon, 26 Jun 2017 08:50:47 -0400 Message-ID: <87h8z2oqu0.fsf@users.sourceforge.net> References: <8739tm9vzl.fsf@jidanni.org> <87fumokzbp.fsf@users.sourceforge.net> <83oa1bc3x2.fsf@gnu.org> <87d1hrlek2.fsf@users.sourceforge.net> <83eg27bjah.fsf@gnu.org> <87a8cvlcmk.fsf@users.sourceforge.net> <8360njb9o5.fsf@gnu.org> <877f7zksm0.fsf@users.sourceforge.net> <83oa1a9msk.fsf@gnu.org> <83vavf73ei.fsf@gnu.org> <8360ne6v1q.fsf@gnu.org> <874m2ujh2v.fsf@users.sourceforge.net> <87wpcwkuug.fsf@users.sourceforge.net> <87zidx3u5u.fsf@users.sourceforge.net> <87o9tdowbh.fsf@users.sourceforge.net> <87mv8vo1zz.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498481425 19666 195.159.176.226 (26 Jun 2017 12:50:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2017 12:50:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: lekktu@gmail.com, johnw@gnu.org, 6991@debbugs.gnu.org, larsi@gnus.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 26 14:50:16 2017 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 1dPTT3-0004bG-Gq for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jun 2017 14:50:13 +0200 Original-Received: from localhost ([::1]:46491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPTT8-0006jq-Jy for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jun 2017 08:50:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPTSy-0006hx-PE for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2017 08:50:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPTSt-00074K-3z for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2017 08:50:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPTSt-000744-0Z for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2017 08:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dPTSs-0005Pf-Ju for bug-gnu-emacs@gnu.org; Mon, 26 Jun 2017 08:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Jun 2017 12:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6991 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 6991-submit@debbugs.gnu.org id=B6991.149848135920747 (code B ref 6991); Mon, 26 Jun 2017 12:50:02 +0000 Original-Received: (at 6991) by debbugs.gnu.org; 26 Jun 2017 12:49:19 +0000 Original-Received: from localhost ([127.0.0.1]:38156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPTSB-0005OZ-1K for submit@debbugs.gnu.org; Mon, 26 Jun 2017 08:49:19 -0400 Original-Received: from mail-it0-f68.google.com ([209.85.214.68]:34504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPTS9-0005ON-Pv for 6991@debbugs.gnu.org; Mon, 26 Jun 2017 08:49:18 -0400 Original-Received: by mail-it0-f68.google.com with SMTP id y134so28503itc.1 for <6991@debbugs.gnu.org>; Mon, 26 Jun 2017 05:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=OBZ4zS+fDnsYbFKWKAmOffs1gqbrdy8l0wa3WHUoTno=; b=DjPGUWQOYT7Pyq/kHa5679lcVcfrbnIrziinTAmT04JFu6TewkpNngnzH8heDc2ope OHxSy7WlMRnWPoZoLOg9GrLQ8TmtrfLWDdj7ykovoW+sftxHb4X30tCbLktCE5b2EFyh suNK6GTFT+Y8KQ9hSsgkiw+4vB038zmFebrPoWuht2GXxaZxeqeGjUcQU2bb16I0Q6nx Up8vaVPDuUh10ods4O0vnfLhLT2VtuxRRtqbGGJDCa6NLNbpI3DZHtfNYgKGmgG4zl+X mbKnm145H6EnIH50BZtlGczlS4LN7HK/9vTj4Bpv2UxBDTLjRJb1vyZ29jjRf3nf4Ynk D+zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=OBZ4zS+fDnsYbFKWKAmOffs1gqbrdy8l0wa3WHUoTno=; b=jW3wXoCdSEAEscWjdIkcMIoH6lZqRZjSnjpmlr8fVM8qx3TiLkVX2z8NOhylVz7vZa hjW/RU8KeDwTdfzxcS45mykRstzv8Gswe1lGrWnGkSE7fd1PDv13x1onft1Jh8WTiY6C 2aVeIlQeoS9ujjBgRduRPiFDILC2rWLCvasu1zWREX5jL0cmyIxCqPQRu4bAIGZTevhk L3gKzmpQgecfM89QeHQ75ujVj2VPdeF3e4fXaloyMToyTo8r5p6eIw+xFGnqwnm18j1K SwXlM6gy0c+kF+OaVNttN5bI1TbFVF9JHCUk88YhyR3JRnNczsX7w29rz/t/acOls/jl KBaA== X-Gm-Message-State: AKS2vOyfRL18sh04TD0GVOL+wbJfJj/mg1e2AVtYz3CxxeBIbrzS+sC8 sJkaukYNxmvc4A== X-Received: by 10.36.54.82 with SMTP id l79mr73506itl.16.1498481351962; Mon, 26 Jun 2017 05:49:11 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id r124sm5273iod.38.2017.06.26.05.49.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2017 05:49:11 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 26 Jun 2017 00:02:17 -0400") 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:133922 Archived-At: Stefan Monnier writes: >> It does replace the functionality of debugger-make-xrefs. But >> `ert--make-xrefs-region' is still using `debugger-make-xrefs', and I >> don't quite see how to remove that usage. > > I see. Maybe we should move it to ert.el, then? Sure. >>>> + (print-escape-newlines t) >>>> + (print-level 8) >>>> + (print-length 50)) >>> >>> Why let-bind print-* here rather than inside debugger-insert-backtrace? > >> I thought moving those inside might needlessly make the function less >> flexible, though nobody is currently making use of the flexibility so >> maybe it's not worth it... > > Hmm... I can agree with it for level and length, but I think that the > escape-newline behavior is indispensable. Okay, that makes sense. >>>> + (when (eq (car args) 'exit) >>>> + (setf (cl-getf (nth 3 (car frames)) :debug-on-exit) nil)) >>> >>> This looks like code which was moved from elsewhere, yet I can't find >>> this elsewhere in your patch(es). What am I missing? > >> backtrace--print-frame I guess? I haven't changed the printing for >> `backtrace', perhaps I should... > > Hmm... I don't see anything that corresponds to this setf in > backtrace--print-frame. What do the above 2 lines do, and where is the > corresponding code in the current debug.el? Or is that a new feature in > your code? (if so, where is it documented in the commit message?) 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). Also, as I'm looking at this, I wonder if I should replace the (prin1 debugger-value ...) calls with (funcall debugger-print-function ...) 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".