From: Stefan Kangas Date: Thu, 11 Jul 2019 22:43:12 +0000 (+0200) Subject: Make finder-exit use quit-window (Bug#33610) X-Git-Tag: emacs-27.0.90~1852 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=070dd439096c0f72d8f73823649e3c650f31c890;p=emacs.git Make finder-exit use quit-window (Bug#33610) * lisp/finder.el (finder-exit): Quit window instead of deleting. This restores previous contents of the window, if any, that was usurped by "C-h p" to show the list of packages. --- diff --git a/lisp/finder.el b/lisp/finder.el index ad9441210c5..89706cf7dbd 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -465,11 +465,12 @@ finder directory, \\[finder-exit] = quit, \\[finder-summary] = help"))) (defun finder-exit () "Exit Finder mode. -Delete the window and kill all Finder-related buffers." +Quit the window and kill all Finder-related buffers." (interactive) - (ignore-errors (delete-window)) (let ((buf "*Finder*")) - (and (get-buffer buf) (kill-buffer buf)))) + (if (equal (current-buffer) buf) + (quit-window t) + (and (get-buffer buf) (kill-buffer buf))))) (defun finder-unload-function () "Unload the Finder library."