Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
525 stars 61 forks source link

ag-dired can't work on win7 32bit #87

Closed zijianyue closed 6 years ago

zijianyue commented 9 years ago

I ag-dired tm_in.h in a directory ,but I got the error as below(I use msys environment, emacs 24.5):

ag --nocolor -g 'tm_in.h' "a directory" | grep -v '^$' | sed s/\'/\\'/ | xargs -I '{}' ls -alh '{}' & sed: -e expression #1, char 8: unterminated `s' command

ag finished at Tue Apr 28 14:35:44

PythonNut commented 9 years ago

I'm pretty sure this has to do with the way quoting works on Windows machines.

See the following:

C:\> echo a
a
C:\> echo 'a'
a
C:\> echo \'a\'
a
C:\> REM yes, Windows is insane and uses ^ to escape.
C:\> echo ^'a^'
'a'

this is the line that the problem originates from. You might fix it just by branching on the value of system-type.

zijianyue commented 9 years ago

Thanks, but I'm still not very clear how to fix this .You mean error exist in this command : " | grep -v '^$' | sed s/\'/\\\'/ | xargs -I '{}' ls " How to write it on windows, please give a demonstrate.

PythonNut commented 9 years ago

This is a bug in the package itself. The author should decide what to do with it. I don't have Emacs on Windows, so I can't make a PR, unfortunately.

Wilfred commented 9 years ago

I'm afraid I don't have a Windows environment to test this on, right now. Pull requests are certainly welcome in the mean time.