emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: locate-dominating-file calls `stat' too eagerly


From: Eli Zaretskii
Subject: Re: locate-dominating-file calls `stat' too eagerly
Date: Mon, 29 Sep 2008 22:05:04 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Mon, 29 Sep 2008 12:19:15 -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.

> > And btw, won't the user test cover the case of crossing ~/ as well?
> 
> In 99% of the cases, yes.

What are the remaining 1%?  Again, I think they should be mentioned in
comments.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]