From 4f4847bd29560af115dbb3bb126658f5d7ace782 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 13 Apr 2025 10:44:55 +0300 Subject: [PATCH] Disable clearing echo-area when 'inhibit-message' is non-nil * src/xdisp.c (clear_message): Don't clear echo-area if 'inhibit-message' is non-nil. * etc/NEWS: * doc/lispref/display.texi (Displaying Messages): Document the above change. (Bug#77257) (cherry picked from commit b0d6fe1449fbd32c01d69174f552d6884337a809) --- doc/lispref/display.texi | 6 ++++-- src/xdisp.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 446169ec711..778716c0dc2 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -404,8 +404,10 @@ elapsed since the time the first message was emitted. @defvar inhibit-message When this variable is non-@code{nil}, @code{message} and related functions -will not display any messages in the Echo Area. Echo-area messages -are still logged in the @file{*Messages*} buffer, though. +will not display any messages in the Echo Area, and will also not clear +previous echo-area messages when @code{message} is called with a +@code{nil} or an empty argument. Echo-area messages are still logged in +the @file{*Messages*} buffer, though. @end defvar @defmac with-temp-message message &rest body diff --git a/src/xdisp.c b/src/xdisp.c index cf395a121de..e1c09f2c165 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13405,7 +13405,7 @@ clear_message (bool current_p, bool last_displayed_p) { Lisp_Object preserve = Qnil; - if (current_p) + if (current_p && !inhibit_message) { if (FUNCTIONP (Vclear_message_function) /* FIXME: (bug#63253) Same as for `set-message-function` above. */ -- 2.39.5