* vc/vc-hooks.el (vc-before-save): Clear cache if file has been
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 30 Jun 2012 13:14:00 +0000 (15:14 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 30 Jun 2012 13:14:00 +0000 (15:14 +0200)
removed (likely outside Emacs).

lisp/ChangeLog
lisp/vc/vc-hooks.el

index 15bc972..d92783e 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-30  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * vc/vc-hooks.el (vc-before-save): Clear cache if file has been
+       removed (likely outside Emacs).
+
 2012-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/cl-lib.el: Require macroexp for its macros.
index dff49c2..a753004 100644 (file)
@@ -704,6 +704,8 @@ Before doing that, check if there are any old backups and get rid of them."
   (let ((file buffer-file-name)
         backend)
     (ignore-errors               ;Be careful not to prevent saving the file.
+      (unless (file-exists-p file)
+        (vc-file-clearprops file))
       (and (setq backend (vc-backend file))
            (vc-up-to-date-p file)
            (eq (vc-checkout-model backend (list file)) 'implicit)