emacs-devel
[Top][All Lists]
Advanced

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

Re: Colorful line numbers


From: João Távora
Subject: Re: Colorful line numbers
Date: Fri, 22 Jul 2022 12:29:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Could we implement one such mechanism?
> No.  The native line-number display is implemented inside the low
> level of the display code, and I don't want to call to Lisp from
> there.  If nothing else, it will slow down redisplay when line numbers
> are used, whereas avoiding that slowdown was an explicit goal of
> developing native line-number display.

Does checking for a given text property on some buffer text call into
Lisp?  If it isn't, and it's cheap, then this hypothetical feature could
have very low overhead when not used.

Even if you're opposed the idea, could you perhaps some pointers on how
to implement it, so that I try my hand at it and benchmark the
before/after?

> Why aren't the existing faces enough?  

I would like to propertize each line number's background with a
different color based on assembler information.

This would create a visually cue similar to the one used in Matt
Godbolt's "Compiler explorer" which works in the browser.  There, you
have two side-by-side windows of source code, you enter some C code on
the left and it starts compiling it immediately.  If compilation
succeeds, it immediately shows the assembly code on the right.  Finally,
it colorizes the lines with a unique and dynamically determined, color
based on the assembler code that each line produces when the file
compiled (according to gcc -g).  The reader can visually match these
colors in the left and right windeos to see, to some extent, how the
compiler proceeded.

I've recently discovered Jay Kamat's most excellent rmsbolt.el.  It is
is even better than godbolt.org in many aspects but is missing this last
feature, which I would like to add.  But instead of highlighting the
whole line, I thought it would be nicer and less distracting if I just
highlighted the line number's background.

> And if they aren't enough, why cannot you use line-number-mode?

I do use line-number-mode, but I don't understand how it can help me
here.  AFAIK it shows me one line number at a time in the modeline, not
besides the text.

João






reply via email to

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