From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#24514: 24.5; [WIP][PATCH] Lispy backtraces Date: Fri, 23 Sep 2016 09:22:15 -0400 Message-ID: <9682182c-2575-4827-2a22-ead1071c26d7@gmail.com> References: <20160922231447.GA3833@odonien.localdomain> <98fbb582-3da4-bd83-a2e9-e341dd7f6140@gmail.com> <20160923075116.GA612@odonien.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EGCJRPpQ8KfhVm2FbeEadNAujonfwCBAm" X-Trace: blaine.gmane.org 1474637000 8753 195.159.176.226 (23 Sep 2016 13:23:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Sep 2016 13:23:20 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 To: Vasilij Schneidermann , 24514@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 23 15:23:15 2016 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 1bnQRe-0001bI-2l for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Sep 2016 15:23:14 +0200 Original-Received: from localhost ([::1]:46095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnQRc-0005nV-F1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Sep 2016 09:23:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnQRW-0005mx-BV for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2016 09:23:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnQRS-0002R2-0c for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2016 09:23:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnQRR-0002Qw-TV for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2016 09:23:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bnQRR-000788-PD for bug-gnu-emacs@gnu.org; Fri, 23 Sep 2016 09:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Sep 2016 13:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24514 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24514-submit@debbugs.gnu.org id=B24514.147463695127366 (code B ref 24514); Fri, 23 Sep 2016 13:23:01 +0000 Original-Received: (at 24514) by debbugs.gnu.org; 23 Sep 2016 13:22:31 +0000 Original-Received: from localhost ([127.0.0.1]:33158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bnQQx-00077K-JG for submit@debbugs.gnu.org; Fri, 23 Sep 2016 09:22:31 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.24]:61183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bnQQv-000770-Cl for 24514@debbugs.gnu.org; Fri, 23 Sep 2016 09:22:29 -0400 Original-Received: from [18.189.53.55] ([18.189.53.55]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LZvrB-1b6LNz10Zx-00loZA; Fri, 23 Sep 2016 15:22:22 +0200 In-Reply-To: <20160923075116.GA612@odonien.localdomain> X-Provags-ID: V03:K0:G30V81IgcU3uMrXRWl58u0QwPKMW95EEeRs8XHr8nY0xw8z4d/j gvgimJq6+0uqxMKtCyhWV7qyeTPM+Ly8fKFWJKCAZsBBbRuL0IakAtFrIchoZqRE7g/K4aM nMHKZuQTyKrGvhBrvMMVU26JR9tQjjmzLi5IlsOuWFOjbgcS1I9sfcEAgb1B9sBjcuX8yYq LU5cnU8KisXapRauh9skQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:mamnLwDG3i0=:dtDsbFbz4X+Yk5p8iD31FQ LS4JpxkAl5bBMV0hlDiugGSt0M9oov0Mw8kK61/jzOA+kzd6s5DXKK8j72EvWn/KGwqUjUg3N n4/U5mOOOTJwU6+PPf/jafESLztJrRGT2e5Ire/bLLRLh7tT8EwIxyMAwCgHsK95F5pgWlc9U UXKDt2uJI/FiLVSBY9Ys7T24XvV/CdbZgN45LDc5x6SjiFCHUyTsLut8VBKlDPYmOX1zxIb8w PK6sHzL5LbrQZ1OOaGOH2gN9E0xuJ0jmBARzcWrFcUQ8qx1RtIHf1kM0ucsRxbnEsUwmsZOyV iswkg9Zc3BjRSXU0y4qd1TelCUlly9/cDGcW6fkEmH8ip4cxhb+5aB1wv1GH7MIKwKS6qD1DL LP2Hu5cUo70wbLQIMnTlr6iJ1PZjv+KX5b6wAkjPKA3Gwx3RnTz3K2YUHPBK2ur+f+lcl2Pkv l2bhfKaXPgnhPVwzTznnH2V/iEV5m3VDxjL8ceRY86jW1tOd70VJ1xJUTAc+5xmlQdIAtXJQs e5CSojK8PiYaYV2foKPms/dvOnNUXSyVgffqhs8LjAanVOytz//ximYE0zVr9N367rhTTnKVt n/0eu1plQcO6vgDSAiiRjgKMYt0hcyDX7Oog7jJVlhpFtoy23Zmk92hgWSQk1ubOk334Edg3t 9gjT3N/QreZy+EfUyy3lpBNQb 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:123596 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EGCJRPpQ8KfhVm2FbeEadNAujonfwCBAm Content-Type: multipart/mixed; boundary="8IaLama4qBwWv0NtwIRBqdgXDl7rEXT9c"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Vasilij Schneidermann , 24514@debbugs.gnu.org Message-ID: <9682182c-2575-4827-2a22-ead1071c26d7@gmail.com> Subject: Re: bug#24514: 24.5; [WIP][PATCH] Lispy backtraces References: <20160922231447.GA3833@odonien.localdomain> <98fbb582-3da4-bd83-a2e9-e341dd7f6140@gmail.com> <20160923075116.GA612@odonien.localdomain> In-Reply-To: <20160923075116.GA612@odonien.localdomain> --8IaLama4qBwWv0NtwIRBqdgXDl7rEXT9c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-09-23 03:51, Vasilij Schneidermann wrote: >> This looks great! I love it. And the patch looks very clean, too. >=20 > Thanks! I've updated the patch after a bit more testing. The extra=20 > debug line happened because the search in debug.el did actually > search for a `debug' call, so `(search-forward "\ (debug")` would > match a call to `debug-foo` as well. Assuming there will always be > extra args, this can be solved by appending a space to the search > string. Could it just search for the first occurence only? >> But it scares me a bit. Some tools do depend on e.g. trimming a=20 >> backtrace after printing it. Does edebug work with your patch, >> for example? >=20 > Yes, it does. =E2=80=A6 The only thing other than `debug.el`=20 > manipulating them is `edebug-backtrace' which I've never heard of=20 > before.=20 This is the one I was scared about. You can get a backtrace while edebugg= ing by pressing t IIRC. I have a faint memory of this code doing nasty t= hings to remove edebug instrumentation from the backtrace before displayi= ng it. >> I'm not sure what the right way to transition is. Maybe Emacs >> should let Lisp programs access the backtraces in a structured way, >> and then backtrace printing would only be a user-facing facility >> (programs wouldn't use the textual representation). >=20 > There is actually a way to do this, simply use `backtrace-frame' with > an increasing integer argument until it returns nil: >=20 > (let ((frame t) ; dummy value to kick-start the loop (i 0)) (while > frame (setq frame (backtrace-frame i)) (message "%S" frame) (setq i > (1+ i)))) Neat! Didn't know about this. I think it would be great to add a pointer= to this in the documentation of `backtrace'. Great work :) Cl=C3=A9ment. --8IaLama4qBwWv0NtwIRBqdgXDl7rEXT9c-- --EGCJRPpQ8KfhVm2FbeEadNAujonfwCBAm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX5SyIAAoJEPqg+cTm90wjPJcP/jRsYN69Liw0PmjYaOdPE1nM N6tt1Z2rdKe/k8cn3Krsr5UyqFJC9aVs9kFhFgGI12oxXlOq5nUSri8uz5EfFoHI CcaxrSE0Xc0J6xfxmBgld5kqe6wzAtOSWb1fvyjQvvFEbhRW50lgYJD9FefovE1n HnsoMlkje7d4MZmlapIE8Z20IZVItsNyEi+7FRhUI3wiboniSbxmndcfoScLZuIA Jsq2uHwN0c1W6rAEFcznVkeiD/lk6pRcBM9fgPE/fWQu6A8M/dmdMQLu4YnnRWSo Np/TPgBEpkMxin98XlLpUOscH27XlJKus9NgyENbApxqx6T09mrtQP2qqR2IBl5Q G+rdNsf7L4C5cUTNy61g8ByY8qxOTqoUjIJ3xvarPwrNIV/CZmNvpg0CKUaGQEYS PO3u4brH2dalW8s2pmz0nfZcy+iomgDpgeUWNl7sQWOQjxDf8RZ9teX/t5Dicp4N W3wHbySIiOV9xDWIaj8KXfY+02+hUFPjmwP53f/AT94suoaKPkm4K1yi0WVrrocI wCzsFj/YlxzPGJSFLn6hUrgQE4iEbTPsD+kmuE3SiU5hWBBh64S3+fRuCQ0as1i3 3pDpB5q4PthNF9eQZsgvd6PTV47DPUNP88jw6cJKCxQ8Ubtv2UEl6MSfjadHdMOJ l1orD06u1BTU3AePXtaO =Xzvf -----END PGP SIGNATURE----- --EGCJRPpQ8KfhVm2FbeEadNAujonfwCBAm--