GNU bug report logs - #5297
23.1; vc: fails to follow symlinks inside HOME

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Yuya Nishihara <yuya <at> tcha.org>; Keywords: patch; dated Sun, 3 Jan 2010 13:06:03 UTC; Maintainer for emacs is bug-gnu-emacs <at> gnu.org.
Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. Full text available.

Message received at 5297 <at> debbugs.gnu.org:


Received: (at 5297) by debbugs.gnu.org; 5 Jan 2010 14:08:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 05 09:08:32 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NSA5E-0003gR-M8
	for submit <at> debbugs.gnu.org; Tue, 05 Jan 2010 09:08:30 -0500
Received: from mx61.ms.so-net.ne.jp ([202.238.83.161])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <yuya <at> tcha.org>) id 1NRR5t-0006wE-11
	for 5297 <at> debbugs.gnu.org; Sun, 03 Jan 2010 09:06:11 -0500
Received: from gimlet.localnet (stnet.adsl.027243.netwave.or.jp
	[202.67.27.243]) (authenticated)
	by mx61.ms.so-net.ne.jp  with ESMTP id o03E5xjt018064
	(using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256 bits));
	Sun, 3 Jan 2010 23:06:00 +0900 (JST)
From: Yuya Nishihara <yuya <at> tcha.org>
To: 5297 <at> debbugs.gnu.org
Subject: bug#5297: [PATCH] vc: fixed test of symlinks on abbreviatable path
Date: Sun, 3 Jan 2010 23:05:06 +0900
User-Agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )
References: <201001031533.43703.yuya <at> tcha.org>
In-Reply-To: <201001031533.43703.yuya <at> tcha.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201001032305.07014.yuya <at> tcha.org>
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: 5297
X-Mailman-Approved-At: Tue, 05 Jan 2010 09:08:26 -0500
Cc: Yuya Nishihara <yuya <at> tcha.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.4 (---)

commit 51431c222c24bbe2919d3d98032f73723ebfccea
Author: Yuya Nishihara <yuya <at> tcha.org>
Date:   Sun Jan 3 14:12:56 2010 +0900

    vc: fixed test of symlinks on abbreviatable path
    
    buffer-file-truename is *abbreviated* truename, but buffer-file-name seems not,
    so we need to expand it.
    
    With abbreviated file-name, at least, vc-git and vc-hg are not detected
    as backend. This means symlinks to git/hg-managed files on HOME directory
    are not handled by vc-find-file-hook.

diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index fabb35f..238fafe 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -890,8 +890,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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5297; Package emacs. Full text available.

Message received at 5297 <at> debbugs.gnu.org:


Received: (at 5297) by debbugs.gnu.org; 5 Jan 2010 14:08:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 05 09:08:31 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NSA5H-0003gU-0H
	for submit <at> debbugs.gnu.org; Tue, 05 Jan 2010 09:08:31 -0500
Received: from mx61.ms.so-net.ne.jp ([202.238.83.161])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <yuya <at> tcha.org>) id 1NRRC1-0006z9-Dj
	for 5297 <at> debbugs.gnu.org; Sun, 03 Jan 2010 09:12:30 -0500
Received: from gimlet.localnet (stnet.adsl.027243.netwave.or.jp
	[202.67.27.243]) (authenticated)
	by mx61.ms.so-net.ne.jp  with ESMTP id o03ECLAA022558
	(using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256 bits));
	Sun, 3 Jan 2010 23:12:22 +0900 (JST)
From: Yuya Nishihara <yuya <at> tcha.org>
To: 5297 <at> debbugs.gnu.org
Subject: bug#5297: Re: 23.1; vc: fails to follow symlinks inside HOME
Date: Sun, 3 Jan 2010 23:10:47 +0900
User-Agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )
References: <201001031533.43703.yuya <at> tcha.org>
In-Reply-To: <201001031533.43703.yuya <at> tcha.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201001032310.47452.yuya <at> tcha.org>
X-Spam-Score: -3.7 (---)
X-Debbugs-Envelope-To: 5297
X-Mailman-Approved-At: Tue, 05 Jan 2010 09:08:26 -0500
Cc: Yuya Nishihara <yuya <at> tcha.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.3 (---)

Hi,

> When detecting vc backend, vc-find-file-hook passes buffer-file-truename
> to vc-backend function. However, because buffer-file-truename is *abbreviated*,
> following vc-hg-registered or vc-git-registered just fails.

The following snippet is workaround for the problem:

--
(defadvice vc-backend (before vc-backend-fix-abbrev-name activate)
  "Fixes vc-backend to expand abbreviated buffer-file-truename"
  (if (stringp (ad-get-arg 0))
      (ad-set-arg 0 (expand-file-name (ad-get-arg 0)))))
--

Yuya.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5297; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Jan 2010 13:05:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 03 08:05:39 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NRQ9I-0006Ur-9V
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 08:05:39 -0500
Received: from fencepost.gnu.org ([140.186.70.10])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <yuya <at> tcha.org>) id 1NRK73-0003LO-GT
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 01:38:58 -0500
Received: from mx10.gnu.org ([199.232.76.166]:44427)
	by fencepost.gnu.org with esmtp (Exim 4.69)
	(envelope-from <yuya <at> tcha.org>) id 1NRK70-0003SV-Co
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 01:38:50 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <yuya <at> tcha.org>) id 1NRK6u-000785-7x
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 01:38:50 -0500
X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python
X-Spam-Level: 
X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO,
	UNPARSEABLE_RELAY autolearn=ham version=3.1.0
Received: from lists.gnu.org ([199.232.76.165]:36468)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <yuya <at> tcha.org>) id 1NRK6u-000781-2W
	for submit <at> debbugs.gnu.org; Sun, 03 Jan 2010 01:38:44 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NRK6t-0006KV-QQ
	for bug-gnu-emacs <at> gnu.org; Sun, 03 Jan 2010 01:38:43 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NRK6o-0006HA-Jq
	for bug-gnu-emacs <at> gnu.org; Sun, 03 Jan 2010 01:38:42 -0500
Received: from [199.232.76.173] (port=60582 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NRK6o-0006H2-CI
	for bug-gnu-emacs <at> gnu.org; Sun, 03 Jan 2010 01:38:38 -0500
Received: from mx62.ms.so-net.ne.jp ([202.238.83.162]:32946)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <yuya <at> tcha.org>) id 1NRK6n-00075g-LX
	for bug-gnu-emacs <at> gnu.org; Sun, 03 Jan 2010 01:38:38 -0500
Received: from gimlet.localnet (stnet.adsl.027165.netwave.or.jp
	[202.67.27.165]) (authenticated)
	by mx62.ms.so-net.ne.jp  with ESMTP id o036cW4x000301
	(using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256 bits))
	for <bug-gnu-emacs <at> gnu.org>; Sun, 3 Jan 2010 15:38:33 +0900 (JST)
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; vc: fails to follow symlinks inside HOME
From: Yuya Nishihara <yuya <at> tcha.org>
Date: Sun, 3 Jan 2010 15:33:43 +0900
MIME-Version: 1.0
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-Id: <201001031533.43703.yuya <at> tcha.org>
X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 03 Jan 2010 08:05:33 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.9 (-----)

When detecting vc backend, vc-find-file-hook passes buffer-file-truename
to vc-backend function. However, because buffer-file-truename is *abbreviated*,
following vc-hg-registered or vc-git-registered just fails.

Also it seems bad to test equalness of buffer-file-name
and buffer-file-truename. Maybe buffer-file-name is expanded,
but buffer-file-truename is abbreviated.


In GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.3)
 of 2009-11-02 on excelsior, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10605000
configured using `configure  '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: C
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  cua-mode: t
  tabbar-mwheel-mode: t
  tabbar-mode: t
  highlight-symbol-mode: t
  hi-lock-mode: t
  global-linum-mode: t
  linum-mode: t
  hl-line-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r <tab> <return>

Recent messages:
Loading /etc/emacs/site-start.d/50php-elisp.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50pymacs.el (source)...done
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done
Loading /etc/emacs/site-start.d/50python-mode.el (source)...done
Loading /etc/emacs/site-start.d/50ruby1.8-elisp.el (source)...done
Loading /etc/emacs/site-start.d/50yaml-mode.el (source)...done
Loading cua-base...done
Loading paren...done
For information about GNU Emacs and the GNU system, type <f1> C-a.






Acknowledgement sent to Yuya Nishihara <yuya <at> tcha.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5297; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 20 Sep 2011 19:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.