diff options
author | K. Handa <handa@gnu.org> | 2015-09-02 18:28:54 +0900 |
---|---|---|
committer | K. Handa <handa@gnu.org> | 2015-09-02 18:28:54 +0900 |
commit | e7b62736aade24620c8ba6fa6bd467d017f16ee0 (patch) | |
tree | d00a2203437a168b2414c6b73afc00a88d90b4b1 /lisp/vc/vc-hooks.el | |
parent | ae08d073d7e2738580341534adc3c5924dc76860 (diff) | |
parent | 30866274e21c5f0a1c5f60cfe290743e7d482349 (diff) | |
download | emacs-e7b62736aade24620c8ba6fa6bd467d017f16ee0.tar.gz emacs-e7b62736aade24620c8ba6fa6bd467d017f16ee0.tar.bz2 emacs-e7b62736aade24620c8ba6fa6bd467d017f16ee0.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/vc/vc-hooks.el')
-rw-r--r-- | lisp/vc/vc-hooks.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index bae991936b5..e674f0e4d4e 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,19 @@ 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) +(add-hook 'find-file-hook #'vc-refresh-state) +(define-obsolete-function-alias 'vc-find-file-hook 'vc-refresh-state "25.1") (defun vc-kill-buffer-hook () "Discard VC info about a file when we kill its buffer." |