From 110201c8f711c8452d50640afeccd6a33000d473 Mon Sep 17 00:00:00 2001 From: Simon Marshall Date: Wed, 6 Jan 1999 10:05:50 +0000 Subject: [PATCH] (with-temp-message): Don't display MESSAGE if nil. --- lisp/subr.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 1f042f24cd3..ac2d3117623 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -964,13 +964,18 @@ See also `with-temp-buffer'." The original message is restored to the echo area after BODY has finished. The value returned is the value of the last form in BODY. MESSAGE is written to the message log buffer if `message-log-max' is non-nil." - (let ((current-message (make-symbol "current-message"))) - `(let ((,current-message (current-message))) + (let ((current-message (make-symbol "current-message")) + (temp-message (make-symbol "with-temp-message"))) + `(let ((,temp-message ,message) + (,current-message)) (unwind-protect (progn - (message ,message) + (when ,temp-message + (setq ,current-message (current-message)) + (message ,temp-message)) ,@body) - (message ,current-message))))) + (when ,temp-message + (message ,current-message)))))) (defmacro with-temp-buffer (&rest body) "Create a temporary buffer, and evaluate BODY there like `progn'. -- 2.39.2