Subject: Re: bug#78381: 30.1.50; Show a stack trace if an error occurs in safe hooks

From: Daniel Mendler <[email-masked]>
Date: Sun, 18 May 2025 17:08:28 +0200

Eli Zaretskii <[email-masked]> writes:

>> Date: Sun, 11 May 2025 21:30:38 +0200
>> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> Hello!
>> 
>> This is a feature request to improve the situation around debugging safe
>> hooks. Right now if an error occurs in a safe hook occurs, only a brief
>> message is shown (safe_run_hooks_error in keyboard.c, "Error in %s (%S):
>> %S"). Would it be possible to dump a stack trace to the *Messages*
>> buffer? The problem is likely to avoid flooding the *Messages* buffer.
>> On the other hand, hooks which throw errors are disabled anyway?
>
> We have backtrace-on-redisplay-error, does that help?  If not, perhaps
> a similar feature?

This does not help as far as I understand. But a similar variable
backtrace-on-safe-hook-error would help.

Daniel