diff options
| author | Richard M. Stallman | 1994-10-02 01:49:29 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-02 01:49:29 +0000 |
| commit | e837a82fd73489c056182a07acf95e2399991fc0 (patch) | |
| tree | cbc09600f4537ca54ec36d88e26f43218d0ae8fc | |
| parent | bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e (diff) | |
| download | emacs-e837a82fd73489c056182a07acf95e2399991fc0.tar.gz emacs-e837a82fd73489c056182a07acf95e2399991fc0.zip | |
(vc-register): Verify an old master file really still exists
before giving error. If it has disappeared, ask for confirmation.
| -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. | |||
| 500 | (defun vc-register (&optional override comment) | 500 | (defun vc-register (&optional override comment) |
| 501 | "Register the current file into your version-control system." | 501 | "Register the current file into your version-control system." |
| 502 | (interactive "P") | 502 | (interactive "P") |
| 503 | (if (vc-name buffer-file-name) | 503 | (let ((master (vc-name buffer-file-name))) |
| 504 | (error "This file is already registered")) | 504 | (and master (file-exists-p master) |
| 505 | (error "This file is already registered")) | ||
| 506 | (and master | ||
| 507 | (not (y-or-n-p "Previous master file has vanished. Make a new one? ")) | ||
| 508 | (error "This file is already registered"))) | ||
| 505 | ;; Watch out for new buffers of size 0: the corresponding file | 509 | ;; Watch out for new buffers of size 0: the corresponding file |
| 506 | ;; does not exist yet, even though buffer-modified-p is nil. | 510 | ;; does not exist yet, even though buffer-modified-p is nil. |
| 507 | (if (and (not (buffer-modified-p)) | 511 | (if (and (not (buffer-modified-p)) |