From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Lisp-friendly backtraces [was: Lispy backtraces] Date: Tue, 06 Dec 2016 20:55:36 +0200 Message-ID: <83vauwj39z.fsf@gnu.org> References: <20160922231447.GA3833@odonien.localdomain> <98fbb582-3da4-bd83-a2e9-e341dd7f6140@gmail.com> <20160923075116.GA612@odonien.localdomain> <82e39377-f31b-698c-5a9a-343868686799@gmail.com> <20161202005226.GA4215@odonien.localdomain> <0a69afa7-e9e6-e75f-8e90-6438683db98d@gmail.com> <53ba4534-1ec3-4e4f-d929-1a72f79c1abe@gmail.com> <83mvgblniy.fsf@gnu.org> <143c480c-a9db-7053-4b70-175633197981@gmail.com> <83a8cbl94w.fsf@gnu.org> <233f14a0-7542-5d0c-d8da-209e7e5e54f7@gmail.com> <838trvkq72.fsf@gnu.org> <27574c57-658c-c87b-4ddc-b24f83e2867c@gmail.com> <81066f70-ceed-af88-43ce-c8baefde189a@gmail.com> <83twaijqes.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1481050566 21686 195.159.176.226 (6 Dec 2016 18:56:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2016 18:56:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?windows-1252?Q?Cl=E9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 06 19:56:02 2016 Return-path: Envelope-to: ged-emacs-devel@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 1cEKuG-0004ib-67 for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2016 19:56:00 +0100 Original-Received: from localhost ([::1]:34105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEKuK-0003ji-4q for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2016 13:56:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEKtn-0003jO-A2 for emacs-devel@gnu.org; Tue, 06 Dec 2016 13:55:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEKth-0006BH-PR for emacs-devel@gnu.org; Tue, 06 Dec 2016 13:55:31 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEKth-0006BC-MQ; Tue, 06 Dec 2016 13:55:25 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4679 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cEKtf-0008Sf-Dr; Tue, 06 Dec 2016 13:55:25 -0500 In-reply-to: (message from =?windows-1252?Q?Cl=E9ment?= Pit--Claudel on Mon, 5 Dec 2016 13:59:03 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210090 Archived-At: > Cc: emacs-devel@gnu.org > From: Clément Pit--Claudel > Date: Mon, 5 Dec 2016 13:59:03 -0500 > > Done and done :) See attached patch. Thanks. > +@defun mapbacktrace function &optional base > +The function @code{mapbacktrace} calls @var{function} once for each > +frame in the backtrace, starting at the first frame whose > +@var{function} is base (or from the top if @var{base} is omitted or ^^^^^^^^^^^^^^^^^^^^^^ Here, "function" should not have the @var markup, and "base" should. > +the only supported property is @code{:debug-on-exit}, which is t if ^ @code{t} > +the frame's debug-on-exit flag is set. ^^^^^^^^^^^^^ @code{debug-on-exit} Also, suggest to say "stack frame's", to avoid confusion with the frames on display. > +(defun backtrace-frames (&optional base) > + "Collect all frames of current backtrace into a list. > +If non-nil BASE should be a function, and frames before its ^ Comma here. > +(defun backtrace-frame (nframes &optional base) > + "Return the function and arguments NFRAMES up from current execution point. > +If non-nil BASE should be a function, and NFRAMES counts from its ^ Likewise. > + if (backtrace_debug_on_exit (pdl)) > + flags = Fcons (QCdebug_on_exit, Fcons (Qt, Qnil)); ^^^^ Too many blanks here. Should be only 2. Otherwise, LGTM. Thanks for doing this!