]> git.eshelyaron.com Git - emacs.git/commitdiff
In 'bury-buffer' don't try to remove current buffer from minibuffer window
authorMartin Rudalics <rudalics@gmx.at>
Thu, 17 Oct 2019 17:35:29 +0000 (19:35 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Thu, 17 Oct 2019 17:35:29 +0000 (19:35 +0200)
* lisp/window.el (bury-buffer): Don't try to remove current buffer
from minibuffer window.

lisp/window.el

index 058e89df7c70bc1ddea4c5a2278a79f811432fb2..bf213547039f2009e3469efc286e6ab195bb84ac 100644 (file)
@@ -4732,13 +4732,16 @@ displayed there."
     ;; Handle case where `buffer-or-name' is nil and the current buffer
     ;; is shown in the selected window.
     (cond
-     ((or buffer-or-name (not (eq buffer (window-buffer)))))
+     ((or buffer-or-name
+          (not (eq buffer (window-buffer)))
+          ;; Don't try to delete the minibuffer window, undedicate it
+          ;; or switch to a previous buffer in it.
+          (window-minibuffer-p)))
      ((window--delete nil t))
      (t
       ;; Switch to another buffer in window.
       (set-window-dedicated-p nil nil)
       (switch-to-prev-buffer nil 'bury)))
-
     ;; Always return nil.
     nil))