>From 6cf0d2ad94666ffc14134541b6e7300f9d04ce67 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Sun, 30 Aug 2015 02:59:56 -0700 Subject: [PATCH] Rename vc-find-file-hook to vc-refresh-state and make it interactive. This is so one can `M-x vc-refresh state' if the file is added to or removed from version control behind Emacs's back. * lisp/vc/vc-hooks.el (vc-refresh-state): Rename from vc-find-file-hook and make interactive, retaining an obsolete alias. --- lisp/vc/vc-hooks.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index bae9919..18cdbdd 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -790,8 +790,9 @@ current, and kill the buffer that visits the link." (defun vc-default-find-file-hook (_backend) nil) -(defun vc-find-file-hook () - "Function for `find-file-hook' activating VC mode if appropriate." +(defun vc-refresh-state () + "Activate or deactivate VC mode as appropriate." + (interactive) ;; Recompute whether file is version controlled, ;; if user has killed the buffer and revisited. (when vc-mode @@ -838,18 +839,20 @@ current, and kill the buffer that visits the link." (vc-follow-link) (message "Followed link to %s" buffer-file-name) - (vc-find-file-hook)) + (vc-refresh-state)) (t (if (yes-or-no-p (format "Symbolic link to %s-controlled source file; follow link? " link-type)) (progn (vc-follow-link) (message "Followed link to %s" buffer-file-name) - (vc-find-file-hook)) + (vc-refresh-state)) (message "Warning: editing through the link bypasses version control") ))))))))) -(add-hook 'find-file-hook 'vc-find-file-hook) +(define-obsolete-function-alias 'vc-find-file-hook 'vc-refresh-state "25.1") + +(add-hook 'find-file-hook 'vc-refresh-state) (defun vc-kill-buffer-hook () "Discard VC info about a file when we kill its buffer." -- 2.5.0