Subject: bug#40774: Error messages shouldn't be hidden when the user is idle

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 20 Aug 2020 15:41:50 +0200

Juri Linkov <[email-masked]> writes:

> I see now what you mean.  This can be easily implemented with the
> following patch.  So you can set `clear-message-function' to a function
> that returns a non-nil, and the echo area won't be cleared.
>
> Such predicate function could contain a complex logic, but for testing
> you could use just:
>
>   (setq clear-message-function (lambda () t))

[...]

> -          safe_call (1, Vclear_message_function);
> +          preserve = safe_call (1, Vclear_message_function);
>            unbind_to (count, Qnil);
>          }
> +
> +      if (NILP (preserve))
> +        {
> +          echo_area_buffer[0] = Qnil;
> +          message_cleared_p = true;
> +        }

It an interesting idea, but I don't think this would be a
backwards-compatible implementation.  Today, the return value of
clear-message-function isn't used, so we have to assume that users of
that variable returns...  whatever.  Giving it semantics now would lead
to the message area being preserved unexpectedly.

Or not, if somebody has used that function to semi-clear the echo area,
and then return nil?

So this would have to be implemented in a different way, unfortunately,
I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no