]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid clearing echo-area message by auto-save-visited-file-name
authorEli Zaretskii <eliz@gnu.org>
Mon, 26 Nov 2018 17:27:45 +0000 (19:27 +0200)
committerEli Zaretskii <eliz@gnu.org>
Mon, 26 Nov 2018 17:27:45 +0000 (19:27 +0200)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Record the
previous echo-area message, if any, and restore it before
exiting.  (Bug#33490)

lisp/emacs-lisp/map-ynp.el

index 8260af5727839283a9afa181bfdf0329443b02b8..93235bd9ece35a08b678a6e217de58b648529303 100644 (file)
@@ -79,6 +79,7 @@ are meaningful here.
 
 Returns the number of actions taken."
   (let* ((actions 0)
+         (msg (current-message))
         user-keys mouse-event map prompt char elt def
         ;; Non-nil means we should use mouse menus to ask.
         use-menus
@@ -250,9 +251,10 @@ the current %s and exit."
       (if delayed-switch-frame
          (setq unread-command-events
                (cons delayed-switch-frame unread-command-events))))
-    ;; Clear the last prompt from the minibuffer.
+    ;; Clear the last prompt from the minibuffer, and restore the
+    ;; previous echo-area message, if any.
     (let ((message-log-max nil))
-      (message ""))
+      (message (or msg "")))
     ;; Return the number of actions that were taken.
     actions))