*** 'W' is now bound to 'browse-url-of-dired-file', and is useful for
viewing HTML files and the like.
+---
+*** New variable 'dired-clean-confirm-killing-deleted-buffers'
+controls whether Dired asks to kill buffers visiting deleted files and
+directories. The default is t, so Dired asks for confirmation, to
+keep previous behavior.
+
---
** html2text is now marked obsolete.
(dired-clean-up-after-deletion file))
(defvar dired-clean-up-buffers-too)
+(defvar dired-clean-confirm-killing-deleted-buffers)
(defun dired-clean-up-after-deletion (fn)
"Clean up after a deleted file or directory FN.
-Removes any expanded subdirectory of deleted directory.
-If `dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil,
-also offers to kill buffers visiting deleted files and directories."
+Removes any expanded subdirectory of deleted directory. If
+`dired-x' is loaded and `dired-clean-up-buffers-too' is non-nil,
+kill any buffers visiting those files, prompting for
+confirmation. To disable the confirmation, see
+`dired-clean-confirm-killing-deleted-buffers'."
(save-excursion (and (cdr dired-subdir-alist)
(dired-goto-subdir fn)
(dired-kill-subdir)))
(when (and (featurep 'dired-x) dired-clean-up-buffers-too)
(let ((buf (get-file-buffer fn)))
(and buf
- (funcall #'y-or-n-p
- (format "Kill buffer of %s, too? "
- (file-name-nondirectory fn)))
+ (and dired-clean-confirm-killing-deleted-buffers
+ (funcall #'y-or-n-p
+ (format "Kill buffer of %s, too? "
+ (file-name-nondirectory fn))))
(kill-buffer buf)))
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
(and buf-list
- (y-or-n-p (format "Kill Dired buffer%s of %s, too? "
- (dired-plural-s (length buf-list))
- (file-name-nondirectory fn)))
+ (and dired-clean-confirm-killing-deleted-buffers
+ (y-or-n-p (format "Kill Dired buffer%s of %s, too? "
+ (dired-plural-s (length buf-list))
+ (file-name-nondirectory fn))))
(dolist (buf buf-list)
(kill-buffer buf))))))