Support colorising line line-number-mode rather than writing to the fringe/gutter
@dgutov Continuing from #103
Regarding the coloring of line numbers, I'm not really sure it's possible (the new feature is implemented on the C level, and it's not very customizable). You're welcome to file a separate feature request in Emacs or here (I will pass it on then).
I suspect one of the following two (naïve) approaches would work, since
line-number-mode respects Custom Themes.
-
If lnm inherits face attributes from the theme, then a theme could provide a lnm-specific variable (defaults to inheriting foreground & background face from theme). That variable would be dynamically modified by diff-hl to indicate state. Lnm would need to be modified to use this new theme variable instead of the global foreground & background face.
-
Basically the inverse of the above. Lnm operates at a lower level and dumps data which is then rendered by the interface (obviously I don't know Emacs internal architecture well at all). In this case Lnm would need to be modified to signal to the interface that it's data is different (maybe it already does?)...so then it can be rendered using a different path. Diff-hl would intercept this data post-custom theming but before the interface rendered it, and would overwrite the face attributes applied by the custom theme.
line-number-mode? Is that the one that writes to current line number at the beginning of the mode-line?
If you mean display-line-numbers-mode (and I agree that conflict of names in unfortunate), then I don't think either of the approaches will work currently. We can file a feature request, though.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36472