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: locate-dominating-file calls `stat' too eagerly Date: Tue, 30 Sep 2008 10:14:32 +0300 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1222758933 28936 80.91.229.12 (30 Sep 2008 07:15:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2008 07:15:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 09:16:31 2008 connect(): Connection refused 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 1KkZTD-0002YD-7L for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2008 09:16:31 +0200 Original-Received: from localhost ([127.0.0.1]:54025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkZSA-0004Ez-B4 for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2008 03:15:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkZS5-0004Ek-29 for emacs-devel@gnu.org; Tue, 30 Sep 2008 03:15:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkZS4-0004EU-AV for emacs-devel@gnu.org; Tue, 30 Sep 2008 03:15:20 -0400 Original-Received: from [199.232.76.173] (port=53687 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkZS4-0004ER-55 for emacs-devel@gnu.org; Tue, 30 Sep 2008 03:15:20 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:54716) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkZS4-00008y-CI for emacs-devel@gnu.org; Tue, 30 Sep 2008 03:15:20 -0400 Original-Received: from mtaout6.012.net.il ([84.95.2.16]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KkZS3-00049Y-1t for emacs-devel@gnu.org; Tue, 30 Sep 2008 03:15:19 -0400 Original-Received: from HOME-C4E4A596F7 ([77.127.170.116]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K7Z007XBYTZ5K50@i-mtaout6.012.net.il> for emacs-devel@gnu.org; Tue, 30 Sep 2008 10:15:36 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-kernel: by mx20.gnu.org: Solaris 10 (1203?) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:104251 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Mon, 29 Sep 2008 16:45:22 -0400 > > >> > (defun locate-dominating-file (file regexp) > >> > "Look up the directory hierarchy from FILE for a file matching REGEXP." > >> > ;; If FILE does not exist, find its parent directory that does. > >> > (or (file-exists-p file) > >> > (while (and file (not (file-directory-p file))) > >> > (setq file (file-name-directory (directory-file-name file))))) > >> In some corner cases, this can infloop. > > What are those cases? I think we need to describe them in a comment > > there. > > Can't remember, sadly. Were they reported to one of the mailing lists? Should I search the archives?