GNU bug report logs -
#8653
24.0.50; `M-x grep' output converts `~' to /cygdrive/c/...
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Wed, 11 May 2011 15:34:02 UTC
Severity: wishlist
Tags: notabug
Found in version 24.0.50
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> > M-x grep foo ~/mydir/f*.el
> > results in this kind of output in buffer *grep*:
>
> > /cygdrive/c/mydir/foobar.el:203: blah blah foo blah
>
> Let me add to Eli's answer [tho, as someone whose experience with
> Windows only goes as far as "install firefox&putty to access
> non-Windows
> machines"]: IIUC the expansion of ~ (to something like "C:/...") is
> performed by the shell used to run grep, and the conversion to
> "/cygdrive/c/..." is performed by the particular grep you use
> (presumably cygwin's).
>
> So to fix the problem at hand we need:
> - add something like cygwin-mount.el to Emacs.
> - change grep.el to use abbreviate-file-name.
>
> Contrary to Eli, I'm not fundamentally opposed to including something
> like cygwin-mount.el in Emacs. As for changing grep.el, it could be
> a valid option, tho it would either have to be a non-default
> setting, or
> be done carefully to minimize the performance impact (M-x grep is
> already slowish).
>
> Of course, another take on it is to change the problem: maybe we could
> make it easier to run an equivalent command with relative file names.
> Not knowing how/why you ended up with "M-x grep foo ~/mydir/f*.el",
> I don't know what could make it easier.
Everything you suggest (possibilities) sounds good to me.
Yes, if you use a relative path there is no such problem - e.g.,
M-x grep ../f*.el
I was in a directory far from the intended target. I could have first done `M-x
cd', and that's a good workaround. But I just gave the path to `grep' instead.
No biggee, but it would be good if the output were cleaner/simpler (assuming not
too great a cost).
This bug report was last modified 8 years and 60 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.