Subject: Re: bug#13752: Suggestions regarding the minibuffer

From: Eli Zaretskii <[email-masked]>
Date: Wed, 02 Jun 2021 15:32:34 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Wed, 02 Jun 2021 07:46:04 +0200
> Cc: E Sabof <[email-masked]>, [email-masked]
> 
> Juri Linkov <[email-masked]> writes:
> 
> > But does `signal' use one of too low-level messaging functions?
> > I can't find what function displays the error message in the echo area.
> 
> I hoped that was only me.  :-)  I tried following the logic from Ferror
> to Fsignal to signal_or_quit, but it wasn't at all obvious to me where
> that's actually displaying the message.
> 
> I instrumented set_message, and that's called by Fsignal at some point,
> but even with Vset_message_function set properly, the error message
> still ends up in the echo area...

'set_message' isn't called to display errors signaled by 'signal',
because those messages don't go the 'message' route.  Those messages
go through cmd_error, which eventually calls command-error-function.
The latter is by default bound to command-error-default-function,
which displays the error message via print_error_message.

I think Lisp programs that want to control this should bind
command-error-function to the function of their liking.