* vc/vc-hooks.el (vc-find-file-hook): `buffer-file-truename' can
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 7 Feb 2013 08:50:04 +0000 (09:50 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 7 Feb 2013 08:50:04 +0000 (09:50 +0100)
be nil.  Handle this.  (Bug#13636)

lisp/ChangeLog
lisp/vc/vc-hooks.el

index a0e8836..4211901 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * vc/vc-hooks.el (vc-find-file-hook): `buffer-file-truename' can
+       be nil.  Handle this.  (Bug#13636)
+
 2013-02-07  Richard Stallman  <rms@gnu.org>
 
        * mail/rmail.el (rmail-variables): Specify `no-conversion' for
index 818b37b..5c8a451 100644 (file)
@@ -858,8 +858,10 @@ 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* ((truename (expand-file-name buffer-file-truename))
-              (link-type (and (not (equal buffer-file-name truename))
+       ((let* ((truename (and buffer-file-truename
+                             (expand-file-name buffer-file-truename)))
+              (link-type (and truename
+                              (not (equal buffer-file-name truename))
                               (vc-backend truename))))
          (cond ((not link-type) nil)   ;Nothing to do.
                ((eq vc-follow-symlinks nil)