emacs-devel
[Top][All Lists]
Advanced

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

Re: vc-find-root and nonexistent drives


From: Eli Zaretskii
Subject: Re: vc-find-root and nonexistent drives
Date: Sat, 16 Feb 2008 15:43:50 +0200

> Date: Sat, 16 Feb 2008 04:52:35 +0100
> From: "Juanma Barranquero" <address@hidden>
> 
> On Windows, trying to visit a file in a non-existent drive loops in
> `vc-find-root'.
> 
> The reason is that currently, `vc-find-root' does:
> 
>   (while (not (file-directory-p file))
>     (setq file (file-name-directory (directory-file-name file))))
> 
> which assumes that the output of `file-name-directory' will be
> different in each iteration of the while loop. That is not so when the
> drive does not exist, for example:
> 
>   (file-name-directory (directory-file-name "g:/")) => "g:/"

So how about changing the loop condition to

  (while (and (not (file-directory-p file)) (file-exists-p file))

?




reply via email to

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