From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: locate-dominating-file calls `stat' too eagerly
Date: Mon, 29 Sep 2008 22:05:04 +0300 [thread overview]
Message-ID: <utzbykc2n.fsf@gnu.org> (raw)
In-Reply-To: <jwv1vz3djbf.fsf-monnier+emacs@gnu.org>
> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: emacs-devel@gnu.org
> 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.
next prev parent reply other threads:[~2008-09-29 19:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 11:54 locate-dominating-file calls `stat' too eagerly Eli Zaretskii
2008-09-29 14:06 ` Stefan Monnier
2008-09-29 14:36 ` Eli Zaretskii
2008-09-29 16:19 ` Stefan Monnier
2008-09-29 19:05 ` Eli Zaretskii [this message]
2008-09-29 20:45 ` Stefan Monnier
2008-09-30 7:14 ` Eli Zaretskii
2008-09-30 14:02 ` Stefan Monnier
2008-09-30 16:30 ` Eli Zaretskii
2008-09-30 12:52 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=utzbykc2n.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.