aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2004-03-23 20:59:19 +0000
committerStefan Monnier <[email protected]>2004-03-23 20:59:19 +0000
commit4a330ab7afc2731efaf7ea73388dad0670be66e2 (patch)
tree3a2844496bb59502b1c01dc849965381e74da6fc
parent22cd1973d54a817eb0b0a8e9a9bf6e07323817fa (diff)
(vc-default-find-file-not-found-hook): New fun.
(vc-file-not-found-hook): Use it.
-rw-r--r--lisp/vc-hooks.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index d0c444d2d9..be39f7d9d5 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -6,7 +6,7 @@
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <[email protected]>
-;; $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 @@ Used in `find-file-not-found-functions'."
;; 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)