* 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
(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))