From d455f4f7a97251609c503d8f3250fe883d689069 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 22 Sep 2001 20:09:56 +0000 Subject: [PATCH] (vc-delete-automatic-version-backups): Don't fail if the directory doesn't exist. --- lisp/ChangeLog | 3 +++ lisp/vc-hooks.el | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c066f7e4c1..2be0cdde46f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-09-22 Stefan Monnier + * vc-hooks.el (vc-delete-automatic-version-backups): + Don't fail if the directory doesn't exist. + * diff-mode.el (diff-default-read-only): New var. (diff-mode): Use it. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index f4d843397e3..5e6eba772cd 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -5,7 +5,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel -;; $Id: vc-hooks.el,v 1.131 2000/11/24 16:25:59 spiegel Exp $ +;; $Id: vc-hooks.el,v 1.132 2001/07/11 22:05:01 monnier Exp $ ;; This file is part of GNU Emacs. @@ -482,11 +482,13 @@ a regexp for matching all such backup files, regardless of the version." (defun vc-delete-automatic-version-backups (file) "Delete all existing automatic version backups for FILE." - (mapcar - (lambda (f) - (delete-file f)) - (directory-files (file-name-directory file) t - (vc-version-backup-file-name file nil nil t)))) + (condition-case nil + (mapcar + 'delete-file + (directory-files (file-name-directory file) t + (vc-version-backup-file-name file nil nil t))) + ;; Don't fail when the directory doesn't exist. + (file-error nil))) (defun vc-make-version-backup (file) "Make a backup copy of FILE, which is assumed in sync with the repository. -- 2.39.2