简体   繁体   English

在 macos 下在 emacs 中使用 ag

[英]using ag in emacs under macos

I use project-root to setup root directory of the project as:我使用 project-root 将项目的根目录设置为:

(setq project-roots
       `(("Git Project"
          :root-contains-files (".gitignore"))))

Then I go into my git project directory (eg ~/.emacs.d), and press Mx ag-project-files and enter some search string.然后我进入我的 git 项目目录(例如 ~/.emacs.d),然后按Mx ag-project-files并输入一些搜索字符串。 It shows the files which contains the string.它显示包含字符串的文件。 But when I push enter key on top of the file (in order to jump into that file), it shows error message like:但是当我在文件顶部按下回车键(为了跳转到该文件)时,它会显示如下错误消息:

Find this error in (default File: lisp/ag.el): ~/.emacs.d/在(默认文件:lisp/ag.el)中找到这个错误:~/.emacs.d/

I don't know how this error come out?不知道这个错误是怎么产生的? It is all right when I use emacs in Linux, but no good in Mac.我在Linux下用emacs还行,但在Mac上不行。 Have you ever met this problem?你遇到过这个问题吗?

I ran into this same problem using projectile-ag.我使用 projectile-ag 遇到了同样的问题。 It turned out that setting the "--nogroup" parameter for ag was causing this break (but only on macOS).事实证明,为 ag 设置“--nogroup”参数会导致此中断(但仅在 macOS 上)。 To work around this I just set ag-arguments to not include the "--nogroup" param:为了解决这个问题,我只是将 ag-arguments 设置为不包含“--nogroup”参数:

(setq ag-arguments (list "--smart-case" "--column"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM