diff options
| author | Stefan Monnier | 2008-05-23 20:59:51 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-05-23 20:59:51 +0000 |
| commit | ee91bfdf8c94c6281cf29b54c517c6079db8bc89 (patch) | |
| tree | 85db6136c617c7fea3e978cbcd3b299cc5846589 | |
| parent | a3507bd3c2cd362c0ffd7de5462e4cacf0cf9dc7 (diff) | |
| download | emacs-ee91bfdf8c94c6281cf29b54c517c6079db8bc89.tar.gz emacs-ee91bfdf8c94c6281cf29b54c517c6079db8bc89.zip | |
(vc-delete-file): Don't try to resynch the buffer.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/vc.el | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9bf42b35f2a..14773bad083 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-05-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * vc.el (vc-delete-file): Don't try to resynch the buffer. | ||
| 4 | |||
| 1 | 2008-05-23 Paul R <paul.r.ml@gmail.com> | 5 | 2008-05-23 Paul R <paul.r.ml@gmail.com> |
| 2 | 6 | ||
| 3 | * textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var. | 7 | * textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var. |
diff --git a/lisp/vc.el b/lisp/vc.el index 7cf24bcd953..345a7bf53c4 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -547,6 +547,8 @@ | |||
| 547 | 547 | ||
| 548 | ;;; Todo: | 548 | ;;; Todo: |
| 549 | 549 | ||
| 550 | ;; - Add key-binding for vc-delete-file. | ||
| 551 | |||
| 550 | ;;;; New Primitives: | 552 | ;;;; New Primitives: |
| 551 | ;; | 553 | ;; |
| 552 | ;; - deal with push/pull operations. | 554 | ;; - deal with push/pull operations. |
| @@ -587,7 +589,7 @@ | |||
| 587 | ;;;; Internal cleanups: | 589 | ;;;; Internal cleanups: |
| 588 | ;; | 590 | ;; |
| 589 | ;; - backends that care about vc-stay-local should try to take it into | 591 | ;; - backends that care about vc-stay-local should try to take it into |
| 590 | ;; account for vc-dir. Is this likely to be useful??? | 592 | ;; account for vc-dir. Is this likely to be useful??? YES! |
| 591 | ;; | 593 | ;; |
| 592 | ;; - vc-expand-dirs should take a backend parameter and only look for | 594 | ;; - vc-expand-dirs should take a backend parameter and only look for |
| 593 | ;; files managed by that backend. | 595 | ;; files managed by that backend. |
| @@ -2437,17 +2439,16 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. | |||
| 2437 | (not (file-exists-p file))) | 2439 | (not (file-exists-p file))) |
| 2438 | (with-current-buffer (or buf (find-file-noselect file)) | 2440 | (with-current-buffer (or buf (find-file-noselect file)) |
| 2439 | (let ((backup-inhibited nil)) | 2441 | (let ((backup-inhibited nil)) |
| 2440 | (backup-buffer)) | 2442 | (backup-buffer)))) |
| 2441 | ;; If we didn't have a buffer visiting the file before this | ||
| 2442 | ;; command, kill the buffer created by the above | ||
| 2443 | ;; `find-file-noselect' call. | ||
| 2444 | (unless buf (kill-buffer (current-buffer))))) | ||
| 2445 | (vc-call-backend backend 'delete-file file) | 2443 | (vc-call-backend backend 'delete-file file) |
| 2446 | ;; If the backend hasn't deleted the file itself, let's do it for him. | 2444 | ;; If the backend hasn't deleted the file itself, let's do it for him. |
| 2447 | (when (file-exists-p file) (delete-file file)) | 2445 | (when (file-exists-p file) (delete-file file)) |
| 2448 | ;; Forget what VC knew about the file. | 2446 | ;; Forget what VC knew about the file. |
| 2449 | (vc-file-clearprops file) | 2447 | (vc-file-clearprops file) |
| 2450 | (vc-resynch-buffer file buf t))) | 2448 | ;; Since we've deleted the file and we've made sure the buffer had no |
| 2449 | ;; unsaved changes, we can kill the buffer. Much easier than trying to | ||
| 2450 | ;; properly refresh its VC state. | ||
| 2451 | (when buf (kill-buffer buf)))) | ||
| 2451 | 2452 | ||
| 2452 | ;;;###autoload | 2453 | ;;;###autoload |
| 2453 | (defun vc-rename-file (old new) | 2454 | (defun vc-rename-file (old new) |