all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andy Moreton <andrewjmoreton@gmail.com>
Cc: 28879@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	[thread overview]
Message-ID: <83k1zse88m.fsf@gnu.org> (raw)
In-Reply-To: <d5011297-74a9-a770-c670-2449bf81e7b9@gmail.com> (message from Andy Moreton on Tue, 17 Oct 2017 21:40:16 +0100)

> From: Andy Moreton <andrewjmoreton@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.





  reply	other threads:[~2017-10-18 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 20:40 bug#28879: 26.0.90; Narrowed line numbers shown with display-line-numbers-widen Andy Moreton
2017-10-18 16:22 ` Eli Zaretskii [this message]
2017-10-18 17:39   ` Andy Moreton
2017-10-18 17:57     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k1zse88m.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=28879@debbugs.gnu.org \
    --cc=andrewjmoreton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.