From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Redisplay hook error backtraces Date: Sat, 16 Jul 2022 09:03:13 +0300 Message-ID: <8335f1sify.fsf@gnu.org> References: <83fsj4uvjg.fsf@gnu.org> <83mtdct5ze.fsf@gnu.org> <83bktru74y.fsf@gnu.org> <83tu7isz4w.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31535"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 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 Sat Jul 16 08:04:26 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 1oCauf-000809-CN for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Jul 2022 08:04:25 +0200 Original-Received: from localhost ([::1]:55408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCaue-0002Lk-2G for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Jul 2022 02:04:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCatZ-0001fW-RE for emacs-devel@gnu.org; Sat, 16 Jul 2022 02:03:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCatY-0007Dh-W8; Sat, 16 Jul 2022 02:03:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=OlrdWbb25nK5clTUKOp4ZB6miwlWQN0XSv+hStksh24=; b=jEIXhzQH6jMk vFYVty/2NI72UDoBdQo1m4IrwohmfJ7v40tYWdz4DR9X6qeetDifOQDabqra/Ap3omg9g0LKaftnr 7Sn3AKKLrX5CuyFqlT7mCRtTuAo+fSxt2e+/t4Q+iWHPAu1OCFAr+aJKuEor0nMb7SmtlEkk9RyIN 6jGszoH2z8GeOVtplD7y+HB+/PWM8g3MZMJwD1XW9tyrOJ4nyxxmI2OWY8Riqqw3tliStHW5TJYtT vRo7UAIviK5fM4ATW1UlRBPH0goYKEbXuPLCrVhO9FdGOGmh1L3kRfoQo4aDhfJP2+X3Pmgz75bgG CsZ9hkTwRvnbr7knHywj5A==; Original-Received: from [87.69.77.57] (port=1163 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCatX-0002qD-1C; Sat, 16 Jul 2022 02:03:16 -0400 In-Reply-To: (message from Alan Mackenzie on Fri, 15 Jul 2022 18:18:14 +0000) 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:292198 Archived-At: > Date: Fri, 15 Jul 2022 18:18:14 +0000 > Cc: monnier@iro.umontreal.ca, larsi@gnus.org, emacs-devel@gnu.org > From: Alan Mackenzie > > I've come to see that `backtrace-on-redisplay-lisp-error', although > accurate, is too much of a mouthful, and I think it needs shortening. > Would anybody object to me just calling this variable `debug-redisplay'? Too general, IMO. How about backtrace-on-redisplay-errors? > Also, I think that writing the backtrace into *Backtrace* is a bad idea, > now. Users expect such a buffer to have active facilities, whereas the > new backtrace is just a dead dump. Is there any objection to me instead > calling the buffer something like "*Redisplay-trace*"? No objections, but I think you are again over-engineering things. > +Note that, for technical reasons, you cannot use the facilities > +defined in this subsection to debug errors in hooks the redisplay code > +has invoked. @xref{Debugging Redisplay} for help with these. ^ A comma missing there. > +@node Debugging Redisplay > +@subsection Debugging Redisplay Hooks > +@cindex redisplay hooks This @cindex should be "redisplay hooks, debugging", because it doesn't talk about the hooks in general. > +When a Lisp error occurs in a hook function which redisplay has > +invoked, you cannot use Emacs's usual debugging mechanisms, for > +technical reasons. This subsection describes how to get a backtrace > +from such an error, information which should be helpful in debugging > +it. This talks about hooks, which restricts the scope of the facility: we want to be able to collect backtraces from any Lisp called by the display code. For example, :eval forms in the mode line, Lisp code called by fontification-functions, etc. So the text ebove needs to be revised with this in mind. > +The hooks which these directions apply to are the following: I don't want us to have a list that looks like it's an exhaustive one. maintaining such a list is a maintenance burden we are better without. Please give a couple of examples and change the text to the effect that these are just examples. > +*** It is now possible to generate a backtrace from errors in redisplay > +hooks. To do this, set the new variable The heading line should be a full sentence. Thanks.