emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 3086627: * lisp/vc/vc-hooks.el (vc-refresh-state):


From: Stefan Monnier
Subject: [Emacs-diffs] master 3086627: * lisp/vc/vc-hooks.el (vc-refresh-state): New command
Date: Wed, 02 Sep 2015 03:41:48 +0000

branch: master
commit 30866274e21c5f0a1c5f60cfe290743e7d482349
Author: David Caldwell <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/vc/vc-hooks.el (vc-refresh-state): New command
    
    (vc-refresh-state): Rename from vc-find-file-hook and make interactive.
    (vc-find-file-hook): Redefine as obsolete alias.
    
    Copyright-paperwork-exempt: yes
---
 etc/NEWS            |    1 +
 lisp/vc/vc-hooks.el |   12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index e50e7a7..c664e02 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -310,6 +310,7 @@ standards.
 
 * Changes in Specialized Modes and Packages in Emacs 25.1
 
+** You can recompute the VC state of a file buffer with `M-x vc-refresh-state'
 ** Prog mode has some support for multi-mode indentation.
 See `prog-indentation-context' and `prog-widen'.
 
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index bae9919..e674f0e 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]