From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#40774: Error messages shouldn't be hidden when the user is idle Date: Fri, 24 Apr 2020 01:16:36 +0300 Organization: LINKOV.NET Message-ID: <87v9lpluez.fsf@mail.linkov.net> References: <83blnje5ro.fsf@gnu.org> <838sine4si.fsf@gnu.org> <837dy7e3wr.fsf@gnu.org> <-ZmNQQ07JD7L0I5EpXolv4t1UhWBGc4SN0dkJml3cLbBjO6ucAMUzAqsI9Ca69xO_hzlMLfaLs6bY9vq8GAR24RUGu1LZqVoVkXhiJcFgtg=@protonmail.com> <835zdre31u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="5651"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: ndame@protonmail.com To: 40774@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 24 00:22:21 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRkEe-0001KP-VU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Apr 2020 00:22:20 +0200 Original-Received: from localhost ([::1]:43244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRkEc-0004pV-Nu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Apr 2020 18:22:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33462) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRkEO-0004mU-Ey for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 18:22:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRkEN-0002fN-R9 for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 18:22:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRkEN-0002dy-4g for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 18:22:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRkEN-0002PR-0M for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2020 18:22:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Apr 2020 22:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40774 X-GNU-PR-Package: emacs X-Debbugs-Original-To: ndame via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: "40774@debbugs.gnu.org" <40774@debbugs.gnu.org>, Eli Zaretskii , ndame Original-Received: via spool by 40774-submit@debbugs.gnu.org id=B40774.15876804959196 (code B ref 40774); Thu, 23 Apr 2020 22:22:02 +0000 Original-Received: (at 40774) by debbugs.gnu.org; 23 Apr 2020 22:21:35 +0000 Original-Received: from localhost ([127.0.0.1]:55963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRkDu-0002OF-RD for submit@debbugs.gnu.org; Thu, 23 Apr 2020 18:21:35 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:39201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRkDt-0002Nr-9z for 40774@debbugs.gnu.org; Thu, 23 Apr 2020 18:21:33 -0400 Original-Received: from mail.gandi.net (m91-129-106-11.cust.tele2.ee [91.129.106.11]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 13923200006; Thu, 23 Apr 2020 22:21:25 +0000 (UTC) In-Reply-To: (ndame via's message of "Thu, 23 Apr 2020 05:58:01 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178876 Archived-At: --=-=-= Content-Type: text/plain > 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)) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=clear_message.patch 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) --=-=-=--