From 3c3bf6ce8fb1f31177db297dc70bfae25cca552a Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 26 Jun 2009 23:53:55 +0000 Subject: [PATCH] Remove find-file-not-found-hook VC method. (Bug#2757) * vc-hooks.el (vc-file-not-found-hook) (vc-default-find-file-not-found-hook): Remove functions. (find-file-not-found-functions): Do not add vc-file-not-found-hook. * vc-rcs.el (vc-rcs-find-file-not-found-hook): Remove function. * vc.el: * vc-hg.el: * vc-git.el: Do not mention find-file-not-found-hook VC method. --- etc/NEWS | 4 ++++ lisp/ChangeLog | 11 +++++++++++ lisp/vc-git.el | 1 - lisp/vc-hg.el | 1 - lisp/vc-hooks.el | 21 --------------------- lisp/vc-rcs.el | 8 -------- lisp/vc.el | 5 ----- 7 files changed, 15 insertions(+), 36 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 23a73b81669..d4819fc040e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -32,6 +32,10 @@ so we will look at it and add it to the manual. On systems which support GVFS-Fuse, Tramp offers the new connection methods "dav", "davs" and "obex". +** VC and related modes + +*** When a file is not found, VC will not try to check it out of RCS anymore. + * Installation Changes in Emacs 23.1 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a5650015086..5b9871323aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2009-06-26 Dan Nicolaescu + + Remove find-file-not-found-hook VC method. (Bug#2757) + * vc-hooks.el (vc-file-not-found-hook) + (vc-default-find-file-not-found-hook): Remove functions. + (find-file-not-found-functions): Do not add vc-file-not-found-hook. + * vc-rcs.el (vc-rcs-find-file-not-found-hook): Remove function. + * vc.el: + * vc-hg.el: + * vc-git.el: Do not mention find-file-not-found-hook VC method. + 2009-06-25 Agustín Martín * textmodes/ispell.el: Add `ispell-looking-back' XEmacs diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 9155fba053f..12441c8dc86 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el @@ -101,7 +101,6 @@ ;; - delete-file (file) OK ;; - rename-file (old new) OK ;; - find-file-hook () NOT NEEDED -;; - find-file-not-found-hook () NOT NEEDED (eval-when-compile (require 'cl) diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el index 26bf25cfc61..a8a8895de01 100644 --- a/lisp/vc-hg.el +++ b/lisp/vc-hg.el @@ -92,7 +92,6 @@ ;; - delete-file (file) TEST IT ;; - rename-file (old new) OK ;; - find-file-hook () PROBABLY NOT NEEDED -;; - find-file-not-found-hook () PROBABLY NOT NEEDED ;; 2) Implement Stefan Monnier's advice: ;; vc-hg-registered and vc-hg-state diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 83d89027f8f..d35471a4738 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -911,27 +911,6 @@ current, and kill the buffer that visits the link." (add-hook 'find-file-hook 'vc-find-file-hook) -;; more hooks, this time for file-not-found -(defun vc-file-not-found-hook () - "When file is not found, try to check it out from version control. -Returns t if checkout was successful, nil otherwise. -Used in `find-file-not-found-functions'." - ;; When a file does not exist, ignore cached info about it - ;; from a previous visit. - ;; We check that `buffer-file-name' is non-nil. It should be always - ;; the case, but in conjunction with Tramp, it might be nil. M. Albinus. - (when buffer-file-name - (vc-file-clearprops buffer-file-name) - (let ((backend (vc-backend buffer-file-name))) - (when backend (vc-call-backend backend 'find-file-not-found-hook))))) - -(defun vc-default-find-file-not-found-hook (backend) - ;; This used to do what vc-rcs-find-file-not-found-hook does, but it only - ;; really makes sense for RCS. For other backends, better not do anything. - nil) - -(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook) - (defun vc-kill-buffer-hook () "Discard VC info about a file when we kill its buffer." (when buffer-file-name (vc-file-clearprops buffer-file-name))) diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el index 0a5ebe42eec..ec30ca4576c 100644 --- a/lisp/vc-rcs.el +++ b/lisp/vc-rcs.el @@ -247,14 +247,6 @@ When VERSION is given, perform check for that version." ;; The workfile is unchanged if rcsdiff found no differences. (zerop status))) -(defun vc-rcs-find-file-not-found-hook () - (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) - (let ((default-directory (file-name-directory buffer-file-name))) - (not (vc-error-occurred (vc-checkout buffer-file-name))))))) ;;; ;;; State-changing functions diff --git a/lisp/vc.el b/lisp/vc.el index a14e95f7b42..d063c2c8abc 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -513,11 +513,6 @@ ;; Operation called in current buffer when opening a file. This can ;; be used by the backend to setup some local variables it might need. ;; -;; - find-file-not-found-hook () -;; -;; Operation called in current buffer when opening a non-existing file. -;; By default, this asks the user if she wants to check out the file. -;; ;; - extra-menu () ;; ;; Return a menu keymap, the items in the keymap will appear at the -- 2.39.2