I am liking rgrep as it lets you choose a path and searches recursively. How is it possible to highlight the matches in the rgrep buffer?
1 Answer
grep (rgrep) uses two settings (that I know of) to control highlighting in the *grep* buffer
font-lock-modegrep-highlight-matches- customization variable
grep-highlight-matches depends on font-lock-mode being on. It can inherit its value from grep-host-defaults-alist. It controls the use of the GREP_COLORS environment variable and grep --color argument.
In your case I'd check that font-lock-mode is enabled. From the *grep* buffer enter: C-h v font-lock-mode and see what the *Help* buffer says. The easiest way to enable it in all buffers that support font locking is to call (global-font-lock-mode t)
You can also enter M-x font-lock-fontify-buffer on a per buffer basis.
I recall it not being enabled for me in older versions of emacs and/or on certain terminals.
- Thanks for your comment. It was actually the "match" attribute. I added this `(match ((t (:foreground "#f2804f" :weight bold)))) to custom-theme-set-faces and that did it.SFbay007– SFbay0072018-01-17 05:34:41 +00:00Commented Jan 17, 2018 at 5:34
emacs -Q(no init file)? If you see the highlighting in that case then bisect your init file to find out what is interfering.findcommand. Dunno. Works for me, with Emacs 23 to Emacs 26.