From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56682: locked narrowing Date: Tue, 16 Aug 2022 17:50:39 -0400 Message-ID: References: <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> <325f95fd2b8106ed2d16@heytings.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33740"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56682@debbugs.gnu.org, Eli Zaretskii , dgutov@yandex.ru To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 16 23:51:20 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 1oO4T1-0008Xd-P4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 23:51:19 +0200 Original-Received: from localhost ([::1]:45876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oO4T0-0004UT-8x for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 17:51:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oO4Sk-0004UJ-SY for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 17:51:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oO4Sk-00049F-KV for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 17:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oO4Sk-0002bf-GK for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 17:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Aug 2022 21:51: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.166068665010001 (code B ref 56682); Tue, 16 Aug 2022 21:51:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 16 Aug 2022 21:50:50 +0000 Original-Received: from localhost ([127.0.0.1]:48558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oO4SY-0002bF-Gn for submit@debbugs.gnu.org; Tue, 16 Aug 2022 17:50:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oO4SW-0002b1-Gn for 56682@debbugs.gnu.org; Tue, 16 Aug 2022 17:50:48 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3E4C6100138; Tue, 16 Aug 2022 17:50:42 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A51CE1000ED; Tue, 16 Aug 2022 17:50:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1660686640; bh=sTB667A70HvkkBwOs+O8+rH5HzpaJuZCyy+nhjg9D6Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bj+I0VuBu7sQcvK3YcDS0xf4kkfIC3+Z3vw7M3+4napPOVMN7M2nLWlzNuMA4m+5Y zYqKr9P0LY4Ib42hLSUNdFQ1HyOTSr44W0BgqUuZQ6Isnv2/j4gjblhZcFz67v4dv3 wZwTemRVNOW+47wYBX89+n0ae021JPeBEp27/61TVsQkT1Kz2MD8FfsFybEP+PHUpw Hdugjr5Ii275cFZdjF5FcwTFHiP9FGQiMYoHg4wsG1OwELwGTSgkst4MsQRVdr8Mk3 k2SMA+wJcce97fx9rMuENMX9goLL9ove2gaorCK872ve8ClOE5ER6yPk+63TIeauU/ o3MahgosVAfCg== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 814FD120211; Tue, 16 Aug 2022 17:50:40 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Tue, 16 Aug 2022 17:42:45 -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:240015 Archived-At: Stefan Monnier [2022-08-16 17:42:45] wrote: > Gregory Heytings [2022-08-16 20:23:46] wrote: >> Another comment: >>> 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)))) >> FWIW, that's not a good example, because it's a bad idea to calculate line >> numbers in buffers with long lines or with too many lines: it takes too >> much time. > In my tests, it works fast enough for pretty large buffers and pretty > long lines, And actually, it doesn't seem to be slowed by long lines, only by the buffer size. So its `widen` should definitely override the line-length-induced narrowing (tho maybe not the buffer-size-induced narrowing if/when we add such a thing). Stefan