Dmitry Gutov writes: > On 14.02.2022 15:57, Philip Kaludercic wrote: >>> And use a simpler test: (only when the host is remote) write some text >>> to a file in the temp dir, then search through it. Only doing it once, >>> of course, when the connection-local value is initialized. >> I am afraid I don't understand what you mean here, specifically "some >> text". >> > > Well, we need some file to search and some knowledge about its > contents in advance (so the search can succeed). I guess this is what confuses me, what about the contents is relevant to the query? `xref-matches-in-files' is already passed a list of files that can be concatenated into the input for xargs. The current version already works and is reasonably fast, so I don't recognise the improvement. > Since we don't know anything about the remote system, we probably have > to create the file ourselves. Put something like "aaa\nbbb\nccc" in > it, and then search for "bbb". My apologies, I feel stupid for not understanding, but what would aaa, bbb and ccc be? --- Here also the updated version of the patch: