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

From: Dmitry Gutov <[email-masked]>
Date: Tue, 22 Feb 2022 01:14:08 +0200

On 22.02.2022 01:00, Sean Whitton wrote:
> I think I prefer my with-temp-buffer thing to this, to be honest --
> adding a timer into the mix seems like it might make debugging harder.
> 
> Assuming you're still okay with my initial idea, I'll come up with a
> patch to do it with a macro, and apply it across project.el.

I liked the simplicity of the with-temp-buffer solution, but it doesn't 
solve the conceptual problem: that any code trying to let-bind 
default-directory around the call for xref-show-xrefs will have 
rediscover and solve this problem (or, more likely, live with it for a 
few years until somebody notices).

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).