GNU bug report logs - #40774
Error messages shouldn't be hidden when the user is idle

Previous Next

Package: emacs;

Reported by: ndame <ndame <at> protonmail.com>

Date: Wed, 22 Apr 2020 16:23:01 UTC

Severity: wishlist

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: 40774 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org, ndame <at> protonmail.com
Subject: bug#40774: Error messages shouldn't be hidden when the user is idle
Date: Fri, 24 Apr 2020 01:16:36 +0300
[Message part 1 (text/plain, inline)]
> So the only change needed is that error messages can only be cleared
> from the echo area by the user doing some command. Otherwise they
> are collected and shown.

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))

[clear_message.patch (text/x-diff, inline)]
diff --git a/src/xdisp.c b/src/xdisp.c
index 01f272033e..fb9def57ef 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11825,18 +11825,23 @@ set_message_1 (ptrdiff_t a1, Lisp_Object string)
 void
 clear_message (bool current_p, bool last_displayed_p)
 {
+  Lisp_Object preserve = Qnil;
+
   if (current_p)
     {
-      echo_area_buffer[0] = Qnil;
-      message_cleared_p = true;
-
       if (FUNCTIONP (Vclear_message_function))
         {
           ptrdiff_t count = SPECPDL_INDEX ();
           specbind (Qinhibit_quit, Qt);
-          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;
+        }
     }
 
   if (last_displayed_p)

This bug report was last modified 3 years and 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.