Wilfred / ag.el

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

Recent update to output format seems to have broken wgrep #119

Open cpitclaudel opened 8 years ago

cpitclaudel commented 8 years ago

Recently (days/weeks?) ago, the listing format changed from a grep-like filename-on-every-line format to a grouped listing. THis seems to have broken wgrep editing of results.

Repro:

Expected: C-x C-s saves the changes to the corresponding files (which works find with rgrep and used to work fine with ag).

Thanks for the awesome package, btw!

$ ag --version
ag version 0.32.0
In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2016-06-26 built on clem-w50-mint
Repository revision: 431437b6593320dc5a7a8aac9c911c778a656117
Windowing system distributor 'The X.Org Foundation', version 11.0.11501000
System Description: Linux Mint 17.3 Rosa
koshigoe commented 8 years ago

I set ag-group-matches to nil.

M-x customize-variable RET ag-group-matches RET
cpitclaudel commented 8 years ago

That's a neat workaround, thanks! But still, it's be nice to be able to use the grouping.

jasonm23 commented 8 years ago

@Wilfred - Please consider rolling back the format/grouping change until things don't break, With wgrep and next error both borked. Obviously there's a workaround, but I don't think any of your hardcore users are bothered by the grouping, and TBH it just wastes space.

wbolster commented 8 years ago

the new grouped format is actually awesome and improved my ag.el experience in a very significant positive way.

i argue it does not waste space at all. actually it saves a lot of space, allowing me to actually see the filename and match data, which i could not before for deep source directory trees, since the file name part on each line already used up the vertical space. with the new format, the match lines show

some/very/long/path/to/file.ext
line:col: actual code is here
line:col: more code

this is much better than

some/very/long/path/to/file.ext:line:col: actual code is here
some/very/long/path/to/file.ext:line:col: more code

less repetition, easier to look at.

jasonm23 commented 8 years ago

The real issue is tool breakage. Putting "actually awesome" changes in for aesthetic pleasantness is great and all, but breaking workflow is bad.

Unless working compatibility is achieved defaults should not be altered.

cpitclaudel commented 8 years ago

@wbolster I'm not sure a bug report about interaction with wgrep is the right place to discuss the aesthetics of this :) I don't have strong feelings about grouping vs. no grouping, but the change broke a significant part of ag.el for me.

kaushalmodi commented 7 years ago

Hmm, I came across this issue just today! Turns out I didn't need to use wgrep for quite many months! :)

@koshigoe's workaround works for me too.

kaushalmodi commented 7 years ago

Someone on reddit today was confused with how all search results are prefixed with File: because ag-group-matches defaults to t.

My suggestion would be to set ag-group-matches to nil, and add --group to ag-arguments by default.

Update: Turns out someone has already posted this issue: https://github.com/Wilfred/ag.el/issues/122, and https://github.com/Wilfred/ag.el/issues/120