diff options
author | Jeff Spencer <jeffspencerd@gmail.com> | 2021-01-30 08:12:57 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-01-30 08:12:57 +0100 |
commit | cc2d3a62c2a1f5be7907eda55d3c678e1149eb7b (patch) | |
tree | 6c40a28e76dc6aeee02d76d3fac8f848b5ec10ed | |
parent | 0fa2a715d4c38cdea06737b5b9142db29dc3ebc9 (diff) | |
download | emacs-cc2d3a62c2a1f5be7907eda55d3c678e1149eb7b.tar.gz |
Fix interaction between two dired cleanup variables
* lisp/dired.el (dired-clean-up-after-deletion): Kill the buffers
if you have `dired-clean-up-buffers-too' set and
`dired-clean-confirm-killing-deleted-buffers' nil (bug#38037).
Copyright-paperwork-exempt: yes
-rw-r--r-- | etc/NEWS | 6 | ||||
-rw-r--r-- | lisp/dired.el | 21 |
2 files changed, 18 insertions, 9 deletions
@@ -504,6 +504,12 @@ time zones will use a form like "+0100" instead of "CET". ** Dired +--- +*** Behaviour change on 'dired-clean-confirm-killing-deleted-buffers'. +Previously, if 'dired-clean-up-buffers-too' was non-nil, and +'dired-clean-confirm-killing-deleted-buffers' was nil, the buffers +wouldn't be killed. This combination will now kill the buffers. + +++ *** New user option 'dired-switches-in-mode-line'. This user option controls how 'ls' switches are displayed in the mode diff --git a/lisp/dired.el b/lisp/dired.el index 3f119363314..fe6ac1e2591 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3532,18 +3532,21 @@ confirmation. To disable the confirmation, see (when (and (featurep 'dired-x) dired-clean-up-buffers-too) (let ((buf (get-file-buffer fn))) (and buf - (and dired-clean-confirm-killing-deleted-buffers - (funcall #'y-or-n-p - (format "Kill buffer of %s, too? " - (file-name-nondirectory fn)))) + (or (and dired-clean-confirm-killing-deleted-buffers + (funcall #'y-or-n-p + (format "Kill buffer of %s, too? " + (file-name-nondirectory fn)))) + (not dired-clean-confirm-killing-deleted-buffers)) (kill-buffer buf))) (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))) (and buf-list - (and dired-clean-confirm-killing-deleted-buffers - (y-or-n-p (format (ngettext "Kill Dired buffer of %s, too? " - "Kill Dired buffers of %s, too? " - (length buf-list)) - (file-name-nondirectory fn)))) + (or (and dired-clean-confirm-killing-deleted-buffers + (y-or-n-p (format + (ngettext "Kill Dired buffer of %s, too? " + "Kill Dired buffers of %s, too? " + (length buf-list)) + (file-name-nondirectory fn)))) + (not dired-clean-confirm-killing-deleted-buffers)) (dolist (buf buf-list) (kill-buffer buf)))))) |