GNU bug report logs - #23598
25.0.94; linum

Previous Next

Package: emacs;

Reported by: freezer <at> posteo.de

Date: Sun, 22 May 2016 07:17:02 UTC

Severity: minor

Found in version 25.0.94

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 23598 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: freezer <at> posteo.de, 23598 <at> debbugs.gnu.org
Subject: Re: bug#23598: 25.0.94; linum
Date: Tue, 11 Aug 2020 19:20:28 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sun, 22 May 2016 08:59:35 +0200
>> From: freezer <at> posteo.de
>>
>> 1. When I turn on line numbers (with linum-mode), scrolling a large org file is very slow. This only happens when the org sections are folded and not fully
>> expanded.
>
> linum-mode needs to count lines each time you scroll through the file,
> and it needs to update the display for all the lines visible in the
> window.  When many lines are hidden, updating a window requires
> traversing a lot of lines in the buffer.  For example, the sample file
> you sent shows almost 3000 lines in a single window, which is 100
> times more than an average window without hidden lines.  So yes, this
> is slow.
>
> I suggest to switch to nlinum-mode from ELPA, which us much faster in
> these cases.
>
>> 2. With some themes, the line numbers are also truncated. Example (theme
>> monokai): http://i.imgur.com/gkY8FGn.png
>>
>> Example org file:
>> https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org
>
> The monokai theme seems to implicitly enlarge the face used for the
> line numbers and change its font (because Org headers use an enlarged
> variable-pitch font), but it doesn't update the 'linum' face with that
> information.  By default, the face for the line numbers has its
> attributes merged with those of the face used to display the text
> line, and since the 'linum' face by default doesn't specify any size
> or font attributes, they are taken from the Org header face.  So the
> calculation of character size linum-mode does is incorrect, because
> the 'linum' face's font is still defined to be the original size
> before it was enlarged.  I think setting the 'linum' face's attributes
> to set specific font family and height attributes should fix this
> problem.  It could be argued that the monokai theme should do that: it
> clearly caters to linum-mode, since it does set some attributes of the
> 'linum' face.

So the suggestion here is to use nlinum-mode instead for these cases,
and to potentially also make changes to an external theme.

So is there anything more to do here or should this be closed?

Best regards,
Stefan Kangas




This bug report was last modified 4 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.