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 20:09:02 +0300 Message-ID: <831quntydt.fsf@gnu.org> References: <837d4hw5to.fsf@gnu.org> <83ilo0vnwh.fsf@gnu.org> <83fsj4uvjg.fsf@gnu.org> <83mtdct5ze.fsf@gnu.org> <83bktru74y.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9991"; 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 19:12:40 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 1oC2OG-0002Py-2g for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 19:12:40 +0200 Original-Received: from localhost ([::1]:56514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oC2OE-0007MV-UA for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 13:12:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC2Ks-0003u0-In for emacs-devel@gnu.org; Thu, 14 Jul 2022 13:09:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oC2Ks-0002T9-2Q; Thu, 14 Jul 2022 13:09:10 -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=E1VTSkG35mKPO5ZxTB9/9Piq0A664UKDOU67ELTsmTo=; b=kl0RlE9kGwX6 /oT6VRQ9kqXwSPxM1jgDr65giNiA2A4GL3kfNYGnasokTKIyZEWjM4h1VSdvTSHSxekl4SuaU3gZ1 aHjWC9j8Hhh7ohAClDgMG7ZbLBwBo2R0Ex51yeuI8hA14ku3tnH8mcMJKbRQH+aspzlVrkwYEI/fR MMsI59Bvfs4rsCr9hw+g+w1AIgexEPdR8pK4BNtNvSfO9twvlbVxBTgIucZM4zZEJMAVsIydxV+NA y1JnRJAtWNlrxfxFvmxNxi13E2LGvFoVC8U1qbFmhJIFRNSUgaqarlCC7iCo/wiZV9GRc7AiCiyOq E4KhXMv5pZ4ry0qCkGTrGw==; Original-Received: from [87.69.77.57] (port=3228 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 1oC2Kq-0007m7-Kd; Thu, 14 Jul 2022 13:09:09 -0400 In-Reply-To: (message from Alan Mackenzie on Thu, 14 Jul 2022 16:07:33 +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:292163 Archived-At: > Date: Thu, 14 Jul 2022 16:07:33 +0000 > Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: Alan Mackenzie > > > There's just one condition-case available to Lisp code, AFAICT, so why > > isn't it enough to distinguish condition-case from any other callers of > > internal_condition_case* ? > > I think I understand what you're saying, now. That a condition-case > called from Lisp will not use any of the internal_condition_case* > functions. So we could just assume that if i_c_case* triggers, it must be > one of the hooks we're interested in that called it. > > I don't think that's right. It might well be that Lisp code calls a C > primitive function that itself uses an internal_condition_case. In this > scenario, we would not want to generate a backtrace for that nested > internal_condition_case. And we won't, because redisplaying_p won't be set. > > > I disagree. There are seven places, for the seven different Lisp hooks > > > currently called from redisplay. > > > Aren't they all go through safe_call? > > They do, yes, but so do other things that we don't want to engage the > backtrace mechanism for. > > > Which seven places are you talking about? > > 1. handle_fontified_prop; > 2. set_message; > 3. clear_message; > 4. prepare_menu_bars (near the top); > 5. update_menu_bar (line ~54); > 6. run_window_scroll_functions; > 7. redisplay_window (line ~415). These either go through safe__call, or through run_hook_with_args. I think the latter group should be converted to call safe__call and its friends. And then you will have what I described: all those calls go through a single gate.