From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: locate-dominating-file calls `stat' too eagerly
Date: Mon, 29 Sep 2008 16:45:22 -0400 [thread overview]
Message-ID: <jwvhc7yd6ow.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <utzbykc2n.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Sep 2008 22:05:04 +0300")
>> > (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.
>> > 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.
These are too obvious to be worth mentioning: when the user owns ~/..
The most common such case I can think of is when the user is `root'.
Stefan
next prev parent reply other threads:[~2008-09-29 20:45 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
2008-09-29 20:45 ` Stefan Monnier [this message]
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=jwvhc7yd6ow.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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.