dajva / rg.el

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

respect compilation-scroll-output #97

Closed jixiuf closed 3 years ago

jixiuf commented 3 years ago
 (setq compilation-scroll-output 'first-error)

When I set compilation-scroll-output to t or nil, rg respect this variable, But when I set I tot first-error, it doesn't .

dajva commented 3 years ago

Did you modify rg-group-result setting? This is a known issue in the regexps when rg-group-result set to nil. There is also a bug that these regexps are used in grouped mode. The latter can easily be fixed but wont help if you are not using grouped results mode (which is the default).

jixiuf commented 3 years ago

yes

 (setq rg-group-result nil)
dajva commented 3 years ago

Unfortunate. Ok so the regexp is matching the line rg started at Sat Sep 26 12:00:00 line. I think you can see that the caret jumps there. That would actually be a possible match line with file name "rg started at Sat Sep 26 12" and line, column as both "00" I think grep-mode has some clever stuff in its error matching regexp that could be used to filter out valid but weird enough file names to avoid that match. I'll see what I can find.

dajva commented 3 years ago

This actually looks to be an upstream bug in compilation-mode. Reported a bug to see if emacs maintainers agree: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43651

dajva commented 3 years ago

Upstream bug has been fixed. I guess you have to wait until emacs 28 to get it though, unless you want to fork compile.el and backport the fix to your current emacs.