diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3751ba80e0..40454eed23 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2319,6 +2333,10 @@ exit-minibuffer (error "%s" "Not in most nested command loop")) (when (not (innermost-minibuffer-p)) (error "%s" "Not in most nested minibuffer"))) + ;; When read_minibuf doesn't restore all previous windows, + ;; then at least pop down the completions window. + (unless read-minibuffer-restore-windows + (minibuffer-hide-completions)) ;; If the command that uses this has made modifications in the minibuffer, ;; we don't want them to cause deactivation of the mark in the original ;; buffer.