From: Eli Zaretskii <eliz@gnu.org>
To: "Juanma Barranquero" <lekktu@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: vc-find-root and nonexistent drives
Date: Sat, 16 Feb 2008 15:43:50 +0200 [thread overview]
Message-ID: <uk5l5kodl.fsf@gnu.org> (raw)
In-Reply-To: <f7ccd24b0802151952i3745b417nd1fb1d738a045fe6@mail.gmail.com> (lekktu@gmail.com)
> Date: Sat, 16 Feb 2008 04:52:35 +0100
> From: "Juanma Barranquero" <lekktu@gmail.com>
>
> 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))
?
next prev parent reply other threads:[~2008-02-16 13:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-16 3:52 vc-find-root and nonexistent drives Juanma Barranquero
2008-02-16 13:43 ` Eli Zaretskii [this message]
2008-02-16 18:12 ` Juanma Barranquero
2008-02-16 20:16 ` Stefan Monnier
2008-02-16 20:18 ` Juanma Barranquero
2008-02-16 14:29 ` Stefan Monnier
2008-02-16 18:09 ` Juanma Barranquero
2008-02-16 20:33 ` Stefan Monnier
2008-02-16 20:46 ` Juanma Barranquero
2008-02-17 4:18 ` Eli Zaretskii
2008-02-17 19:00 ` Stefan Monnier
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=uk5l5kodl.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=lekktu@gmail.com \
/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.