Wilfred / ag.el

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

Print total matches #63

Closed priyadarshan closed 9 years ago

priyadarshan commented 10 years ago

Would it be possible to add total matches found (possibly, in how many total files)? It could be in the *ag search* buffer, or, if it wouldn't be compatible with other packages (like wgrep), just a message in the minibuffer would be all right, something like 1071 matches across 363 files.

I find this feature quite useful, as it can give a quick ballpark idea if the search string was properly set, or not.

Thank you so much for ag.el, it is indispensable.

Wilfred commented 10 years ago

Agreed, this would be a nice feature. Ag itself has a --stats option, but that shows how many files searched instead of how many matched (the latter is more useful I think).

priyadarshan commented 10 years ago

I really wish I could help, perhaps submitting a patch to do that, but I am an absolute beginner in elisp. I can help testing it, though.

kaushalmodi commented 9 years ago

The --stats option prints a summary like below:

32 matches
9576 files searched
97088546 bytes searched
1.511894 seconds

You can enable that by adding the below to your emacs init file after (require 'ag).

(add-to-list 'ag-arguments "--stats") 
Wilfred commented 9 years ago

Aha, so --stats is now much more informative.

I'm going to add --stats to the default value of ag-arguments. v1.0 will make this prettier, but this is a definite improvement today.

priyadarshan commented 9 years ago

Thank you. Thanks for the good news about v1.0, too!