unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Build failure on M$ (using MSVC): Patch enclosed
Date: Tue, 20 May 2008 12:21:30 +0200	[thread overview]
Message-ID: <86prrhs2c5.fsf@lola.quinscape.zz> (raw)
In-Reply-To: <48329DEC.4020904@gnu.org> (Jason Rumney's message of "Tue, 20 May 2008 10:46:20 +0100")

Jason Rumney <jasonr@gnu.org> 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	other threads:[~2008-05-20 10:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20  4:58 Build failure on M$ (using MSVC): Patch enclosed dhruva
2008-05-20  6:10 ` dhruva
2008-05-20  8:26   ` dhruva
2008-05-20  8:58     ` dhruva
2008-05-20  9:46       ` Jason Rumney
2008-05-20 10:21         ` David Kastrup [this message]
2008-05-20 11:57           ` dhruva
2008-05-20 12:01             ` dhruva
2008-05-20 18:26       ` Eli Zaretskii
2008-05-20 12:11     ` Herbert Euler
2008-05-20 18:30       ` Eli Zaretskii
2008-05-20 18:12 ` Eli Zaretskii
2008-05-21  3:13   ` dhruva
2008-05-21 17:28     ` Stefan Monnier
2008-05-22  3:51       ` dhruva
2008-05-22  4:46         ` Stefan Monnier
2008-05-22  5:03           ` dhruva
2008-05-22  6:52             ` David Kastrup
2008-05-22  7:10               ` dhruva
2008-05-22  7:32                 ` David Kastrup
2008-05-22 15:49                 ` Stefan Monnier
2008-05-22 15:45               ` Stefan Monnier
2008-05-22  6:56             ` dhruva
2008-05-23  8:30               ` Eli Zaretskii
2008-05-23  9:15                 ` Jason Rumney
2008-05-22  8:32         ` Jason Rumney
2008-05-22  9:10           ` dhruva
2008-05-22  9:29             ` dhruva
2008-05-22 12:31               ` Jason Rumney
2008-05-22 13:10                 ` Jason Rumney
2008-05-22 13:33                   ` Miles Bader

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86prrhs2c5.fsf@lola.quinscape.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).