Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some interface to search gziped files #36

Closed
Fuco1 opened this issue Feb 10, 2014 · 3 comments
Closed

Add some interface to search gziped files #36

Fuco1 opened this issue Feb 10, 2014 · 3 comments

Comments

@Fuco1
Copy link
Contributor

Fuco1 commented Feb 10, 2014

ag provides very useful switch -z that allows you to search in archives. For example, on many unix platforms emacs sources (and many other software) come gziped. Right now I can't use ag from emacs to search these.

I'm not sure how to handle this, maybe C-u could ask for additional flags? A global setting seems dangerous since user might have huge zip archives around.

@Wilfred
Copy link
Owner

Wilfred commented Feb 13, 2014

It would certainly be a useful feature, but I'm not sure how to handle it either. As a quick workaround, you could simply do (add-to-list 'ag-arguments "-z"), but this will affect all ag.el usage.

The number of ways ag.el can be used for searching is gradually growing, so the combinations possible is growing very quickly. We have:

  • Search term as plain text or PCRE pattern
  • Prompt for directory, or guess from the current directory and VCS
  • Search all files, or limit to files whose name matches a certain pattern

There are 8 possible combinations here, and we don't actually support all of them (for example, there's no ag-project-files-regexp). If we add another option we're up to 16 combinations.

So yes, our current UI isn't perfect. I think C-u allowing you to temporarily modify the arguments passed to ag would help in your case. I can't see any better solution, but I'm open to suggestions.

@Fuco1
Copy link
Contributor Author

Fuco1 commented Feb 13, 2014

Ideally it would be reflected in some variable, so I could make it directory local (e.g. in the emacs sources directory), but not elsewhere. I didn't know about ag-arguments, that should do nicely when I set it in the directory.

C-u optionally reading a value for that variable would be good interface I think, dired and dired-find work similarly.

@Wilfred
Copy link
Owner

Wilfred commented Feb 20, 2014

Sorry for the delay on this. I've fixed it. I've gone for using C-u to specify a value, since it's used in dired too. Let me know if you like it and/or if there's any way it could be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants