ag.el icon indicating copy to clipboard operation
ag.el copied to clipboard

Recent update to output format seems to have broken wgrep

Open cpitclaudel opened this issue 8 years ago • 8 comments

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:

  • package-installof ag and wgrep
  • ag with some search text
  • wgrep-change-to-wgrep-mode in results buffer
  • Edit one results line
  • C-x C-s yields (No changes to be performed)

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

cpitclaudel avatar Jul 10 '16 01:07 cpitclaudel

I set ag-group-matches to nil.

M-x customize-variable RET ag-group-matches RET

koshigoe avatar Jul 19 '16 08:07 koshigoe

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

cpitclaudel avatar Jul 20 '16 01:07 cpitclaudel

@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.

jasonm23 avatar Aug 04 '16 07:08 jasonm23

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.

wbolster avatar Aug 08 '16 12:08 wbolster

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.

jasonm23 avatar Aug 08 '16 13:08 jasonm23

@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.

cpitclaudel avatar Aug 08 '16 15:08 cpitclaudel

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 avatar Oct 10 '16 17:10 kaushalmodi

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

kaushalmodi avatar May 27 '17 03:05 kaushalmodi