GNU bug report logs -
#53626
28.0.91; project-find-regexp (C-x p g) twice results in searching different projects
Previous Next
Reported by: sbaugh <at> catern.com
Date: Sat, 29 Jan 2022 19:12:01 UTC
Severity: normal
Found in version 28.0.91
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi!
On 29.01.2022 21:11, sbaugh <at> catern.com wrote:
> An existing*xref* buffer doesn't have its default-directory changed
> when running project-find-regexp. Since project-find-regexp switches to
> *xref*, that means running project-find-regexp twice in a row may search
> two different projects, which is unexpected.
>
> Steps to reproduce:
>
> With buffers in two different projects as detected by project.el, do the
> following sequence:
>
> 1. Switch to a buffer in project A
>
> 2. project-find-regexp, which will search project A, and create and
> switch to an*xref* buffer with a default-directory pointing at the
> project root of A
>
> 3. project-find-regexp again, which will search project A again. (This
> is the desired behavior)
>
> 4. Switch to a buffer in project B
>
> 5. project-find-regexp, which will search project B and switch to the
> existing*xref* buffer (which is still pointing at project A)
>
> 6. project-find-regexp again, which will search project A instead of B.
>
> Suggested fix:
>
> Change project-find-regexp to reset the default-directory of the*xref*
> buffer used to the most recently used project root.
This sounds like something that was fixed in commit b99848c72cb2570c
(meaning, about a year ago).
I have tried to quickly reproduce this in my build from master, and
hadn't managed to.
How recent is Emacs that you're trying this in? Do you perhaps have an
older version of project.el or xref installed through ELPA?
Or did you maybe use project-switch-project, doing a search from its
menu, like Sean seems to be hinting?
This bug report was last modified 3 years and 92 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.