Mercurial > emacs
changeset 99788:2de5937e4473
(vc-follow-link, vc-find-file-hook):
Use buffer-file-truename to handle symlinks in any part of the filename.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sat, 22 Nov 2008 05:23:42 +0000 |
parents | 24e48b0174fa |
children | 125a6fd7c956 |
files | lisp/ChangeLog lisp/vc-hooks.el |
diffstat | 2 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sat Nov 22 03:39:53 2008 +0000 +++ b/lisp/ChangeLog Sat Nov 22 05:23:42 2008 +0000 @@ -1,3 +1,8 @@ +2008-11-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * 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 <rgm@gnu.org> * vc-mtn.el (vc-mtn-diff-switches): New option.
--- a/lisp/vc-hooks.el Sat Nov 22 03:39:53 2008 +0000 +++ b/lisp/vc-hooks.el Sat Nov 22 05:23:42 2008 +0000 @@ -850,8 +850,7 @@ "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 @@ (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