* lisp/progmodes/grep.el (rgrep-default-command):
Extract from `rgrep'.
* lisp/progmodes/xref.el (xref-collect-references): Split from
`xref-collect-matches'. Only handle the case of symbol search.
(xref-collect-matches): Instead of Semantic Symref, use
`rgrep-default-command', to take advantage of its directory and
file ignore settings.
(xref--collect-match): Remove the last argument, leaving the
regexp construction up to the caller.
* lisp/progmodes/elisp-mode.el (elisp--xref-find-matches):
Change to take the xref-collect- function to use as an argument.
(elisp-xref-find): Update accordingly.