From 33f95a82e97cac000a98dc5b1100ad7a095e12d3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 22 Nov 2008 05:23:42 +0000 Subject: [PATCH] (vc-follow-link, vc-find-file-hook): Use buffer-file-truename to handle symlinks in any part of the filename. --- lisp/ChangeLog | 5 +++++ lisp/vc-hooks.el | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ded553a01f4..f4457b02305 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-11-22 Stefan Monnier + + * vc-hooks.el (vc-follow-link, vc-find-file-hook): + Use buffer-file-truename to handle symlinks in any part of the filename. + 2008-11-22 Glenn Morris * vc-mtn.el (vc-mtn-diff-switches): New option. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index fdee4c4680e..85f665bc9de 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -850,8 +850,7 @@ This function assumes that the file is registered." "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* ((truename (abbreviate-file-name (file-chase-links buffer-file-name))) - (true-buffer (find-buffer-visiting truename)) + (let* ((true-buffer (find-buffer-visiting buffer-file-truename)) (this-buffer (current-buffer))) (if (eq true-buffer this-buffer) (progn @@ -885,8 +884,8 @@ current, and kill the buffer that visits the link." (set (make-local-variable 'backup-inhibited) t)) ;; Let the backend setup any buffer-local things he needs. (vc-call-backend (vc-backend buffer-file-name) 'find-file-hook)) - ((let ((link-type (and (file-symlink-p buffer-file-name) - (vc-backend (file-chase-links buffer-file-name))))) + ((let ((link-type (and (not (equal buffer-file-name buffer-file-truename)) + (vc-backend buffer-file-truename)))) (cond ((not link-type) nil) ;Nothing to do. ((eq vc-follow-symlinks nil) (message -- 2.11.4.GIT