diff options
| author | Glenn Morris <rgm@gnu.org> | 2013-09-14 17:35:54 -0700 |
|---|---|---|
| committer | Glenn Morris <rgm@gnu.org> | 2013-09-14 17:35:54 -0700 |
| commit | 307532421098fd42d632b169a0eed9e04a47e822 (patch) | |
| tree | 8c40ccf690787ebed425f2899bc7c44e53b30c3d /lisp/eshell/em-unix.el | |
| parent | 1e53bb4bf2754c724bcb894e730fd77e25dae80c (diff) | |
| download | emacs-307532421098fd42d632b169a0eed9e04a47e822.tar.gz | |
* eshell/em-unix.el (eshell/rm): Make -f ignore missing files.
Does not work until bug=15379 gets fixed.
Fixes: debbugs:15373
Diffstat (limited to 'lisp/eshell/em-unix.el')
| -rw-r--r-- | lisp/eshell/em-unix.el | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 52d2b4d2a2d..5792fe17506 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -284,18 +284,21 @@ Remove (unlink) the FILE(s).") entry))))) (eshell-funcalln 'unintern entry))) ((stringp entry) - (if (and (file-directory-p entry) - (not (file-symlink-p entry))) - (if (or em-recursive - eshell-rm-removes-directories) - (if (or em-preview - (not em-interactive) - (y-or-n-p - (format "rm: descend into directory `%s'? " - entry))) + ;; -f should silently ignore missing files (bug#15373). + (unless (and force-removal + (not (file-exists-p entry))) + (if (and (file-directory-p entry) + (not (file-symlink-p entry))) + (if (or em-recursive + eshell-rm-removes-directories) + (if (or em-preview + (not em-interactive) + (y-or-n-p + (format "rm: descend into directory `%s'? " + entry))) (eshell-remove-entries nil (list entry) t)) - (eshell-error (format "rm: %s: is a directory\n" entry))) - (eshell-remove-entries nil (list entry) t))))) + (eshell-error (format "rm: %s: is a directory\n" entry))) + (eshell-remove-entries nil (list entry) t)))))) (setq args (cdr args))) nil)) |
