# HG changeset patch # User Dan Nicolaescu # Date 1213368057 0 # Node ID 2ab93a71b21a73c62d52d78829e69fcef7dc5a19 # Parent 76261fd187086ce7af69057bdd9f20a8075fdbdb (vc-delete-file): Bound default-directory before calling the backend. diff -r 76261fd18708 -r 2ab93a71b21a lisp/ChangeLog --- 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 + + * vc.el (vc-delete-file): Bound default-directory before calling + the backend. + 2008-06-13 Jason Rumney * term/w32-win.el (mouse-set-font): Remove overridden function. diff -r 76261fd18708 -r 2ab93a71b21a lisp/vc.el --- 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.