From cb5d51dc0707c3a55abb32ad09b747bc812c7b73 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 1 Dec 2012 21:25:13 +0800 Subject: [PATCH] Fix use of buffer-file-truename in vc-find-file-hook (tiny change). * lisp/vc/vc-hooks.el (vc-find-file-hook): Expand buffer-file-truename before using it for comparison. Fixes: debbugs:5297 --- lisp/ChangeLog | 5 +++++ lisp/vc/vc-hooks.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c2e5e9fa8ce..ec7791597f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-01 Yuya Nishihara (tiny change) + + * vc/vc-hooks.el (vc-find-file-hook): Expand buffer-file-truename + before using it for comparison (Bug#5297). + 2012-12-01 Jari Aalto * textmodes/css-mode.el (css-current-defun-name): New function. diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index ef900cb5257..40a1f3db982 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -858,8 +858,9 @@ 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 backend 'find-file-hook)) - ((let ((link-type (and (not (equal buffer-file-name buffer-file-truename)) - (vc-backend buffer-file-truename)))) + ((let* ((truename (expand-file-name buffer-file-truename)) + (link-type (and (not (equal buffer-file-name truename)) + (vc-backend truename)))) (cond ((not link-type) nil) ;Nothing to do. ((eq vc-follow-symlinks nil) (message -- 2.39.5