From: Simon Marshall Date: Wed, 6 Jan 1999 10:05:50 +0000 (+0000) Subject: (with-temp-message): Don't display MESSAGE if nil. X-Git-Tag: emacs-20.4~949 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=110201c8f711c8452d50640afeccd6a33000d473;p=emacs.git (with-temp-message): Don't display MESSAGE if nil. --- 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'.