Subject: Re: bug#63253: 29.0.90; with-delayed-message fails in combination with inhibit-message

From: Eli Zaretskii <[email-masked]>
Date: Mon, 08 May 2023 19:06:34 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Mon, 08 May 2023 11:13:37 -0400
> 
> >> So `set-message-function` is "dangerous" because it runs ELisp code from
> >> `message3` => `message3_nolog` => `set_message`.
> >
> > So I guess we need to have run_timers bind some variable, and then in
> > set_message, if that variable is non-nil, we should avoid calling
> > functions from set-message-function?
> 
> That's probably the best short-term workaround, yes.
> 
> The quick hack below seems to avoid the problem for me (at the cost of
> ignoring `inhibit-message` for the `with-delayed-message`s).

Thanks, I think you should install this on the emacs-29 branch.  And I
think a similar change is needed in clear_message, so it doesn't call
clear-message-function.

But what does this mean for with-delayed-message and
funcall-with-delayed-message?  These were introduced in Emacs 29, but
if we say that atimers cannot be used to safely run arbitrary Lisp,
then we should somehow make them safer, perhaps by having in
with_delayed_message_display a subset of code message3, without the
calls to Lisp.  WDYT?