With the session created we can now add search criteria. Let’s add a
prior now. Suppose we are interested in understanding better how
lists are implemented in Emacs. We can query for the term “list” by
first pressing P (p-search-add-prior
) and then q
(for “text query”). You will now be prompted for a query term.
Enter “list” and press RET. Press c to create the
prior. The options which can be entered will be explained in a future
section.
Queries in p-search are not like the text passed into a tool like grep
. p-search will break apart what you enter here and perform different searches for each query part. See Text Query Syntax for more details on the query mechanism.
With the query created, your should see a new item under ‘Priors
(1)’ indicating your new query. The ‘text query’ prior will have
the text “loading” next to it as the command runs in the background.
If you are using grep
and don’t have ripgrep (rg
)
installed, this search on a directory as large as Emacs can take
around a minute to complete.
After the commands complete, the “loading” text will go away and the items in ‘Search Results’ should update. The results are now as follows, along with my impressions on the search results:
So the results I got back were related to lists but this isn’t what I wanted. Let’s refine our search now.