Subject: Re: bug#53626: 28.0.91; project-find-regexp (C-x p g) twice results in searching different projects

From: Dmitry Gutov <[email-masked]>
Date: Wed, 23 Feb 2022 03:45:34 +0200

On 23.02.2022 01:09, Sean Whitton wrote:
>> The timer-based solution is hacky, but it affects only one place (the
>> xref buffer and the variable in it), so it's easier to verify that it
>> has the intended effect, and no external callers will need to bother
>> with additional knowledge (hopefully, of course).
> Is there no chance of any concurrency issues with this, btw?

Probably not, or not currently: the fetching of the list of xrefs is 
synchronous, and in all cases (so far) (I think) does not depend on the 
value of default-directory. It only affects the subsequent interaction 
with the buffer (jumping to locations), so deferring the assignment of 
the value of dd seems fine.

FETCHER is also called in the current buffer (before the 
with-current-buffer form), so even depending on the dynamic value of 
default-directory should be fine. At least until we get to 
asynchronous/chunked fetchers someday, but that's a bigger challenge 
with its own major changes.