changeset 54529:a7faa61c45b5

(vc-default-find-file-not-found-hook): New fun. (vc-file-not-found-hook): Use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 23 Mar 2004 20:59:19 +0000
parents 67419634950d
children b217df9a35e0
files lisp/vc-hooks.el
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-hooks.el	Tue Mar 23 20:50:36 2004 +0000
+++ b/lisp/vc-hooks.el	Tue Mar 23 20:59:19 2004 +0000
@@ -6,7 +6,7 @@
 ;; Author:     FSF (see vc.el for full credits)
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 
-;; $Id: vc-hooks.el,v 1.161 2004/03/15 03:53:05 monnier Exp $
+;; $Id: vc-hooks.el,v 1.162 2004/03/21 15:44:39 spiegel Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -765,14 +765,17 @@
   ;; When a file does not exist, ignore cached info about it
   ;; from a previous visit.
   (vc-file-clearprops buffer-file-name)
-  (if (and (vc-backend buffer-file-name)
-	   (yes-or-no-p
-	    (format "File %s was lost; check out from version control? "
-		    (file-name-nondirectory buffer-file-name))))
-    (save-excursion
-      (require 'vc)
-      (setq default-directory (file-name-directory buffer-file-name))
-      (not (vc-error-occurred (vc-checkout buffer-file-name))))))
+  (let ((backend (vc-backend buffer-file-name)))
+    (if backend (vc-call-backend backend find-file-not-found-hook))))
+
+(defun vc-default-find-file-not-found-hook (backend)
+  (if (yes-or-no-p
+       (format "File %s was lost; check out from version control? "
+	       (file-name-nondirectory buffer-file-name)))
+      (save-excursion
+	(require 'vc)
+	(setq default-directory (file-name-directory buffer-file-name))
+	(not (vc-error-occurred (vc-checkout buffer-file-name))))))
 
 (add-hook 'find-file-not-found-functions 'vc-file-not-found-hook)