![]() In that case, add the following line in the dotemacs file. The custom-set-variable form should be placed as close to the beginning of the dotemacs as possible.įor some reason in my system, this is not enough, M-x grep will insist to use "grep -n" as its template rather than "grep -nH -e" and it always appends "NUL". ![]() Setting it to cmd means M-x grep will use the built-in Gnuwin32 grep (and cmd.exe as a shell) and if the setting is saved correctly, the dotemacs will contain lines like the following: (custom-set-variables I think the EmacsW32 user first need to set the user option w32shell-shell via the menu Options > Customize EmacsW32, which is set to none originally, and the user should set it to either cmd or cygwin. Note, windows has a utility called find and it is also in system %PATH%, that can make certain commands (like M-x grep-find) not work correctly, so it is important you put unix-find first in your %PATH%. You can do that either in command line by running cmd.exe and issuing a command set PATH= %PATH% or in some settings widow you get by right clicking a My Computer icon (called something like environment variables here are some pictures of it). After installing those, you need to add them to %PATH%, so that windows would know where to look for them. One irritating thing about eshell, hitting C-a at the prompt does not. ![]() Windows doesn't come with a grep utility (in fact it does have findstr, but it's not exactly the same), so you need to install something like cygwin or unix utils for windows. Instead of typing M-x grep you can type grep in Eshell and Emacs takes it from there. I should add, I arrived at this solution because putting qnuwin32 in front of the path in windows seems to be a risky proposition, you run the risk of messing up other programs on your machine. (setq cygwin-bin "c:\\apps\\cygwin\\bin") (when (string-equal system-type "windows-nt") Which hasn't been an issue so far, but If I was smarter with LISP I could probably figure something out. But those commands are not available on stock Windows 10 and I dont have install permissions. On linux, I simply type M-x grep-find and what I want to search for. One drawback is it blows away the rest of my path. Hello I am using GNU Emacs for Windows and I want to recursively search through a directory and its subdirectories for text within a file. I set to variables (cygwin-bin, gnu-bin) to the path where the programs are installed. I got this working the other day, you can set the PATH environment variable inside emacs, and if you have cygwin and/or gnuw32 installed just set the path to those. This article has some tips on how to get this working.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |