[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redisplay hook error backtraces

From: Eli Zaretskii
Subject: Re: Redisplay hook error backtraces
Date: Sat, 16 Jul 2022 09:12:48 +0300

> Date: Thu, 14 Jul 2022 19:33:09 +0000
> Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> > > 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 don't understand.  If redisplay is called normally, it will go through
> redisplay_internal which sets redisplaying_p to true.  And it will stay
> true till the end of redisplay_internal, unless one of two special things
> happen: (i) We enter the debugger; (ii) there's a recursive edit.
> I don't see how the new backtrace facility can get any useful information
> out of redisplaying_p; if there were a nested internal_condition_case*,
> redisplaying_p would still be true, surely?
> What am I missing?

My point is that redisplaying_p tells you the code which runs was
invoked from redisplay, and that allows you to distinguish calls to
internal_condition_case* that are of interest (i.e. should produce a
backtrace in the *Backtrace* buffer) from those which aren't of
interest.  Which was the issue you raised against my suggestion to
rely on the fact that Lisp only ever uses a single form of
internal_condition_case* functions.

To recap: this sub-thread started when you said you don't want to
cause all calls to internal_condition_case* to generate backtrace in
this new way.  To which I suggested to bind a variable in
internal_condition_case that would prevent generation of backtrace,
relying on redisplaying_p to tell us when the other
internal_condition_case* functions are called outside of redisplay.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]