我已经下载并安装了 GnuWin32 工具,并将 grep 可执行文件添加到 Emacs bin。我还为它的值(value)添加了 GnuWin32 bin 文件夹到我的 Path 变量。
问题是,当我尝试使用建议的 grep 命令运行时,我总是得到:
Grep exited abnormally with code 53 at Wed Feb 24 17:16:12
在我的一生中,我在任何地方都找不到对错误代码 53 的任何引用! :(
例如,当我输入:
M-x grep <ret>
它提出了
Run grep (like this): grep -n
这很好,但我不知道它期望什么参数。我在一些教程中尝试了一些,但我再次收到错误代码 53!
我尝试过的其中一件事是直接来自 emacs wiki( http://www.emacswiki.org/emacs/GrepMode#toc2 )(虽然可能不适用于 Windows 版本?),它说要尝试以下命令:
M-x grep -n -e setq ~/.emacs
我试过,我得到:
-*- mode: grep; default-directory: "c:/[My Directory]/" -*-
Grep started at Wed Feb 24 17:30:47
grep -n -e setq ~/.emacs NUL
Grep exited abnormally with code 53 at Wed Feb 24 17:30:47
太令人沮丧了,因为这是 Emacs 的一个强大功能,我真的很想学习它,因为我听说过关于它的好消息!
任何帮助,将不胜感激! :)
安迪
更新
根据下面的建议,我已经通过命令行尝试过它,它似乎工作正常,也许我缺少一些配置?
更新
我发现命令 M-x Occur 似乎与我对图像 grep 所做的一样。如果我不能让它工作,使用 grep over 是否有很多额外的好处?
最佳答案
下载 dependencies zip file并复制 libiconv2.dll
, libintl3.dll
, pcre3.dll
和 regex2.dll
到 Emacs 的 bin
目录。
Copy
grep.exe
andfind.exe
to Emacs' ownbin
directory. Emacs will then use these files over any other executables with the same name, including Windows' ownfind
utility.Note: if you don't use the installer, you need to download the dependencies zip file as well and copy
libiconv2.dll
,libintl3.dll
,pcre3.dll
andregex2.dll
to Emacs'bin
directory, otherwise you may get an "exited abnormally with code 53" error message.
EmacsWiki: Grep Mode
关于emacs - 使用 Emacs (windows) 和 GnuWin32 Grep 失败的 Grep,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2328079/