Don't kill ~/ if it's the top level directory

* lisp/dired-aux.el (dired-kill-subdir): Don't kill ~/ if it's
the top level directory (bug#23017).
This commit is contained in:
Tino Calancha 2016-04-24 17:05:33 +02:00 committed by Lars Magne Ingebrigtsen
parent 4f40f5f63a
commit 0cd2e923db

View file

@ -2486,8 +2486,8 @@ Lower levels are unaffected."
(cur-dir (dired-current-directory))
(cons (assoc-string cur-dir dired-switches-alist))
buffer-read-only)
(if (equal cur-dir default-directory)
(error "Attempt to kill top level directory"))
(when (equal cur-dir (expand-file-name default-directory))
(error "Attempt to kill top level directory"))
(prog1
(if remember-marks (dired-remember-marks beg end))
(delete-region beg end)