]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor change in 'dired--find-possibly-alternative-file'
authorFelix <felix.dick@web.de>
Sun, 26 Feb 2023 13:14:59 +0000 (14:14 +0100)
committerEli Zaretskii <eliz@gnu.org>
Tue, 28 Feb 2023 14:11:24 +0000 (16:11 +0200)
* lisp/dired.el (dired--find-possibly-alternative-file): Don't
kill the buffer if the directory is shown in other windows.

Copyright-paperwork-exempt: yes

lisp/dired.el

index 2bcb28a0e00d5dd514f97a91ac1aa69b68221f7d..4a4ecc901c48474c20b0a052dc8885ab8d8023e9 100644 (file)
@@ -2728,7 +2728,8 @@ directory in another window."
 (defun dired--find-possibly-alternative-file (file)
   "Find FILE, but respect `dired-kill-when-opening-new-dired-buffer'."
   (if (and dired-kill-when-opening-new-dired-buffer
-           (file-directory-p file))
+           (file-directory-p file)
+           (< (length (get-buffer-window-list)) 2))
       (progn
         (set-buffer-modified-p nil)
         (dired--find-file #'find-alternate-file file))