From: Dan Nicolaescu Date: Fri, 13 Jun 2008 14:40:57 +0000 (+0000) Subject: (vc-delete-file): Bound default-directory before calling X-Git-Tag: emacs-pretest-23.0.90~4815 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=05fae1be0c58e6c8b79de4ef82dae686c2f3d406;p=emacs.git (vc-delete-file): Bound default-directory before calling the backend. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3986f1763f1..d4faca6f665 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/vc.el b/lisp/vc.el index 1d53b277677..2c4a88124a9 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -2484,7 +2484,10 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. (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.