Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ag adds "File: " before each match which breaks compile-goto-error #122

Open
sagittarian opened this issue Aug 14, 2016 · 4 comments
Open

Comments

@sagittarian
Copy link

Each match starts with "File: ", and compile-goto-error interprets that as part of the file name, so it can't find the file. I found where it does that in ag-filter, removed it and recompiled ag.el, and now it the result buffer works for me.

On my machine, the output of ag --version is: ag version 0.31.0

My Emacs version is: GNU Emacs 24.5.1

I'm using: Ubuntu 16.04

@michaelbartnett
Copy link

The ag-group-matches custom is what causes this behavior. Toggling if off restored next-error / previous-error functionality for me.

@stardiviner
Copy link

I have same issue, I think it is not related to ag-group-matches. It should improve it.

@joedicastro
Copy link

joedicastro commented Nov 10, 2016

I had the same issue, and setting ag-group-matches to nil as @michaelbartnett suggested worked fine for me.

@LefterisJP
Copy link

I actually ended up removing the "File: " from the corresponding line in my local copy

ag.el/ag.el

Lines 647 to 650 in d00aa65

(while (re-search-forward "\033\\[1;32m\\(.*\\)\033\\[0m\033\\[K" end 1)
(replace-match
(concat "File: " (propertize (match-string 1) 'face nil 'font-lock-face
'compilation-info))

But then I realized it's conditional to ag-group-matches so yes indeed setting it to nil works.

But this leads me to question this behaviour of the tool. Why is grouping same-file results under one file name more important to jumping to the result's location? @Wilfred ?

It would be nice if the compilation buffer could succesfully jump to the file even if "File: " is prepended to the start of the line. There probably is a way to achieve this but my emacs-lisp foo is not good enough.

dunn added a commit to dunn/mb-dotfiles that referenced this issue Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants