From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dhruva Newsgroups: gmane.emacs.devel Subject: Re: Build failure on M$ (using MSVC): Patch enclosed Date: Thu, 22 May 2008 09:21:54 +0530 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1211428357 6731 80.91.229.12 (22 May 2008 03:52:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 May 2008 03:52:37 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 22 05:53:14 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 1Jz1re-0005ZZ-DC for ged-emacs-devel@m.gmane.org; Thu, 22 May 2008 05:53:14 +0200 Original-Received: from localhost ([127.0.0.1]:32774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jz1qt-0004a1-Qa for ged-emacs-devel@m.gmane.org; Wed, 21 May 2008 23:52:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jz1qQ-000418-82 for emacs-devel@gnu.org; Wed, 21 May 2008 23:51:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jz1qP-00040E-DL for emacs-devel@gnu.org; Wed, 21 May 2008 23:51:57 -0400 Original-Received: from [199.232.76.173] (port=41996 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jz1qP-000401-5L for emacs-devel@gnu.org; Wed, 21 May 2008 23:51:57 -0400 Original-Received: from wf-out-1314.google.com ([209.85.200.168]:46603) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jz1qO-0002yC-7Y for emacs-devel@gnu.org; Wed, 21 May 2008 23:51:56 -0400 Original-Received: by wf-out-1314.google.com with SMTP id 28so2572672wfc.24 for ; Wed, 21 May 2008 20:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=MF5p5Nssu+WH2PUvlJpeU6KLMNfz5JKCKR0XNNo8xAw=; b=jF6sKWdIBAWCpHHGBvMdYfhh5ko4WhgtaII6kcSZwb8tlC7Iu07GafFhIZFJQIFAnCcNN9my2dFt28dog+VIlB1uVOKcYJI8Vs97V48Zb2P8u5IOoqhu7ciySkPj3Di3Y66c6+ymBqAu360zmPnRp02CK8IcEkoEtYuMnJUNjac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WlzwN+goPRRRoloVz814a0ySFRC6yFcEalM7uAQx+UDuwDv4/4/f6O6bRcJFzKn4fN0nzrJdhlDrMRB1W0Nm1SVwV2jxdEoPVggMEol9LdBBOWkQkHf2XK/iCg51jbyz2KlRgFNyd/W9nTwtWfWmInQPNDH98W2dqMGJb//OO5c= Original-Received: by 10.142.242.11 with SMTP id p11mr2421006wfh.135.1211428314798; Wed, 21 May 2008 20:51:54 -0700 (PDT) Original-Received: by 10.142.187.10 with HTTP; Wed, 21 May 2008 20:51:54 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 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:97496 Archived-At: Hi, On 5/21/08, Stefan Monnier wrote: > > diff --git a/lisp/files.el b/lisp/files.el > > index ee5efe4..bb8a021 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -3120,8 +3120,9 @@ If the file is in a registered project, a cons from > > `project-directory-alist' is returned. > > Otherwise this returns nil." > > (let ((dir (file-name-directory file)) > > - (result nil)) > > - (while (and (not (string= dir "/")) > > + (result nil) > > + (prevdir nil)) > > + (while (and (not (string= dir prevdir)) > > (not result)) > > (cond > > ((setq result (assoc dir project-directory-alist)) > > @@ -3130,6 +3131,7 @@ Otherwise this returns nil." > > ((file-exists-p (expand-file-name ".dir-settings.el" dir)) > > (setq result (expand-file-name ".dir-settings.el" dir))) > > (t > > + (setq prevdir dir) > > (setq dir (file-name-directory (directory-file-name dir)))))) > > result)) > > > Actually, why doesn't this code use locate-dominating-file? Well, I was not aware of that function. Looking a little deeper into it, it does not traverse above the current user $HOME (~/ or %HOME%). This code needs to go all the way till the top. Since it does a username comparison, it apprears a bit more expensive (based on gut feel though). my HOME is set to: c:/users/dhruva My lisp expresssion: (locate-dominating-file "c:/users/dhruva/stub/git/emacs/" ".dir-settings.el") 1. I place the .dir-settings.el under "C:/" and I get a nil 2. I move the file under HOME (c:/users/dhruva/.dir-settings.el) and get it. => It does not traverse beyond the HOME directory. -dhruva -- Contents reflect my personal views only!