]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-make-version-backup): Ignore file-errors, e.g. directory not
authorAndré Spiegel <spiegel@gnu.org>
Mon, 7 Feb 2005 20:38:46 +0000 (20:38 +0000)
committerAndré Spiegel <spiegel@gnu.org>
Mon, 7 Feb 2005 20:38:46 +0000 (20:38 +0000)
writable.

lisp/vc-hooks.el

index 2dc8e1533f0d88045a605cab65d0b8d622df3b41..bdff9fbe12ca00d979a94aadb214e6bbb1db064a 100644 (file)
@@ -632,8 +632,15 @@ Before doing that, check if there are any old backups and get rid of them."
   (unless (and (fboundp 'msdos-long-file-names)
                (not (with-no-warnings (msdos-long-file-names))))
     (vc-delete-automatic-version-backups file)
-    (copy-file file (vc-version-backup-file-name file)
-               nil 'keep-date)))
+    (condition-case nil
+        (copy-file file (vc-version-backup-file-name file)
+                   nil 'keep-date)
+      ;; It's ok if it doesn't work (e.g. directory not writable),
+      ;; since this is just for efficiency.
+      (file-error 
+       (message
+        (concat "Warning: Cannot make version backup; "
+                "diff/revert therefore not local"))))))
 
 (defun vc-before-save ()
   "Function to be called by `basic-save-buffer' (in files.el)."