From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: locate-dominating-file calls `stat' too eagerly Date: Tue, 30 Sep 2008 10:02:41 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222783414 10730 80.91.229.12 (30 Sep 2008 14:03:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2008 14:03:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 16:04:22 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 1Kkfpe-0001a3-Qw for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2008 16:04:07 +0200 Original-Received: from localhost ([127.0.0.1]:37194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kkfoc-0001TO-2Q for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2008 10:03:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkfoU-0001QO-5Q for emacs-devel@gnu.org; Tue, 30 Sep 2008 10:02:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkfoP-0001K5-5Q for emacs-devel@gnu.org; Tue, 30 Sep 2008 10:02:51 -0400 Original-Received: from [199.232.76.173] (port=58361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkfoO-0001JX-HE for emacs-devel@gnu.org; Tue, 30 Sep 2008 10:02:48 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:11596 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KkfoL-00076J-7S; Tue, 30 Sep 2008 10:02:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgEAH7O4UjO+KDT/2dsb2JhbACBZLxTgWeBBA X-IronPort-AV: E=Sophos;i="4.33,338,1220241600"; d="scan'208";a="27756244" Original-Received: from 206-248-160-211.dsl.teksavvy.com (HELO pastel.home) ([206.248.160.211]) by ironport2-out.teksavvy.com with ESMTP; 30 Sep 2008 10:02:42 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D9E8C8028; Tue, 30 Sep 2008 10:02:41 -0400 (EDT) In-Reply-To: (Eli Zaretskii's message of "Tue, 30 Sep 2008 10:14:32 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:104259 Archived-At: >> >> > (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? I have the vague feeling that it was reported to the list, indeed. But I wouldn't spend too much time on it, Stefan