Add ability to specify a set of extra directories to search #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add the
deadgrep-extra-searched-directoriesuser-option.By default
deadgrep-extra-searched-directoriesis nil, and deadgrep continues to behave as before.If
deadgrep-extra-searched-directoriesholds something and inside there's a key that is equal to the default-directory, then the ripgrep command line is set to search the directory/ies identified in the list associated with the alist element value.If the default-directory does not match any identified directory context (or is one of the sub-directory of an identified directory context), deadgrep uses "." as before and ends up behaving as before.
This provides the ability to set up a list of directory contexts to pre-define the directories that are effectively searched by deadgrep. The real advantage is that this list can contain a set of non-overlapping directories to search (and the original directory if that's needed), something like /etc and /usr for example.
It works with Tramp syntax as well, as long as the user reads the description in the customization buffer when entering the paths of the extra directories.
This is one way of addressing #162
@Wilfred I think what is inside the commits of this PR is complete. I have been using it and all works fine.
The code added in inside
deadgrep--argumentswhich deals with possible entries indeadgrep-extra-searched-directoriesuser-option`.