From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6991: Please keep bytecode out of *Backtrace* buffers Date: Sun, 25 Jun 2017 15:11:02 -0400 Message-ID: References: <8739tm9vzl.fsf@jidanni.org> <2223f654-1e67-4a9a-a471-828fd4078410@default> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498417937 12198 195.159.176.226 (25 Jun 2017 19:12:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Jun 2017 19:12:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: lekktu@gmail.com, johnw@gnu.org, 6991@debbugs.gnu.org, larsi@gnus.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 25 21:12:12 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 1dPCx8-0002iz-Ek for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Jun 2017 21:12:10 +0200 Original-Received: from localhost ([::1]:43532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPCxB-0003Ad-To for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Jun 2017 15:12:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPCx5-0003AF-1B for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 15:12:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPCx0-0000Av-30 for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 15:12:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPCwz-0000An-W3 for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 15:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dPCwz-0002Nl-K4 for bug-gnu-emacs@gnu.org; Sun, 25 Jun 2017 15:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Jun 2017 19:12:01 +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.14984178739095 (code B ref 6991); Sun, 25 Jun 2017 19:12:01 +0000 Original-Received: (at 6991) by debbugs.gnu.org; 25 Jun 2017 19:11:13 +0000 Original-Received: from localhost ([127.0.0.1]:37617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPCwD-0002Mc-FQ for submit@debbugs.gnu.org; Sun, 25 Jun 2017 15:11:13 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:56011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPCwA-0002MT-Sv for 6991@debbugs.gnu.org; Sun, 25 Jun 2017 15:11:12 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v5PJB3UH030293; Sun, 25 Jun 2017 15:11:04 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id C0BAD662E4; Sun, 25 Jun 2017 15:11:02 -0400 (EDT) In-Reply-To: <87o9tdowbh.fsf@users.sourceforge.net> (npostavs's message of "Sat, 24 Jun 2017 18:27:46 -0400") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6055=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6055> : inlines <5949> : streams <1751486> : uri <2450579> 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:133899 Archived-At: > I made use of cl-prin1 depend on a custom option, and replace NUL bytes > also in w32. I think this is ready to merge now, I will probably do so > sometime next week. A few questions below. > + (when fun-file > + (make-text-button fun-pt (+ fun-pt (length (symbol-name fun))) > + :type 'help-function-def > + 'help-args (list fun fun-file)))) Hmm... this looks like code which was moved from elsewhere, yet I can't find this elsewhere in your patch(es). I think that other code is in debugger-make-xrefs, so can't we remove debugger-make-xrefs? > + (let ((frames (nthcdr > + ;; Remove debug--implement-debug-on-entry and the > + ;; advice's `apply' frame. > + (if (eq (car args) 'debug) 3 1) > + (backtrace-frames 'debug))) > + (print-escape-newlines t) > + (print-level 8) > + (print-length 50)) Why let-bind print-* here rather than inside debugger-insert-backtrace? > + (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? > + (pcase (help-split-fundoc (documentation object 'raw) object) > + (`(,_ . ,(and doc (guard (stringp doc)))) > + (princ " " stream) > + (prin1 doc stream))) Maybe this deserves a one-line comment explaining that the arglist part was already printed via help-function-arglist. > +(defcustom debugger-print-function #'cl-prin1 > + "Function used to print values in the debugger backtraces." > + :type 'function > + :options '(cl-prin1 prin1) > + :group 'debugger > + :version "26.1") The `:group 'debugger` is redundant (as is the case for all defcustom in this file). > +(defvar cl-print-compiled) Is this used somewhere? > - (prin1 fun) > - (if args (prin1 args) (princ "()"))) > + (funcall debugger-print-function fun) > + (if args (cl-prin1 args) (princ "()"))) This `cl-prin1` should be replaced with debugger-print-function, right? Stefan