summaryrefslogtreecommitdiff
path: root/lisp/vc-hooks.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2008-05-27 05:36:03 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2008-05-27 05:36:03 +0000
commite02d8ae787fd5d10616ba5cea647cd1247c28405 (patch)
treec1450a3a74de5eb76637906ad5d8eba6bef780ec /lisp/vc-hooks.el
parent3b738106ab1db1f834810870a4368bf9a788a31b (diff)
downloademacs-e02d8ae787fd5d10616ba5cea647cd1247c28405.tar.gz
* vc-dispatcher.el (vc-directory-resynch-file): Rename to ...
(vc-dir-resynch-file): ... this. Update callers. Use vc-string-prefix-p. Ignore directory args. (vc-string-prefix-p): CSE. (vc-resynch-buffer): Restore conditional. * vc-hooks.el (vc-after-save): Improve test. (vc-mode-line): Fix indentation.
Diffstat (limited to 'lisp/vc-hooks.el')
-rw-r--r--lisp/vc-hooks.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 738cf257562..7ac1e85650f 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -745,7 +745,7 @@ Before doing that, check if there are any old backups and get rid of them."
(vc-call-backend backend 'make-version-backups-p file)
(vc-make-version-backup file)))))
-(declare-function vc-directory-resynch-file "vc-dispatcher" (&optional fname))
+(declare-function vc-dir-resynch-file "vc-dispatcher" (&optional fname))
(defun vc-after-save ()
"Function to be called by `basic-save-buffer' (in files.el)."
@@ -766,10 +766,10 @@ Before doing that, check if there are any old backups and get rid of them."
(eq (vc-checkout-model backend (list file)) 'implicit)
(vc-file-setprop file 'vc-state 'edited)
(vc-mode-line file)
- (when (featurep 'vc)
- ;; If VC is not loaded, then there can't be
- ;; any directory buffer to synchronize.
- (vc-directory-resynch-file file)))))
+ ;; Try to avoid unnecessary work, a *vc-dir* buffer is only
+ ;; present if this is true.
+ (when (memq 'vc-dir-resynch-file after-save-hook)
+ (vc-dir-resynch-file file)))))
(defvar vc-menu-entry
'(menu-item "Version Control" vc-menu-map
@@ -819,9 +819,9 @@ visiting FILE."
;; If the user is root, and the file is not owner-writable,
;; then pretend that we can't write it
;; even though we can (because root can write anything).
- ;; This way, even root cannot modify a file that isn't locked.
- (and (equal file buffer-file-name)
- (not buffer-read-only)
+ ;; This way, even root cannot modify a file that isn't locked.
+ (and (equal file buffer-file-name)
+ (not buffer-read-only)
(zerop (user-real-uid))
(zerop (logand (file-modes buffer-file-name) 128))
(setq buffer-read-only t)))