aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2009-06-26 23:53:55 +0000
committerDan Nicolaescu2009-06-26 23:53:55 +0000
commit3c3bf6ce8fb1f31177db297dc70bfae25cca552a (patch)
treeb78c6c8d9914e01175254a9e9cb4be1c1fbeeddf
parent297710942213ef3bf4a06190459bbc1fb0362ffb (diff)
downloademacs-3c3bf6ce8fb1f31177db297dc70bfae25cca552a.tar.gz
emacs-3c3bf6ce8fb1f31177db297dc70bfae25cca552a.zip
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.
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/vc-git.el1
-rw-r--r--lisp/vc-hg.el1
-rw-r--r--lisp/vc-hooks.el21
-rw-r--r--lisp/vc-rcs.el8
-rw-r--r--lisp/vc.el5
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.
32On systems which support GVFS-Fuse, Tramp offers the new connection 32On systems which support GVFS-Fuse, Tramp offers the new connection
33methods "dav", "davs" and "obex". 33methods "dav", "davs" and "obex".
34 34
35** VC and related modes
36
37*** When a file is not found, VC will not try to check it out of RCS anymore.
38
35 39
36* Installation Changes in Emacs 23.1 40* Installation Changes in Emacs 23.1
37 41
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a5650015086..5b9871323aa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12009-06-26 Dan Nicolaescu <dann@ics.uci.edu>
2
3 Remove find-file-not-found-hook VC method. (Bug#2757)
4 * vc-hooks.el (vc-file-not-found-hook)
5 (vc-default-find-file-not-found-hook): Remove functions.
6 (find-file-not-found-functions): Do not add vc-file-not-found-hook.
7 * vc-rcs.el (vc-rcs-find-file-not-found-hook): Remove function.
8 * vc.el:
9 * vc-hg.el:
10 * vc-git.el: Do not mention find-file-not-found-hook VC method.
11
12009-06-25 Agustín Martín <agustin.martin@hispalinux.es> 122009-06-25 Agustín Martín <agustin.martin@hispalinux.es>
2 13
3 * textmodes/ispell.el: Add `ispell-looking-back' XEmacs 14 * 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 @@
101;; - delete-file (file) OK 101;; - delete-file (file) OK
102;; - rename-file (old new) OK 102;; - rename-file (old new) OK
103;; - find-file-hook () NOT NEEDED 103;; - find-file-hook () NOT NEEDED
104;; - find-file-not-found-hook () NOT NEEDED
105 104
106(eval-when-compile 105(eval-when-compile
107 (require 'cl) 106 (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 @@
92;; - delete-file (file) TEST IT 92;; - delete-file (file) TEST IT
93;; - rename-file (old new) OK 93;; - rename-file (old new) OK
94;; - find-file-hook () PROBABLY NOT NEEDED 94;; - find-file-hook () PROBABLY NOT NEEDED
95;; - find-file-not-found-hook () PROBABLY NOT NEEDED
96 95
97;; 2) Implement Stefan Monnier's advice: 96;; 2) Implement Stefan Monnier's advice:
98;; vc-hg-registered and vc-hg-state 97;; 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."
911 911
912(add-hook 'find-file-hook 'vc-find-file-hook) 912(add-hook 'find-file-hook 'vc-find-file-hook)
913 913
914;; more hooks, this time for file-not-found
915(defun vc-file-not-found-hook ()
916 "When file is not found, try to check it out from version control.
917Returns t if checkout was successful, nil otherwise.
918Used in `find-file-not-found-functions'."
919 ;; When a file does not exist, ignore cached info about it
920 ;; from a previous visit.
921 ;; We check that `buffer-file-name' is non-nil. It should be always
922 ;; the case, but in conjunction with Tramp, it might be nil. M. Albinus.
923 (when buffer-file-name
924 (vc-file-clearprops buffer-file-name)
925 (let ((backend (vc-backend buffer-file-name)))
926 (when backend (vc-call-backend backend 'find-file-not-found-hook)))))
927
928(defun vc-default-find-file-not-found-hook (backend)
929 ;; This used to do what vc-rcs-find-file-not-found-hook does, but it only
930 ;; really makes sense for RCS. For other backends, better not do anything.
931 nil)
932
933(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook)
934
935(defun vc-kill-buffer-hook () 914(defun vc-kill-buffer-hook ()
936 "Discard VC info about a file when we kill its buffer." 915 "Discard VC info about a file when we kill its buffer."
937 (when buffer-file-name (vc-file-clearprops buffer-file-name))) 916 (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."
247 ;; The workfile is unchanged if rcsdiff found no differences. 247 ;; The workfile is unchanged if rcsdiff found no differences.
248 (zerop status))) 248 (zerop status)))
249 249
250(defun vc-rcs-find-file-not-found-hook ()
251 (if (yes-or-no-p
252 (format "File %s was lost; check out from version control? "
253 (file-name-nondirectory buffer-file-name)))
254 (save-excursion
255 (require 'vc)
256 (let ((default-directory (file-name-directory buffer-file-name)))
257 (not (vc-error-occurred (vc-checkout buffer-file-name)))))))
258 250
259;;; 251;;;
260;;; State-changing functions 252;;; 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 @@
513;; Operation called in current buffer when opening a file. This can 513;; Operation called in current buffer when opening a file. This can
514;; be used by the backend to setup some local variables it might need. 514;; be used by the backend to setup some local variables it might need.
515;; 515;;
516;; - find-file-not-found-hook ()
517;;
518;; Operation called in current buffer when opening a non-existing file.
519;; By default, this asks the user if she wants to check out the file.
520;;
521;; - extra-menu () 516;; - extra-menu ()
522;; 517;;
523;; Return a menu keymap, the items in the keymap will appear at the 518;; Return a menu keymap, the items in the keymap will appear at the