diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-11-22 05:23:42 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-11-22 05:23:42 +0000 |
commit | 845895c6af1dacec51d6befec01874db9f1fdc29 (patch) | |
tree | d8980793667337b1d6af9432b2b06b78e8328bca /lisp | |
parent | ad48abbdac5d4a57b9e0dd655beed734f2cd00c0 (diff) | |
download | emacs-845895c6af1dacec51d6befec01874db9f1fdc29.tar.gz |
(vc-follow-link, vc-find-file-hook):
Use buffer-file-truename to handle symlinks in any part of the filename.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/vc-hooks.el | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d05ad4a6a71..d14278f8054 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. 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 |