从Windows的Emacs中的“grep-find”运行时,ack不起作用

我正在尝试使用ack-grep作为Windows上Emacs的grep + find的替代品,但是ack-grep立即(成功)退出而不打印任何匹配。 我已经尝试了几乎所有可能的命令行参数组合到ack-grep,但似乎没有任何工作。

Mx grep-find 

input“ack html”search包含“html”的文件。 Ack立即退出,不打印任何内容:

 -*- mode: grep; default-directory: "c:/" -*- Grep started at Tue Feb 23 23:50:52 ack html Grep finished (matches found) at Tue Feb 23 23:50:52 

cmd.exe执行相同的命令“ack html”工作正常(显示大量包含string“html”的各种文件)。

有任何想法吗?

在Windows下的Emacs下运行ack时,我发现它有时会被搞糊涂,是应该搜索文件还是从STDIN读取。 这是我用来调用确认的函数(使用Mx ack )。 你可以把它放在.emacs

 (defvar ack-command "ack --nogroup --nocolor ") (defvar ack-history nil) (defvar ack-host-defaults-alist nil) (defun ack () "Like grep, but using ack-command as the default" (interactive) ; Make sure grep has been initialized (if (>= emacs-major-version 22) (require 'grep) (require 'compile)) ; Close STDIN to keep ack from going into filter mode (let ((null-device (format "< %s" null-device)) (grep-command ack-command) (grep-history ack-history) (grep-host-defaults-alist ack-host-defaults-alist)) (call-interactively 'grep) (setq ack-history grep-history ack-host-defaults-alist grep-host-defaults-alist))) 

(setq grep-find-command "ack <nul -i ")

我使用ack-and-a-half模块也有类似的问题,关闭STDIN也是这样做的。 github上有个问题: https : //github.com/jhelwig/ack-and-a-half/issues/23