summaryrefslogtreecommitdiff
path: root/lisp/vc-hooks.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-02-26 00:17:43 +0000
committerRichard M. Stallman <rms@gnu.org>1996-02-26 00:17:43 +0000
commite7f5ddc2c864f21242a9bdcebc96aa1e9b78a922 (patch)
tree249f8f547034d01a649b2f6c3f3f8b7675705b64 /lisp/vc-hooks.el
parent58ffb6ae8eb36c1758ae4e4db2aa830bfab07c69 (diff)
downloademacs-e7f5ddc2c864f21242a9bdcebc96aa1e9b78a922.tar.gz
(vc-follow-link): Simplify by taking advantage
of Feb 21 change in find-file-noselect.
Diffstat (limited to 'lisp/vc-hooks.el')
-rw-r--r--lisp/vc-hooks.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index f65a39fc5ec..9fce8a43d09 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -924,12 +924,18 @@ control system name."
;; visit the real file instead. If the real file is already visited in
;; another buffer, make that buffer current, and kill the buffer
;; that visits the link.
- (let* ((truename (file-truename buffer-file-name))
- (true-buffer (get-file-buffer truename)))
- (if true-buffer
- (set-buffer true-buffer)
- (kill-buffer (current-buffer))
- (set-buffer (find-file-noselect truename)))))
+ (let* ((truename (abbreviate-file-name (file-truename buffer-file-name)))
+ (true-buffer (find-buffer-visiting truename))
+ (this-buffer (current-buffer)))
+ (if (eq true-buffer this-buffer)
+ (progn
+ ;; In principle, we could do something like set-visited-file-name.
+ ;; However, it can't be exactly the same as set-visited-file-name.
+ ;; I'm not going to work out the details right now. -- rms.
+ (set-buffer (find-file-noselect truename))
+ (kill-buffer this-buffer))
+ (set-buffer true-buffer)
+ (kill-buffer this-buffer))))
;;; install a call to the above as a find-file hook
(defun vc-find-file-hook ()