bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53626: 28.0.91; project-find-regexp (C-x p g) twice results in searc


From: Dmitry Gutov
Subject: bug#53626: 28.0.91; project-find-regexp (C-x p g) twice results in searching different projects
Date: Thu, 3 Feb 2022 05:15:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

Hi!

On 29.01.2022 21:11, sbaugh@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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]