emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114287: * eshell/em-unix.el (eshell/rm): Make -f ig


From: Glenn Morris
Subject: [Emacs-diffs] trunk r114287: * eshell/em-unix.el (eshell/rm): Make -f ignore missing files.
Date: Sun, 15 Sep 2013 00:36:00 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114287
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15373
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2013-09-14 17:35:54 -0700
message:
  * eshell/em-unix.el (eshell/rm): Make -f ignore missing files. 
  Does not work until bug=15379 gets fixed.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/eshell/em-unix.el         emunix.el-20091113204419-o5vbwnq5f7feedwu-1865
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-15 00:10:45 +0000
+++ b/lisp/ChangeLog    2013-09-15 00:35:54 +0000
@@ -1,5 +1,8 @@
 2013-09-15  Glenn Morris  <address@hidden>
 
+       * eshell/em-unix.el (eshell/rm):
+       Make -f ignore missing files.  (Bug#15373)
+
        * eshell/esh-cmd.el (eshell--local-vars): New variable.  (Bug#15372)
        (eshell-rewrite-for-command): Add for loop vars to eshell--local-vars.
        * eshell/esh-var.el (eshell-get-variable): Respect eshell--local-vars.

=== modified file 'lisp/eshell/em-unix.el'
--- a/lisp/eshell/em-unix.el    2013-09-12 20:15:53 +0000
+++ b/lisp/eshell/em-unix.el    2013-09-15 00:35:54 +0000
@@ -284,18 +284,21 @@
                                             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))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]