help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Converting cygwin path to windows path


From: Stephen Leake
Subject: Re: [h-e-w] Converting cygwin path to windows path
Date: 13 Feb 2002 15:22:30 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Jim Davidson <address@hidden> writes:

> Stephen Leake <address@hidden> writes:
>  
> > Jim Davidson <address@hidden> writes:
> > 
> > > Joe Riel address@hidden writes:
> > > 
> > > > How do I convert a cygwin path (with forward slashes)
> > > > to the equivalent windows/dos path (with backslashes)?
> > > 
> > > Doesn't convert-standard-filename do what you want?
> > > 
> > > It was written for situations like this.
> > 
> > Seems like it should, but in Emacs 20.7, I get :
> > 
> > (convert-standard-filename "c:/foo/bar")
> > "c:/foo/bar"
> > 
> > Since most Win32 stuff accepts "/" as a directory separator (one
> > notable exception is the DOS shell), this seems mostly ok.
> 
> ??  It works me, after starting Emacs 20.7 with -q:
> 
> (convert-standard-filename "c:/foo/bar")
> "c:\\foo\\bar"
> 
> Do you have some custom settings?

Arrg. I was tempted to test with -q, but didn't. Investigating the
source in w32-fns.el, I find that convert-standard-filename calls
w32-shell-dos-semantics to check whether to convert from canonical to
DOS slashes. That, in turn, checks the value of w32-shell-name, which
I seem to have set to "c:/bin/sh" (via explicit-shell-file-name), so
it keeps Unix slashes.

This seems bogus to me. The name 'convert-standard-filename' does not
imply "convert to the syntax needed by the shell I happen to be
using"; it says _standard_! Of course, it is probably called in lots
of places that are building commands for a "standard shell". I think I
bound explicit-shell-file-name precisely because
"convert-standard-filename" was _not_ called in enough places. Catch
22!

-- 
-- Stephe




reply via email to

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