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: Thu, 14 Jul 2022 12:10:13 +0300 Message-ID: <83mtdct5ze.fsf@gnu.org> References: <83edz87ivz.fsf@gnu.org> <83r1375m6x.fsf@gnu.org> <837d4hw5to.fsf@gnu.org> <83ilo0vnwh.fsf@gnu.org> <83fsj4uvjg.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6998"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 14 11:38:06 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 1oBvIL-0001ga-BD for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 11:38:05 +0200 Original-Received: from localhost ([::1]:45802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBvII-0001oC-Ic for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 05:38:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBurc-0003rk-1K for emacs-devel@gnu.org; Thu, 14 Jul 2022 05:10:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBura-0007Dm-NK; Thu, 14 Jul 2022 05:10:26 -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=qjoy7r2ZFk49g5yhI5Kl9HQl5kwpcGJ0LDWR7RekGsc=; b=bBdzvObVw7ei 7dNAr1HrPtzDVYhcS1SOo9RtNK3W4INwutoXIRNn76uorM3CUZGZROuG8cxZbXE6BMUCCMtPdApii 1vJiRyEr1QkfZAi/MlOqPjR9OGOOskQzxm1SomLNTUCZwsJxYh3pU4dUKbnH70h2SvA8n2Nrih6fs sWQA9CABGK/QtfuP3AmfijTeMVJwIW5wQkoz/ZySSZY05suAi3cbdwoj77gj7xZPe9YfLXjrbxBva bvXapICSe7qpmjiann5cLB5EgYX3BvgzOMwkU/LGhrLoawmJPj+e5hl2KKcWm66tVUs2HEhjaS6g7 TJHoU7/xjnvHusxZbNupzQ==; Original-Received: from [87.69.77.57] (port=1712 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 1oBurV-0004p4-EL; Thu, 14 Jul 2022 05:10:26 -0400 In-Reply-To: (message from Alan Mackenzie on Thu, 14 Jul 2022 09:01:16 +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:292137 Archived-At: > Date: Thu, 14 Jul 2022 09:01:16 +0000 > Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: Alan Mackenzie > > > You want to distinguish errors inside condition-case? > > More, distinguish the different condition-cases in which errors might > occur. What else is exposed to Lisp? We are talking about catching Lisp errors only, right? > > > > Can we discuss how to implement it without introducing a special > > > > handler and without adding new safe_run_hooks_* functions? > > I think we need the new function safe_run_hooks_2_with_backtrace (see > below), since there is currently no "safe" function for hooks with two > arguments. But some of the other ones could disappear (see below). What is the second argument, and why do we need it? > OK, I have an idea. I restore the variable redisplay_lisping back into > the code (I took it out last night), binding it to true (or Qt?) at every > place in xdisp.c where redisplay calls a Lisp hook. These all go through a single function, so there's just one place to do that. > I then test that variable in internal_condition_case_n in place of > having the extra bool argument to that function. > > That would then get rid of the new functions > safe_run_hooks_with_backtrace_funcall and safe_run_hooks_with_backtrace. > We could also rename safe_run_hooks_2_with_backtrace by removing > "_with_backtrace" from the name. > > What do you think? Sounds good, but let's see the code. And I still would like you to explore Stefan's suggestion, since doing too much non-trivial Lisp stuff in signal_or_quit is better avoided. Thanks.