Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sten0 opened this issue Jun 25, 2019 · 3 comments

Comments

@sten0
Copy link

sten0 commented Jun 25, 2019

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

@dgutov
Copy link
Owner

dgutov commented Jun 26, 2019

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

@dgutov
Copy link
Owner

dgutov commented Jun 26, 2019

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
Copy link
Owner

dgutov commented Jul 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants