summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTassilo Horn <tsdh@gnu.org>2021-05-11 21:07:49 +0200
committerTassilo Horn <tsdh@gnu.org>2021-05-11 21:10:28 +0200
commit4e175604b5b53f6892782e2bbf5bf60cb1b635f3 (patch)
treebeaa3429a998639a432b24d920ed7aadfbf1d2fb
parentfa9f61e0f60c3f8fcc74e1b318e4113a1248b918 (diff)
downloademacs-4e175604b5b53f6892782e2bbf5bf60cb1b635f3.tar.gz
Fix dired confirm message asking to kill buffers of deleted dir (bug#48301)
* lisp/dired.el (dired-clean-up-after-deletion): Fix dired confirmation message asking to kill buffers of deleted dir in the case where `dired-listing-switches' contain -p (bug#48301).
-rw-r--r--lisp/dired.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 11df93ec3bb..8527634760a 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3425,11 +3425,16 @@ confirmation. To disable the confirmation, see
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
(and buf-list
(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))))
+ (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 may end in a / if `dired-listing-switches'
+ ;; contains -p, so we need to strip that
+ ;; (bug#48301).
+ (directory-file-name fn)))))
(not dired-clean-confirm-killing-deleted-buffers))
(dolist (buf buf-list)
(kill-buffer buf))))))