Mercurial > emacs
diff lisp/files.el @ 105752:26d5ef08acf0
* files.el (delete-directory): Delete symlinks to directories with
delete-file (Bug#4739).
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 24 Oct 2009 20:30:44 +0000 |
parents | 136cf2d23c90 |
children | db5e4a5897ec |
line wrap: on
line diff
--- a/lisp/files.el Sat Oct 24 18:58:50 2009 +0000 +++ b/lisp/files.el Sat Oct 24 20:30:44 2009 +0000 @@ -4660,7 +4660,10 @@ (if (and recursive (not (file-symlink-p directory))) (mapc (lambda (file) - (if (file-directory-p file) + ;; This test is equivalent to + ;; (and (file-directory-p fn) (not (file-symlink-p fn))) + ;; but more efficient + (if (eq t (car (file-attributes file))) (delete-directory file recursive) (delete-file file))) ;; We do not want to delete "." and "..".