]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-handle-dired-recursive-delete-directory):
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 14 Apr 2009 14:36:38 +0000 (14:36 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 14 Apr 2009 14:36:38 +0000 (14:36 +0000)
Fix an error in flushing cache data.
(tramp-handle-process-file): Flush all file cache values for the
connection, because the remote process could have changed them.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
Handle QUIT.

lisp/net/tramp.el

index 5339d14c344c2709906583d05e01715b78918cca..bb1d1416d1a46f120bfe0b56e10a10fd5508f8dc 100644 (file)
@@ -3468,9 +3468,9 @@ be a local filename.  The method used must be an out-of-band method."
   "Recursively delete the directory given.
 This is like `dired-recursive-delete-directory' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (tramp-flush-directory-property v filename)
+    (tramp-flush-directory-property v localname)
     ;; Run a shell command 'rm -r <localname>'
-    ;; Code shamelessly stolen for the dired implementation and, um, hacked :)
+    ;; Code shamelessly stolen from the dired implementation and, um, hacked :)
     (unless (file-exists-p filename)
       (tramp-error v 'file-error "No such directory: %s" filename))
     ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>)
@@ -3896,7 +3896,12 @@ beginning of local filename are not substituted."
                (with-current-buffer outbuf
                  (insert output-string)))
              (when display (display-buffer outbuf))))
-       ;; When the user did interrupt, we should do it also.
+       ;; When the user did interrupt, we should do it also.  We use
+       ;; return code -1 as marker.
+       (quit
+        (kill-buffer (tramp-get-connection-buffer v))
+        (setq ret -1))
+       ;; Handle errors.
        (error
         (kill-buffer (tramp-get-connection-buffer v))
         (setq ret 1)))
@@ -3905,10 +3910,14 @@ beginning of local filename are not substituted."
       (unless ret (setq ret (tramp-send-command-and-check v nil)))
       ;; Provide error file.
       (when tmpstderr (rename-file tmpstderr (cadr destination) t))
-      ;; Cleanup.
+      ;; Cleanup.  We remove all file cache values for the connection,
+      ;; because the remote process could have changed them.
       (when tmpinput (delete-file tmpinput))
+      (tramp-flush-directory-property v "")
       ;; Return exit status.
-      ret)))
+      (if (equal ret -1)
+         (keyboard-quit)
+       ret))))
 
 (defun tramp-local-call-process
   (program &optional infile destination display &rest args)