GNU bug report logs - #27281
Fix nlinum missing line numbers.

Previous Next

Package: emacs;

Reported by: William Gilbert <gilbertw1 <at> gmail.com>

Date: Wed, 7 Jun 2017 21:49:01 UTC

Severity: normal

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alex <agrambot <at> gmail.com>
To: npostavs <at> users.sourceforge.net
Cc: William Gilbert <gilbertw1 <at> gmail.com>, 27281 <at> debbugs.gnu.org
Subject: bug#27281: Fix nlinum missing line numbers.
Date: Sat, 10 Jun 2017 11:44:26 -0600
npostavs <at> users.sourceforge.net writes:

> William Gilbert <gilbertw1 <at> gmail.com> writes:
>
>> I've been working to track to down a bug where line numbers are
>> occasionally missing when using nlinum mode. Currently there is a package
>> written to workaround the problem that has a picture and description of the
>> problem: https://github.com/hlissner/emacs-nlinum-hl.
>>
>> After extensive debugging I've tracked the problem down to the
>> 'nlinum--region' function. Specifically the while loop check that
>> determines if '(point)' is less than the limit. I've found that the problem
>> exists when '(point)' is exactly equal to 'limit'. In this scenario the
>> loop terminates and the last line in the region is not provided with a line
>> number.
>
> Do you know how to reproduce this scenario?
>
>> I was able to remedy the problem by changing the condition from
>> 'less than' to 'less than or equal to', which will allow the last line in
>> the region to be properly assigned a line number.
>
> This sounds like a workaround, possibly to a bug in jit-lock.  Or
> perhaps we need to return a list of the form (jit-lock-bounds BEG END)
> from nlinum--region?

FWIW I've encountered this issue before and this diff does not solve the
problem for me. I mostly see it when using the 3rd-party package
macroexpand with nlinum. Expanding and closing a macro will leave
several lines with no line number (from the 2nd line of the macro until
the last line of the macro).

I've tried to use edebug on nlinum--region to figure out what's going
on, but it doesn't seem to be triggering for some reason.




This bug report was last modified 5 years and 293 days ago.

Previous Next


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