Subject: Re: bug#55016: 28.1; xref-find-references finds no matches if project dir contains a space

From: Eli Zaretskii <[email-masked]>
Date: Tue, 26 Apr 2022 15:00:33 +0300

> Date: Tue, 26 Apr 2022 05:05:18 +0300
> Cc: [email-masked], [email-masked], [email-masked]
> From: Dmitry Gutov <[email-masked]>
> 
> On 25.04.2022 14:48, Eli Zaretskii wrote:
> > Ah, okay.  But, after the changes you posted, which file names may
> > need unquoting, and why?  The whole point of the changes is not to use
> > any file names literally in the command line passed to the shell.  And
> > our low-level primitives that invoke the shell already know to unquote
> > file names, so this should "just work", no?
> 
> All right, seems so. The difference with local-dir in 
> xref-matches-in-directory, is that in that function the value did get 
> inserted into a shell command string.
> 
> At least it did before 71f8b55f46a. Now that it doesn't, I suppose it 
> doesn't need to unquote either. But then again, the previous version of 
> the code didn't do any "requoting" of the file names returned in the 
> Find+Grep output (if they are supposed to be requoted, that is).
> 
> Nor does xref-matches-in-files do any "requoting". And this function is 
> frequently-used, so any problems with that approach should have already 
> come up.

If we just show those file names in some window, they don't need to be
re-quoted, I think.  Quoting is only needed if the resulting file
names will be passed to Lisp APIs to act on them.