From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Redisplay hook error bactraces [Was: Fontification error backtrace] Date: Wed, 13 Jul 2022 16:45:12 -0400 Message-ID: References: <83o7yg9f0w.fsf@gnu.org> <83r1396lvr.fsf@gnu.org> <83edz87ivz.fsf@gnu.org> <83r1375m6x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14642"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , larsi@gnus.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 13 22:57:48 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBjQa-0003dU-E7 for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Jul 2022 22:57:48 +0200 Original-Received: from localhost ([::1]:55498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBjQZ-0005E3-91 for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Jul 2022 16:57:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBjEX-0004zO-TB for emacs-devel@gnu.org; Wed, 13 Jul 2022 16:45:25 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25359) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBjET-0006M7-Sr; Wed, 13 Jul 2022 16:45:19 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 045D1442515; Wed, 13 Jul 2022 16:45:16 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8EF2B44047B; Wed, 13 Jul 2022 16:45:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1657745114; bh=6BQdRZ/blUAg0iEmK5dXx0KvCPlEaVRTCneRIfzv4C4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=gWrgmquqMBkh+r3U5OW4YRe0OuFpe6o/hwP0+qXJpd9kirajKfs0+WmOMEvw/Zu5s AI1cEokupz7vuV4QPk3xDGaEJ/LHPJBl5dQrX621WwfYTKhX1RALQ8rr1cwXO3JzBz zTNZD+6L8uT8KSvSgah9wP4pPtxLd1yi4zh6BdG1XWQ+Np2zT7gdnYEqhJco3ZSaGh GJrZYsSdyAFicQjP/LobOBcKaQdUQJyNtX9B22eKf/T97FORRTBd9COZwNWg8mlBUA KAkp+PGHhsMFojrJPEXatDc/7F7I1oPDl/4ljbd5hYhp7j1x7fjvPcAOZLS/Rll2P4 3EmXf6/DiknVA== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 77C01120516; Wed, 13 Jul 2022 16:45:14 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Wed, 13 Jul 2022 19:58:13 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:292115 Archived-At: > What you suggest would imply a _lot_ of coding to make it happen. Does > there exist anywhere any support for copyging a specpdl, and somehow > making a lisp object out of it? Why do you think that copying the > specpdl would be less work or less risky than directly generating a > backtrace, as the current code does? I don't think it needs to be much coding. Stashing the full specpdl would be more work, admittedly, but turning the specpdl into a list via something like `backtrace-frames` is trivial (we could even easily move `backtrace-frames` to C if we wanted to be paranoid about running ELisp at that point). > The advantage of directly generating the backtrace is that all the > infrastructure is already there. We've got mapbacktrace which > encapsulates the formats of the specpdl. And debug-early.el, whose two > functions total 60 lines (including doc strings and comments) and don't > use any other Lisp whatsoever. That potentially runs a crapload of code via various hooks, many of which can be influenced by variables dynamically bound in the context of the error. Moving the bulk of the work to a normal context means we can be much more relaxed about using "fully featured" code, so there'll be much less resistance to over-engineering :-) Stefan