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: David Kastrup
Subject: Re: Build failure on M$ (using MSVC): Patch enclosed
Date: Tue, 20 May 2008 12:21:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Jason Rumney <address@hidden> writes:

> dhruva wrote:
>> The below patch fixes the bug of infinite looping.
>>
>> diff --git a/lisp/files.el b/lisp/files.el
>> index ee5efe4..c680d32 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))
>> +       (root (expand-file-name "/"))
>>         (result nil))
>> -    (while (and (not (string= dir "/"))
>> +    (while (and (not (string= dir root))
>>                 (not result))
>>        (cond
>>         ((setq result (assoc dir project-directory-alist))
>>   
>
> I don't think this is sufficient for the case when the current
> directory is say "C:/some_dir/" and file is "D:/file.txt"

Probably, yes.  But if the problem is that the loop gets stuck in an
upward traversal, then it should be sufficient to remember the last loop
value and quit when the next one happens to be the same.

> Should this new project code be enabled by default? It seems to add a
> lot of directory searching overhead for simple file visiting,
> especially in batch mode.

Probably would make sense to make this work only in interactive
sessions.

Anyway, the problems are so very similar to that of vc-find-root that it
should use the same function.  It could make sense giving it a more
general name and moving it together with vc-ignore-dir-regexp to
files.el.

But there is no sense in solving the associated problem more than once.

-- 
David Kastrup




reply via email to

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