From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: vc-find-root and nonexistent drives Date: Sat, 16 Feb 2008 15:43:50 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1203169451 1293 80.91.229.12 (16 Feb 2008 13:44:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Feb 2008 13:44:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 16 14:44:34 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JQNLG-0006pe-D5 for ged-emacs-devel@m.gmane.org; Sat, 16 Feb 2008 14:44:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQNKm-0007eL-6X for ged-emacs-devel@m.gmane.org; Sat, 16 Feb 2008 08:44:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQNKh-0007eA-Pp for emacs-devel@gnu.org; Sat, 16 Feb 2008 08:43:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQNKc-0007dy-CM for emacs-devel@gnu.org; Sat, 16 Feb 2008 08:43:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQNKc-0007dv-6y for emacs-devel@gnu.org; Sat, 16 Feb 2008 08:43:54 -0500 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JQNKb-0008IC-Q2 for emacs-devel@gnu.org; Sat, 16 Feb 2008 08:43:54 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-204-85.inter.net.il [84.229.204.85]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id JEM33001 (AUTH halo1); Sat, 16 Feb 2008 15:41:24 +0200 (IST) In-reply-to: (lekktu@gmail.com) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89247 Archived-At: > Date: Sat, 16 Feb 2008 04:52:35 +0100 > From: "Juanma Barranquero" > > On Windows, trying to visit a file in a non-existent drive loops in > `vc-find-root'. > > The reason is that currently, `vc-find-root' does: > > (while (not (file-directory-p file)) > (setq file (file-name-directory (directory-file-name file)))) > > which assumes that the output of `file-name-directory' will be > different in each iteration of the while loop. That is not so when the > drive does not exist, for example: > > (file-name-directory (directory-file-name "g:/")) => "g:/" So how about changing the loop condition to (while (and (not (file-directory-p file)) (file-exists-p file)) ?