From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28879: 26.0.90; Narrowed line numbers shown with display-line-numbers-widen Date: Wed, 18 Oct 2017 19:22:33 +0300 Message-ID: <83k1zse88m.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1508344806 11802 195.159.176.226 (18 Oct 2017 16:40:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Oct 2017 16:40:06 +0000 (UTC) Cc: 28879@debbugs.gnu.org To: Andy Moreton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 18 18:39:59 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4rNs-00021l-2C for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Oct 2017 18:39:56 +0200 Original-Received: from localhost ([::1]:45578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4rNz-0004UP-LE for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Oct 2017 12:40:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4r7W-0003CS-TU for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 12:23:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4r7W-0008Oo-3J for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 12:23:02 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4r7V-0008Oi-Vj for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 12:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4r7V-0007Vp-MJ for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2017 12:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Oct 2017 16:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28879 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28879-submit@debbugs.gnu.org id=B28879.150834377928866 (code B ref 28879); Wed, 18 Oct 2017 16:23:01 +0000 Original-Received: (at 28879) by debbugs.gnu.org; 18 Oct 2017 16:22:59 +0000 Original-Received: from localhost ([127.0.0.1]:48505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4r7T-0007VW-LA for submit@debbugs.gnu.org; Wed, 18 Oct 2017 12:22:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4r7S-0007VH-RO for 28879@debbugs.gnu.org; Wed, 18 Oct 2017 12:22:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4r7K-0008Hx-Gv for 28879@debbugs.gnu.org; Wed, 18 Oct 2017 12:22:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4r7K-0008Hr-7G; Wed, 18 Oct 2017 12:22:50 -0400 Original-Received: from [176.228.60.248] (port=3746 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e4r7J-0007U6-3P; Wed, 18 Oct 2017 12:22:50 -0400 In-reply-to: (message from Andy Moreton on Tue, 17 Oct 2017 21:40:16 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138675 Archived-At: > From: Andy Moreton > 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.