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 (was: bug#56682: Fix the long lines font locking related slowdowns) Date: Wed, 17 Aug 2022 14:28:39 +0300 Message-ID: <83edxfds7s.fsf@gnu.org> References: <12348081660379417@sas2-a098efd00d24.qloud-c.yandex.net> <66bbbb95983414e79637@heytings.org> <83wnb9hadb.fsf@gnu.org> <395454dd-7238-c5d0-e924-2f65a186baa7@yandex.ru> <83r11hh4pm.fsf@gnu.org> <3a1232a17b09ce88af40@heytings.org> <83edxghqg2.fsf@gnu.org> <325f95fd2bcc0b666b0b@heytings.org> <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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3425"; 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 13:29:38 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 1oOHEv-0000lb-IX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 13:29:37 +0200 Original-Received: from localhost ([::1]:53934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOHEu-0006VF-23 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 07:29:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOHEM-0006UR-NW for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 07:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOHEM-0005Zn-5Q for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 07:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oOHEL-0004xp-Vo for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 07:29: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 11:29:01 +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.166073573919072 (code B ref 56682); Wed, 17 Aug 2022 11:29:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 17 Aug 2022 11:28:59 +0000 Original-Received: from localhost ([127.0.0.1]:49616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOHEJ-0004xY-Ad for submit@debbugs.gnu.org; Wed, 17 Aug 2022 07:28:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOHEG-0004xJ-EN for 56682@debbugs.gnu.org; Wed, 17 Aug 2022 07:28:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOHEA-0005M4-7b; Wed, 17 Aug 2022 07:28:50 -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=U31RUl0KfkzHBFaqFR9xS/RguHLTAYc6yBuxf2NCsVE=; b=AUaKmydvdt49 3Nee5dpRiMe1jlKJnh7Lo95Mif3AAAsAc19Xu3LNjZ5kkmrRfht3pbZbaGfzbmNu8Y2qAuX7e53xv gGEZYW8g7AJqIt/XN3rale4PdWeY+lHqjAzLXJkDR+HBuvPVqDnkmeqtWkHPbAtSzJx+NPKDhLebe Oz2bxM8kpkquqZwu5E7HFhWb/LEvNc85ajkgTUzF2EidGZIGSSsetcE8V5fycNfLI7sAvwoZlFa4L unCIB13/+2sAdr3oYaajWkKTu8mKN2efqa75vANEhIHil5juZ9994eaFHGQCk0NAi06BeFE11zTMr M11YbimwWN1xfgfwW6W2Kw==; Original-Received: from [87.69.77.57] (port=3610 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 1oOHE8-0006YT-Ht; Wed, 17 Aug 2022 07:28:49 -0400 In-Reply-To: (message from Stefan Monnier on Tue, 16 Aug 2022 15:18:23 -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:240053 Archived-At: > From: Stefan Monnier > Cc: dgutov@yandex.ru, 56682@debbugs.gnu.org, gregory@heytings.org > Date: Tue, 16 Aug 2022 15:18:23 -0400 > > diff --git a/nlinum.el b/nlinum.el > index 4f0e02fef1..3feaaca5c3 100644 > --- a/nlinum.el > +++ b/nlinum.el > @@ -312,7 +312,7 @@ Only works right if point is at BOL." > (if nlinum-widen > (save-excursion > (save-restriction > - (widen) > + (REALLY-widen) > (forward-line 0) ;In case (point-min) was not at BOL. > (let ((nlinum-widen nil)) > (nlinum--line-number-at-pos)))) If a package wants to count lines in a function registered with jit-lock, I think it makes no sense for it to do that in Lisp. It would be much better to let such packages use the built-in capabilities that we use all the time, both on the mode line and under display-line-numbers mode. There are at least two advantages to that: (1) it will be at least slightly faster, sometimes more than slightly (due to caching); and (2) the problem of narrowing would be seamlessly resolved.