emacs - 使用 Emacs (windows) 和 GnuWin32 Grep 失败的 Grep

标签 emacs grep search

我已经下载并安装了 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.dllregex2.dll到 Emacs 的 bin目录。

Copy grep.exe and find.exe to Emacs' own bin directory. Emacs will then use these files over any other executables with the same name, including Windows' own find 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 and regex2.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/

相关文章:

linux - 检查屏幕 session 是否正在运行并通过 cron 自动执行

regex - 使用 grep 从键值对列表中提取值

regex - Unix 查找通配符目录结构

emacs - 如何在跳过 .svn 目录的同时递归搜索 emacs 中的文件

emacs - 仅在 GUI 模式下运行某些 Emacs init 命令

Emacs:以 shell 脚本模式执行代码

c# - 最有效(阅读时间)的字符串搜索方法是什么? (C#)

python - emacs python jedi错误

java - 搜索和排序时使用什么集合

PHP 查询生成器/报告器