Drew
Drew

Reputation: 4691

Find: Parameter format not correct

I keep hearing this is a path issue with cygwin. It is prevent emacs from working within my cygwin. When I execute find on the cli (not bash/cygwin) I get the same error not matter what I type. I've read this is a problem with path creation within cygwin and that it should be prepending itself to the path. As you can see it is doing that.

Here is my /etc/profile

PATH=/usr/local/bin:/usr/bin:/bin:$PATH
export PATH

Upvotes: 9

Views: 22667

Answers (4)

nv2p
nv2p

Reputation: 1

Adding a setq find-program [msys2 or git path] in my init file, as suggested (I tried different forms), didn't work for me. "C:\Windows\System32\find.exe" is first in the path if I type where find in eshell and I didn't find how to remove it, only how to add others, which doesn't solve the problem.

So I share here the more radical, but working (also in Powershell), solution I used: replacing the find.exe in "C:\Windows\System32" with the one from "C:\msys64\usr\bin". I kept the old file in case, but so far so good. You need to change the permissions for this operation (see here how to gain full control, but I suggest only applying this to the file, not the whole folder, and putting things back after ;)).

Upvotes: 0

Drew
Drew

Reputation: 4691

Problem is that as everyone else stated, emacs is using find.exe provided by windows. To change this, you need to change your %userprofile%.emacs file.

As nobody else states (even faq!), this file is not created automatically anymore. Go into Options > Save options the mini-buffer (one line at the bottom of emacs) will tell you where the file is being written to.

Go in there and add this line (You've installed cygwin at c:\cygwin, right?):

(setq find-program "C:\\cygwin\\bin\\find.exe")

You may need to restart Emacs for this to take effect.

Upvotes: 9

Sam
Sam

Reputation: 414

Just add this line to you .profile

alias find='/cygdrive/c/cygwin/bin/find.exe'

Upvotes: 9

Erik Knowles
Erik Knowles

Reputation: 1007

Oddly-enough, I needed to use

(setq find-program "/bin/find.exe")

instead.

But thanks for the suggestion Drew.

Upvotes: 1

Related Questions