]> code.delx.au - gnu-emacs/commitdiff
Don't kill ~/ if it's the top level directory
authorTino Calancha <f92capac@gmail.com>
Sun, 24 Apr 2016 15:05:33 +0000 (17:05 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 24 Apr 2016 15:05:53 +0000 (17:05 +0200)
* lisp/dired-aux.el (dired-kill-subdir): Don't kill ~/ if it's
the top level directory (bug#23017).

lisp/dired-aux.el

index d29abf3cab8b4de7ae4a54295deef524631803ce..08db1877f1ac4645dab5b97214607a8b83459ea8 100644 (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)