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

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

RE: shell-command causes problems with absolute/relative paths in TAGS


From: David Chappaz
Subject: RE: shell-command causes problems with absolute/relative paths in TAGS
Date: Fri, 6 Jan 2012 16:03:47 -0000

> > The variable name depends on which shell you use. By default, only
> > explicit-bash-args and explicit-sh-args are defined in emacs.
> > On windows, cmdproxy.exe is the default shell, hence the variable name.
> 
> Well, I tried that on Windows with cmdproxy as the shell, and I still
> don't see this variable.

Ah well I haven't been accurate enough.
It's for the user to create this variable if they want to. It will only be
used if its name perfectly matches that of the shell.
See details in section 7.10 of
http://www.gnu.org/software/emacs/windows/Sub_002dprocesses.html

 
> > 2/ Now from e.g. a scratch buffer, I evaluate
> >
> > (progn
> >    (cd "C:/test/")
> >    (call-process-region (point) (point) "C:/Program
> > Files/Emacs/emacs-23.3/bin/cmdproxy.exe" nil (current-buffer) nil "-c"
> > "ctags -e -L filelist.txt"))
> >
> > which is more or less what M-x shell-command would do... then the result
> is
> > incorrect.
> 
> Yes, I see the problem.

That's a start, I'm not the only one any more :-)

 
> > 3/ Worse, if you kill the original shell buffer created in 1/, and
> repeat
> > the same operation as in 1/... then the result is incorrect.
> >
> > So it really looks like something is happening in call-process-region...
> 
> It must be a bug in ctags, no matter what call-process-region does.  I
> suspect that it doesn't correctly handle the backslash in file names,
> and fails to realize that C:\foo\bar\baz.c and C:/foo/bar share the
> same directory.  That's because the "absolute" file names it produces
> are of the form "C:\foo\bar\./file", note the mixture of forward- and
> back-slashes.

Yes, what you're saying makes perfect sense. The mixture of slashes is
indeed an indication, but what I can't explain, is why ctags would produce a
different result before and after call-process-region is called (steps 1/
and 3/ respectively)

Surely emacs must be passing slightly different arguments to ctags (perhaps
slashes in a different orientation), before and after the first call to
call-process-region ?





reply via email to

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