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

Unable to pass additional args to ag when invoking using prefix (C-u) key-stoke #38

Closed
evanspa opened this issue Feb 26, 2014 · 2 comments

Comments

@evanspa
Copy link

evanspa commented Feb 26, 2014

Hello,

I just installed your excellent "ag.el" package into my Emacs-24 installation (I used MELPA). I'm trying to pass a prefix argument so that ag is invoked with more arguments. Specifically, I want ag to only search XML files. So here's what I do: C-u M-x ag-project, then I hit , and in the mini-buffer I'm prompted for a search string, which I input, and then, (because I launched ag-project with "C-u"), the mini-buffer shows: Arg arguments ("--smart-case" "--nogroup" "--column" "--") and the cursor is sitting immediately right of the closing-paren. I just don't know what to type here. I tried a few things like "-G xml" (I tried both including and not including the double-quotes) and "--file-search-regex xml" but every time it seems what I've entered is ignored. In the ag results buffers, where it displays the actual full ag command-line that was executed, There is no sign of the "-G" or "--file-search-regex" argument that I wanted added.

Thank you,

-Paul

@Wilfred
Copy link
Owner

Wilfred commented Mar 3, 2014

Hmm, sorry about this. This is new functionality and feedback like this is very helpful.

The immediate answer to your question is to just add items to list. So, edit the list to ("--smart-case" "--nogroup" "--column" "-G" "xml" "--") and you should get the result you want.

This functionality was added for #36. I think we should make the following changes:

  1. Give the user plain text (e.g. --smart-case --nogroup --column --) instead of a list. Using a list is an internal detail that the user shouldn't care about.
  2. Allow the user to modify the arguments after we've built the full command. Currently, we append things like --color afterwards. Editing the full command would make this functionality more general and more useful.

@evanspa
Copy link
Author

evanspa commented Mar 3, 2014

Ahhh - I see how it's supposed to work now :) Yup, just tried it and it worked. Yeah, I think this was just a usability thing. I agree with your solution of removing the parens and making it be just plain text. Thank you!

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