Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
525 stars 61 forks source link

'No Error Here' from results buffer #52

Closed webframp closed 10 years ago

webframp commented 10 years ago

using ag.el 0.43 installed from melpa, ag.exe 0.18.1, GNU Emacs 24.4.50.1 (x86_64-w64-mingw32), windows 7

seems like this was fixed many versions ago, but I can't seem to jump to the results. All I get is 'No Error here'

Possibly something I need to adjust in my config?

Wilfred commented 10 years ago

Your version of ag.exe is old -- 0.23 is the current version. It's possible you're being bit by this bug: https://github.com/ggreer/the_silver_searcher/issues/227.

Are you getting this error for all files, or just on one? If it's just one, would you be willing to paste it somewhere so I can try to reproduce?

webframp commented 10 years ago

I seem to get it for any search. I'll try upgrading ag.exe and let you know if that doesn't fix it.

swinkels commented 10 years ago

I have the same issue with ag 0.23 compiled on Cygwin, ag.el 0.43 installed from Melpa, Gnu Emacs 24.3.91.1 (i686-pc-mingw32), Windows 7.

When I look at the ag buffer in Emacs, it contains all matches with the line number stripped off. For example, the buffer shows this:

-*- mode: ag; default-directory: "~/repos/github.com/blabla-code/" -*-
Ag started at Sat Jul 12 08:42:42

ag --color --color-match 30\;43 --literal --smart-case --nogroup --column -- class .
adaptation_manager.py:34:    # Internal registry.

whereas ag on the command prompt shows this:

C:\Users\blabla>ag --color --literal --smart-case --nogroup --column -- class .
adaptation_manager.py:26:34:    # Internal registry
swinkels commented 10 years ago

The missing line number is also reported in https://github.com/Wilfred/ag.el/issues/26#issuecomment-29262394

swinkels commented 10 years ago

In another https://github.com/Wilfred/ag.el/issues/26#issuecomment-48827240 I described how I got it to work (so with the line numbers in the ag buffer):

After some investigation I found out that if you pass option --line-number to ag, the line number is displayed. This options prints the line number even if the input is a stream. I do not really know how ag and Emacs interact, but adding that option did the trick for me.

Wilfred commented 10 years ago

Thanks for investigating this, Windows support for ag.el is far less tested.

Sounds like ag on Windows is getting data passed in on stdin, and --line-number is the proper solution.

@webframp can you confirm that your output contains:

filename:123: foo bar

i.e. the line numbers are missing?

webframp commented 10 years ago

@Wilfred Sorry for the long delay in getting back.

Yes, that is what my output shows, here's an example for a search buffer:

"ag" "--nocolor" "--literal" "--smart-case" "--nogroup" "--column" "--" "IsInstanceOfType" "."
ProjectTemplate/ExportDefinitionPredicateVisitor.cs:23:                case "IsInstanceOfType":
nosami commented 10 years ago

@swinkels thanks for your solution. Works for me :+1:

Wilfred commented 10 years ago

This should now be fixed. Please let me know if it isn't.