从Windows上的Emacs中的“grep-find”运行时,ack不起作用
发布时间:2020-12-14 04:01:39 所属栏目:Windows 来源:网络整理
导读:我正在尝试使用 ack-grep作为Windows上Emacs中grep查找的替代品,但是ack-grep立即(成功)退出而不打印任何匹配项.我已经尝试了几乎所有可能的命令行参数组合到ack-grep,但似乎没有任何效果. M-x grep-find 输入“ack html”以搜索包含“html”的文件. Ack立刻
我正在尝试使用
ack-grep作为Windows上Emacs中grep查找的替代品,但是ack-grep立即(成功)退出而不打印任何匹配项.我已经尝试了几乎所有可能的命令行参数组合到ack-grep,但似乎没有任何效果.
M-x grep-find 输入“ack html”以搜索包含“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”工作正常(显示包含字符串“html”的许多各种文件). 有任何想法吗? 解决方法
当在Windows下的Emacs下运行ack时,我发现它有时会混淆它是应该搜索文件还是从STDIN读取.这是我用来调用ack的函数(使用M-x 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))) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 如何将Electron应用程序部署为可执行文件或在Windows中安装
- windows-phone-7 – 如何在模拟器中没有Internet连接条件下
- windows – Conficker:组策略中采取的措施是否应该保护病毒
- Windows 7:将TCP套接字嗅到localhost
- 需要在Windows上将应用程序带到前台
- 在WIN32中的“BUTTON”类窗口上显示位图
- Windows PATH到bos中的posix路径转换
- windows-services – 使用WiX(2.0)安装多文件NT服务
- 如何将Window从另一个应用程序嵌入到WPF窗口中作为用户控件
- windows-explorer – 如何阻止explorer.exe保持文件打开状态
推荐文章
站长推荐
热点阅读