GNU bug report logs - #28879
26.0.90; Narrowed line numbers shown with display-line-numbers-widen

Previous Next

Package: emacs;

Reported by: Andy Moreton <andrewjmoreton <at> gmail.com>

Date: Tue, 17 Oct 2017 20:41:01 UTC

Severity: normal

Found in version 26.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andy Moreton <andrewjmoreton <at> gmail.com>
Cc: 28879 <at> debbugs.gnu.org
Subject: bug#28879: 26.0.90; Narrowed line numbers shown with display-line-numbers-widen
Date: Wed, 18 Oct 2017 19:22:33 +0300
> From: Andy Moreton <andrewjmoreton <at> gmail.com>
> Date: Tue, 17 Oct 2017 21:40:16 +0100
> 
>  From emacs -Q:
> 1) Open a lisp file
>     (setq display-line-numbers-widen t)
>     M-x display-line-numbers-mode
> 2) Move point inside a function
>     M-x narrow-to-defun
> 3) M-x widen
> 
> After (2) the window shows line numbers relative to the start of
> the buffer, as expected.
> 
> After (3), the window shows line numbers starting from 1 for the
> narrowed region. After the next mouse or keyboard input, the line
> numbers are displayed normally.

Right.  And if your Emacs is built with --enable-checking (which is
something I advise for the first couple of pretest of a new release),
you might be able to trigger an assertion violation by repeating the
above recipe several times.

> Thus it seems that when display-line-numbers-widen is non-nil the line
> numbers are not recomputed after widen until then next input.

Actually, the numbers have been recomputed, as you see them change on
display.  They just were recomputed incorrectly: the logic related to
widening failed to catch the first redisplay cycle after 'widen',
which is special.  (In general, line numbers are computed as part of
displaying a window, so whenever you see redisplay, you know the line
numbers were recomputed, at least for some lines.)

Should be fixed now.  Thanks for reporting this.




This bug report was last modified 7 years and 269 days ago.

Previous Next


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