diff-hl icon indicating copy to clipboard operation
diff-hl copied to clipboard

Support colorising line line-number-mode rather than writing to the fringe/gutter

Open sten0 opened this issue 6 years ago • 3 comments

@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.

  1. 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.

  2. 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.

sten0 avatar Jun 25 '19 21:06 sten0

line-number-mode? Is that the one that writes to current line number at the beginning of the mode-line?

dgutov avatar Jun 26 '19 13:06 dgutov

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.

dgutov avatar Jun 26 '19 14:06 dgutov

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36472

dgutov avatar Jul 02 '19 11:07 dgutov