dajva / rg.el

Emacs search tool based on ripgrep
https://rgel.readthedocs.io
GNU General Public License v3.0
470 stars 38 forks source link

Need hints for debugging: emacs master is possibly breaking `compilation-next-error` #82

Closed calbrecht closed 4 years ago

calbrecht commented 4 years ago

Running on emacs master from about 2020-05-08, i noticed that i am no longer able to jump to files found by rg.el so easily :)

There is this odd behavior, e.g.

cd ~/ws/xi-term
emacsclient -t README.md
C-c s r
Regexp search for: use<Enter>
Search in files (default: [markdown] = *.markdown  *.md  *.mdown  *.mkdn): *.*<Enter>
In directory: ~/ws/xi-term/src<Enter>

Notice, how i change the directory to src ^^ Now i get the correct result list, with the header showing

-*- mode: rg; default-directory: "~/ws/xi-term/src/" -*-

Further actions

C-x o
M-n
C-m

lead to a minibuffer prompt with

Find this error in (default main.rs): ~/ws/xi-term/

Now i need to add the src folder manually, which is ok in this case but gets tedious when i search different directories deeper inside current workdir. (edit: funny enough, outside current workdir is working properly)

Conclusion: The part of the path that i give additionally to the minibuffer prompt In directory: is missing in the jump command, if this part is inside the current workdir.

I suspect 7a12ab5ea2 | * Fix project.el commands in "transient" projects ... 1 week to be the culprit, but this is only a gut feeling.

To me, it seems like something in regard to default-directory changed along the way until the target file gets opened in a buffer, if that rings a bell for someone, i'd be glad to recieve some help :)

Thank you.

calbrecht commented 4 years ago

ehm, nevermind. i'll go ask on the emacs bugtracker maybe.

luckysori commented 6 months ago

I do encounter this problem on

GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2023-05-29

and 4885473.

My workaround is to set rg-group-result to nil, so that the "file name is repeated at the beginning of every match line". With that extra context, compile-goto-error is able to jump to the right location.