From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56682: locked narrowing Date: Wed, 17 Aug 2022 21:29:29 +0300 Message-ID: <83edxed8qe.fsf@gnu.org> References: <83edxgfi75.fsf@gnu.org> <5e3c3081-f098-8140-c767-b895c32bf30b@yandex.ru> <835yisffil.fsf@gnu.org> <831qtgff78.fsf@gnu.org> <83zgg4dw4y.fsf@gnu.org> <83r11gdrr4.fsf@gnu.org> <83edxfds7s.fsf@gnu.org> <83r11fc80o.fsf@gnu.org> <83o7wjc6o2.fsf@gnu.org> <83lernc5gu.fsf@gnu.org> <83k076dd7d.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24222"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, dgutov@yandex.ru To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 17 20:30:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oONnw-000689-Eu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 20:30:12 +0200 Original-Received: from localhost ([::1]:47970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oONnv-0003Jo-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 14:30:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oONnn-0003H4-1E for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 14:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oONnm-0002RM-OZ for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 14:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oONnm-0001iK-Ep for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 14:30:02 -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, 17 Aug 2022 18:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.16607609916550 (code B ref 56682); Wed, 17 Aug 2022 18:30:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 17 Aug 2022 18:29:51 +0000 Original-Received: from localhost ([127.0.0.1]:53038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oONnb-0001ha-Dn for submit@debbugs.gnu.org; Wed, 17 Aug 2022 14:29:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oONnW-0001hK-Db for 56682@debbugs.gnu.org; Wed, 17 Aug 2022 14:29:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oONnP-0002OC-4X; Wed, 17 Aug 2022 14:29:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JyFW9iuIeKdIbPv65zwdgCk2FlEGzYGf4b37/UWicfM=; b=iRTCpiWh7Crs /BuGIFkZLrUqCVb0DQ1cSU6Bjkw+Vmoov4HQN7N+imcJZMyRX7ZYJx48oCdhHG4Df1f+MhR0L1VLw geElnjUqhr39IUIDPUNTV9jESTLdgEdLjc1vZ74AtXQcYgOLDsPgQN0ongBddz27wVYOCS2/SRm05 6xCUZIf8J8v01Xu2tXBjWzD0PWypSviwvEU5PXkZ3yVOVDL5GEZgOe41fs2ydCC8m16HiQatARygx 8HxAOcDdwf/cbtHgMeMdh9X0seNmxj+PfJXVS7uDo1COV9XKGCDGghCgCNwA0MeH3AYsfHYec0sp7 YOeal7Ln3mC2a4wMcMTnNw==; Original-Received: from [87.69.77.57] (port=1688 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oONnO-0005hJ-HO; Wed, 17 Aug 2022 14:29:38 -0400 In-Reply-To: (message from Stefan Monnier on Wed, 17 Aug 2022 13:58:21 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240102 Archived-At: > From: Stefan Monnier > Cc: dgutov@yandex.ru, 56682@debbugs.gnu.org, gregory@heytings.org > Date: Wed, 17 Aug 2022 13:58:21 -0400 > > > Why can't you simply use the same code maybe_produce_line_number uses > > for that? > > Because I can't find that code. What do you mean? it's in maybe_produce_line_number, obviously... > Apparently `maybe_produce_line_number` > just uses `w->base_line_number` whenever it's not 0, so apparently it's > set to 0 elsewhere. It's set to zero in several places in xdisp.c. But again, if you don't want to trust the cached values, just use display_count_lines starting from BOB. > > Why does it matter which line numbers you compute if they are never > > displayed? > > They may be displayed at some other time: nlinum-mode won't be invoked > if that same portion of the buffer becomes visible later on (it's just > like font-lock: the highlighting applied stays until something like the > after-change-function causes it to be refreshed). Then invalidate the information on that portion when the buffer becomes displayed, and let the code count again.