[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find-directory-p always returns nil in locate-mode on windows xp
From: |
Peter Breton |
Subject: |
Re: find-directory-p always returns nil in locate-mode on windows xp |
Date: |
Fri, 21 May 2004 12:48:59 -0700 (PDT) |
I'm fine with having the default directory be "c:/" on
Windows if that makes life easier.
Peter
> convert-standard-filename will leave "/"
> unaltered, since it's a
> valid file name on MS-Windows filesystems.
>
> My guess is that the problem is that locate.el
> uses "/" without a
> drive letter. I vaguely remember that it was
> hard to find a correct
> behavior for expand-file-name when its second
> argument is "/", so
> perhaps this bug is some side effect of what was
> decided long ago to
> do in such cases.
>
> Jason suggested (expand-file-name "/"). I _guess_
> from your comments
> above that this does not work either. I do not have
> access to a
> computer running anything else but GNU/Linux or
> Solaris, so I can not
> check. I guess that "what was decided long ago"
> refers to:
>
> if (! STRINGP (default_directory))
> {
> #ifdef DOS_NT
> /* "/" is not considered a root directory on
> DOS_NT, so using "/"
> here causes an infinite recursion in, e.g.,
> the following:
>
> (let (default-directory)
> (expand-file-name "a"))
>
> To avoid this, we set default_directory to the
> root of the
> current drive. */
> extern char *emacs_root_dir (void);
>
> default_directory = build_string
> (emacs_root_dir ());
> #else
> default_directory = build_string ("/");
> #endif
> }
>
> Again, I don't think Emacs on Windows should have
> any buffer whose
> default-directory is "/".
>
> Yes, but I suppose you read the comment below, which
> Jason already
> referred to. I am cc-ing Peter Breton, the author
> of locate.el.
>
> ;; Define a mode for locate
> ;; Default directory is set to "/" so that dired
> commands, which
> ;; expect to be in a tree, will work properly
> (defun locate-mode ()
> "Major mode for the `*Locate*' buffer made by
> \\[locate].
> In that buffer, you can use almost all the usual
> dired bindings.
> \\[locate-find-directory] visits the directory of
> the file on the current line.
>
> \\{locate-mode-map}"
> (kill-all-local-variables)
> ;; Avoid clobbering this variables
> (make-local-variable 'dired-subdir-alist)
> (use-local-map locate-mode-map)
> (setq major-mode 'locate-mode
> mode-name "Locate"
> default-directory "/")
>
__________________________________
Do you Yahoo!?
Yahoo! Domains Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer
- find-directory-p always returns nil in locate-mode on windows xp, Peter Lee, 2004/05/19
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/20
- Re: find-directory-p always returns nil in locate-mode on windows xp, Peter Lee, 2004/05/20
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/20
- Re: find-directory-p always returns nil in locate-mode on windows xp, Luc Teirlinck, 2004/05/20
- Re: find-directory-p always returns nil in locate-mode on windows xp, Peter Lee, 2004/05/20
- Re: find-directory-p always returns nil in locate-mode on windows xp, Luc Teirlinck, 2004/05/20
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/21
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/21
- Re: find-directory-p always returns nil in locate-mode on windows xp, Luc Teirlinck, 2004/05/21
- Re: find-directory-p always returns nil in locate-mode on windows xp,
Peter Breton <=
- Re: find-directory-p always returns nil in locate-mode on windows xp, Jason Rumney, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Peter Breton, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Peter Breton, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Luc Teirlinck, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Luc Teirlinck, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Luc Teirlinck, 2004/05/23
- Re: find-directory-p always returns nil in locate-mode on windows xp, Eli Zaretskii, 2004/05/23