reddit / emacs

helm-occur does not show syntax coloring

MathematicianNo7455 · 2022-10-21 07:33
Hello. I recently moved from helm-swoop to helm-occur. In helm-swoop, search results are shown in the same color that the major mode shows with syntax coloring. However, helm-occur shows search results as a single color. I checked the customize-group for both helm and helm-occur but could not find a variable for this. Is there a way to make syntax coloring enabled in the helm-occur buffer? Thanks.
helm05 · 2022-10-21 12:31
Look at helm-occur-buffer-substring-fn-for-modes.
MathematicianNo7455 · 2022-10-22 09:54
Yeah, that works, thanks. However, do I need to add every single major mode to the list? I want it to be activated every time in any mode.
MathematicianNo7455 · 2022-10-23 06:57
I added a new custom variable to helm-occur to solve this and it is merged by the maintainer. Here is the pr: https://github.com/emacs-helm/helm/pull/2560. Now if you set "Helm Occur Buffer Substring Default Mode" to 'buffer-substring', it will use colorization when the mode does not appear on the list "Helm Occur Buffer Substring Fn For Modes".