emacs-devel
[Top][All Lists]
Advanced

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

Re: Native display of line numbers, improved


From: Alex
Subject: Re: Native display of line numbers, improved
Date: Mon, 26 Jun 2017 13:41:19 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Alex <address@hidden>
>> Cc: address@hidden
>> Date: Sun, 25 Jun 2017 21:50:15 -0600
>> 
>> Err, sorry again. I meant to write "the number of digits needed to
>> represent the last line in the buffer's line number".
>
> Right.  That would be something like
>
>   (truncate (1+ (log (max 1 (count-lines (point-min) (point-max))) 10)))

Thanks. I was just thinking that the display engine could somehow do it
noticeably faster, but evaluating that in a large file (xdisp.c) is only
a few milliseconds on my machine, so that's probably fast enough.

Is there going to be a minor mode in the merged version? It would be
nice to have a display-line-numbers-mode-hook to attach the above to.



reply via email to

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