changeset 95895:2ab93a71b21a

(vc-delete-file): Bound default-directory before calling the backend.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 13 Jun 2008 14:40:57 +0000
parents 76261fd18708
children 7561b5637b81
files lisp/ChangeLog lisp/vc.el
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jun 13 14:29:47 2008 +0000
+++ b/lisp/ChangeLog	Fri Jun 13 14:40:57 2008 +0000
@@ -1,3 +1,8 @@
+2008-06-13  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc.el (vc-delete-file): Bound default-directory before calling
+	the backend.
+
 2008-06-13  Jason Rumney  <jasonr@gnu.org>
 
         * term/w32-win.el (mouse-set-font): Remove overridden function.
--- a/lisp/vc.el	Fri Jun 13 14:29:47 2008 +0000
+++ b/lisp/vc.el	Fri Jun 13 14:40:57 2008 +0000
@@ -2484,7 +2484,10 @@
       (with-current-buffer (or buf (find-file-noselect file))
 	(let ((backup-inhibited nil))
 	  (backup-buffer))))
-    (vc-call-backend backend 'delete-file file)
+    ;; Bind `default-directory' so that the command that the backend
+    ;; runs to remove the file is invoked in the correct context.
+    (let ((default-directory (file-name-directory file)))
+      (vc-call-backend backend 'delete-file file))
     ;; If the backend hasn't deleted the file itself, let's do it for him.
     (when (file-exists-p file) (delete-file file))
     ;; Forget what VC knew about the file.