Function: vc-follow-link

vc-follow-link is a byte-compiled function defined in vc-hooks.el.gz.

Signature

(vc-follow-link)

Documentation

If current buffer visits a symbolic link, visit the real file.

If the real file is already visited in another buffer, make that buffer current, and kill the buffer that visits the link.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-hooks.el.gz
(defun vc-follow-link ()
  "If current buffer visits a symbolic link, visit the real file.
If the real file is already visited in another buffer, make that buffer
current, and kill the buffer that visits the link."
  (let* ((true-buffer (find-buffer-visiting buffer-file-truename))
	 (this-buffer (current-buffer)))
    (if (eq true-buffer this-buffer)
	(let ((truename buffer-file-truename))
	  (kill-buffer this-buffer)
	  ;; 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)))
      (set-buffer true-buffer)
      (kill-buffer this-buffer))))