From: Felix Date: Sun, 26 Feb 2023 13:14:59 +0000 (+0100) Subject: Minor change in 'dired--find-possibly-alternative-file' X-Git-Tag: emacs-29.0.90~290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b371697cdca6069378c713ac8e36ec98b06c5cc3;p=emacs.git Minor change in 'dired--find-possibly-alternative-file' * 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 --- diff --git a/lisp/dired.el b/lisp/dired.el index 2bcb28a0e00..4a4ecc901c4 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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))