emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colorful line numbers


From: Stefan Monnier
Subject: Re: Colorful line numbers
Date: Fri, 22 Jul 2022 19:32:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>>> Also seehttps://debbugs.gnu.org/36472.
>> Have you tried to add such a feature for `(n)linum-mode`?
> I didn't: that's not what the diff-hl user was asking for.

But you could add that feature to `diff-hl` for `(n)linum-mode` so
people can at least try it out.

> But I proposed several different technical approaches, every one of which
> has been rejected so far. And not because of the difficulty
> of implementation.
>
> Not sure how implementing any of them in nlinum would help, given that the
> primary complaint was about running Lisp.

I suspect the problem is not "running Lisp" but "running Lisp from the
code that implements `display-line-numbers-mode`", because that code is
deep in the redisplay where running Lisp code can be tricky.

That same problem does not apply to `(n)linum-mode` because their code
is not "deep in redisplay".

> And if we take an alternative approach (display-line-numbers-mode looks up
> text properties in the buffer to determine which face to use), it also
> depends on the intricacies of its implementation. E.g. how to reliably
> redraw when such text properties change.

My hunch is that such changes to text-properties would cause
a rerendering of those lines anyway (the decision whether to re-render
doesn't pay attention to which properties have been changed, IIRC), so
it may end up "just working" without any effort in this respect.
Then again, maybe not.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]