ack-el icon indicating copy to clipboard operation
ack-el copied to clipboard

ack 1.1.0: `ack-quickgrep-defaults` is a less useful default IMO

Open eeide opened this issue 4 years ago • 4 comments

Commit b2c449c made ack-quickgrep-defaults the default value for ack-defaults-function.

In my day-to-day use, this is a less useful default than the legacy defaults. I often M-x ack from a Dired buffer, for example, and I never want to search for the filename at point.

Looking at the commit, I see how to restore the legacy default for myself—so I wouldn't normally complain at all, except that the commit message invited me to 😉.

Thank you for a very useful package!

eeide avatar Jul 17 '20 16:07 eeide

except that the commit message invited me to wink

:-) no problem.

I took this from @leoliu a year or so ago, and have no clear idea of who its users are. Also the only way to have feedback on such a thing, is to change the default and invite complaints. Let's leave this issue open and see if more people manifest themselves. I know 3 people who like the new behaviour (includes me). So find 2 more buddies :-D.

In my day-to-day use, this is a less useful default than the legacy defaults. I often M-x ack from a Dired buffer, for example, and I never want to search for the filename at point.

Make sense. By the way, I ack a particular directory by typing C-u C-u M-x ack.

joaotavora avatar Jul 17 '20 16:07 joaotavora

I'm also a member of the legacy-defaults-were-the-best-defaults crew chartered by @eeide. Apart from Dired troubles, the new behavior is not fun if you're in an orgmode buffer with point on an asterisk, yielding an invalid regex error (I haven't typed anything yet, how can it be an error...). It's also not obvious why M-x ack drops you into a git grep command (Who invited git to this party?).

In the good old days you could M-x ack and search from pwd, or C-u M-x ack and search from the checkout root. Just you and ack, mano-a-mano. Now it's all weird.

The new auto-search-thing-at-point behavior could be handy if you opted into it from a separate binding, in which case it would be more of a shortcut to doing things the "long" way. But if it's a default, that distinction doesn't make sense and the result of invoking the package is more of a roll of the dice until you understand the underlying magic.

lovett avatar Jul 24 '20 00:07 lovett

Who invited git to this party?

You did by using it and calling ack somewhere a repo where you use it.

Apart from Dired troubles,

I could be convinced to change the behaviour in dired-mode, where indeed I agree this default doesn't make much sense.

behavior is not fun if you're in an orgmode buffer with point on an asterisk

I think this is a bug in Org mode, maybe thing at point shouldn't return anything in that particular situation Or maybe it's a bug in ack and the thing at point should be regexp quoted before it is inserted. Your problem would be solved either way.

The new auto-search-thing-at-point behavior could be handy if you opted into it from a separate binding,

That's an acceptable idea, if am ever convinced to change the default back.

until you understand the underlying magic.

Which, IMO isn't very surprising: if there is a thing at point, ack will look for it immediately, otherwise it won't look for the empty string, so it will drop you onto a prompt, and quickly report [no symbol at point]. But I agree that until you understand some basic things, everything is suprising, especially when you're used to something else.

joaotavora avatar Aug 16 '20 13:08 joaotavora

I like the new defaults a lot! :-) But personaly I think it does not matter much what the defaults are if there are clear (beginner friendly) instructions in the documentation (Readme) how to switch behaviour. Maybe one could also introduce a customisation (via customize) which search tool to use and also to always force the selected tool for people that do not like the automatic switching to e.g. git grep.

ssnnoo avatar Aug 25 '20 16:08 ssnnoo