* lisp/progmodes/project.el (project-ignores): New generic
function, and an implementation for the VC project type.
* lisp/progmodes/xref.el (xref--rgrep-command): Split, as a
variant of rgrep-default-command that handles a generic list of
ignores.
(xref-collect-matches): Use it, and pass through to it the value
of the newly added argument.
(xref-find-regexp): Handle ignored paths within the project.
Remove outdated comment.
* lisp/vc/vc.el (vc-default-ignore-completion-table):
Skip the comments and the empty lines.