I wanted to run a query-replace-regexp across multiple files in emacs, and found this post explaining how to do it. When I tried following the directions, I got an error after entering the file wildcard.
find . \( -iname \*.vb \) -exec ls -ld \{\} \;
Unknown option "-iname"
Unfortunately, the find I’m using is from MKS Toolkit on Windows, and it doesn’t support the -iname option. I tried replacing all occurences of “iname” with “name” in my emacs lisp files, and then byte-compiling and restarting emacs. This did not solve the problem and I got exactly the same error as before. After a bit more digging, I found another command find-dired that lets you customize the find command used, so I’ve already done the search and replace with this workaround.
My question is this: Why am I still getting the -iname error, even after editing my source files, re-byte-compiling them, and restarting emacs? I’d like to find a more permanent solution for future search-and-replace across multiple files (and to satisfy my curiosity).
Change the variable
find-name-arg. Run M-x customize-group find-dired, or just put(setq find-name-arg "-name")in your.emacs.In my version of emacs, the initial value comes from
find-dired.el. Did you change and recompile that file?