Wilfred / ag.el

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

Allows `files` argument to be parsed to `ag/search` #157

Closed vitorqb closed 5 years ago

vitorqb commented 5 years ago

Gives ag/search an optional files parameter. If parsed, give this list of files to ag instad of the current directory (".").

I find this usefull because I use org-journal, and now I can do something like this to search with ag between two dates, for example 2019-15-5->2019-05-31:

(let* ((start (org-journal-calendar-date->time '(5 15 2019)))
       (end   (org-journal-calendar-date->time '(5 31 2019)))
       (files (sort (org-journal-search-build-file-list start end) #'string<)))
  (ag/search "foo" "~/Documents/journal" :files files))
coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 18.773% when pulling 609d047840bb2bf4327d8d0d4024c94dd032be38 on vitorqb:allow-file-list-on-ag-search into 77b4f50c5372bf219da496567b2b867261f0d354 on Wilfred:master.

Wilfred commented 5 years ago

I don't mind adding an extra keyword parameter to ag/search, but why have you added an extra -H argument to ag?

vitorqb commented 5 years ago

Sorry, my mistake. For some reason i thought it would only working with the -H flag, but I did some tests now and I think I was wrong.

Wilfred commented 5 years ago

Thanks :)