-
Notifications
You must be signed in to change notification settings - Fork 40
Description
It took me a bit to figure out what was wrong here, and I don't think it is documented
anywhere. Here are a couple issues I ran into:
-
If custom colors are defined in ~/.ripgreprc, eg.
--colors=path:fg:cyan
etc. then
font-locking and other functions in the rg-results buffer don't work. -
Using
xterm-color-filter
also breaks rg's compilation (fromxterm-color
library)
I usually usexterm-color-filter
in mycompilation-start-hook
to interpret shell escapes,
however, since rg (like ag.el) relies on shell escapes for parsing, font-lock/other functions
also break in the rg-results buffer.
Quick fix is to remove xterm-color support around rg-run
(define-advice rg-run (:around (orig-fn &rest args) "no-xterm-color")
(let ((compilation-start-hook
(remove 'my-compilation-start-hook compilation-start-hook))
compilation-environment)
(apply orig-fn args)))
It looks like it would probably be out-of-the question to add support to rg-results
that
didn't rely on escape codes, but it might be helpful to mention incompatibilities somewhere.