emacs-devel
[Top][All Lists]

Re: [PATCH] Win32 Cywin/dos TAB completion support

 From: Eli Zaretskii Subject: Re: [PATCH] Win32 Cywin/dos TAB completion support Date: Fri, 01 Feb 2002 10:56:47 +0200

> From: Jason Rumney <address@hidden>
> Date: 31 Jan 2002 22:19:21 +0000
>
> I don't really understand the comint code, so I don't think I'm the
> right person to check this over thoroughly.

My greatest concern is about the completion stuff, which this patch
tries to fix.  AFAICS, the code scans the text the user typed
backwards from the end, trying to figure out whether it's a quoted
string, and if so, where did it start (since a quoted string can
include whitespace).

That is, if you typed

c:\foo\bar> frobnicate 'd:/Program Files/foo_

and _' is the place of the cursor, the code scans backwards trying
to find the opening quote character.

But it seems to me that scanning backwards makes this problem
insoluble in principle, due to the escaping issue (i.e. if there's an
embedded quote escaped by a backslash).

It's possible that I misread the code, in which case I apologize.
However, I'd like to ask people who have the right tools installed
(NTEmacs and the Cygwin port of Bash) to please apply this patch, and
try the completion, especially in the presence of quoted command-line
arguments.

> > !    (cygwin-p (and (memq system-type '(windows-nt ms-dos))
> > !                   (w32-cygwin-path-p filename)))
>
> I don't think the DOS port supports the Cygwin shell.

The DOS port supports the Cygwin shell, but it doesn't support comint
(no async subprocesses).  So testing for ms-dos here is probably a
moot point.

> I think rather than defining a new non-standard function, it is better
> to make M-x shell DTRT when bash (or other unix-like shells) are used on
> Windows.

Yes, I agree.  All those w32-* functions and variables make it hard
to tell users a coherent story about how to set up their systems, and
they need to be documented separately in the manual.  I find that the
large number of w32-* symbols already makes the Windows port too
close to black magic ;-)

`