]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-follow-link): Simplify by taking advantage
authorRichard M. Stallman <rms@gnu.org>
Mon, 26 Feb 1996 00:17:43 +0000 (00:17 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 26 Feb 1996 00:17:43 +0000 (00:17 +0000)
of Feb 21 change in find-file-noselect.

lisp/vc-hooks.el

index f65a39fc5ec29d51fa40576060628ea4709fb692..9fce8a43d09c16dd785de00b6c9af108c37f49ea 100644 (file)
@@ -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 ()