emacs-devel
[Top][All Lists]
Advanced

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

Re: Build failure on M$ (using MSVC): Patch enclosed


From: dhruva
Subject: Re: Build failure on M$ (using MSVC): Patch enclosed
Date: Thu, 22 May 2008 09:21:54 +0530

Hi,

On 5/21/08, Stefan Monnier <address@hidden> wrote:
> > diff --git a/lisp/files.el b/lisp/files.el
>  > index ee5efe4..bb8a021 100644
>  > --- a/lisp/files.el
>  > +++ b/lisp/files.el
>  > @@ -3120,8 +3120,9 @@ If the file is in a registered project, a cons from
>  >  `project-directory-alist' is returned.
>  >  Otherwise this returns nil."
>  >    (let ((dir (file-name-directory file))
>  > -     (result nil))
>  > -    (while (and (not (string= dir "/"))
>  > +        (result nil)
>  > +        (prevdir nil))
>  > +    (while (and (not (string= dir prevdir))
>  >               (not result))
>  >        (cond
>  >         ((setq result (assoc dir project-directory-alist))
>  > @@ -3130,6 +3131,7 @@ Otherwise this returns nil."
>  >         ((file-exists-p (expand-file-name ".dir-settings.el" dir))
>  >       (setq result (expand-file-name ".dir-settings.el" dir)))
>  >         (t
>  > +        (setq prevdir dir)
>  >       (setq dir (file-name-directory (directory-file-name dir))))))
>  >      result))
>
>
> Actually, why doesn't this code use locate-dominating-file?

Well, I was not aware of that function. Looking a little deeper into
it, it does not traverse above the current user $HOME (~/ or %HOME%).
This code needs to go all the way till the top. Since it does a
username comparison, it apprears a bit more expensive (based on gut
feel though).


my HOME is set to: c:/users/dhruva
My lisp expresssion: (locate-dominating-file
"c:/users/dhruva/stub/git/emacs/" ".dir-settings.el")
1. I place the .dir-settings.el under "C:/" and I get a nil
2. I move the file under HOME (c:/users/dhruva/.dir-settings.el) and get it.
=> It does not traverse beyond the HOME directory.

-dhruva

-- 
Contents reflect my personal views only!




reply via email to

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