changeset 59978:c3afd6e6c992

(vc-make-version-backup): Ignore file-errors, e.g. directory not writable.
author André Spiegel <spiegel@gnu.org>
date Mon, 07 Feb 2005 20:38:46 +0000
parents a75c643392b8
children f721a44afa15
files lisp/vc-hooks.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-hooks.el	Mon Feb 07 20:00:31 2005 +0000
+++ b/lisp/vc-hooks.el	Mon Feb 07 20:38:46 2005 +0000
@@ -632,8 +632,15 @@
   (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)."