diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-10-02 01:49:29 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-10-02 01:49:29 +0000 |
| commit | e837a82fd73489c056182a07acf95e2399991fc0 (patch) | |
| tree | cbc09600f4537ca54ec36d88e26f43218d0ae8fc /lisp | |
| parent | bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e (diff) | |
| download | emacs-e837a82fd73489c056182a07acf95e2399991fc0.tar.gz | |
(vc-register): Verify an old master file really still exists
before giving error. If it has disappeared, ask for confirmation.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/vc.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index bebbf92c632..ec712eee925 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -500,8 +500,12 @@ lock steals will raise an error. (defun vc-register (&optional override comment) "Register the current file into your version-control system." (interactive "P") - (if (vc-name buffer-file-name) - (error "This file is already registered")) + (let ((master (vc-name buffer-file-name))) + (and master (file-exists-p master) + (error "This file is already registered")) + (and master + (not (y-or-n-p "Previous master file has vanished. Make a new one? ")) + (error "This file is already registered"))) ;; Watch out for new buffers of size 0: the corresponding file ;; does not exist yet, even though buffer-modified-p is nil. (if (and (not (buffer-modified-p)) |
