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: Fri, 02 Dec 2022 09:05:52 +0200 Message-ID: <838rjqgu9b.fsf@gnu.org> References: <83czcyd8jf.fsf@gnu.org> <83a682d66r.fsf@gnu.org> <837d36ceno.fsf@gnu.org> <37dd2827f54f8bbda5e3@heytings.org> <735c1d5b-0d64-a8e1-3aaa-91fc0248abd3@yandex.ru> <97049541-f5b4-ed3b-b8de-7c0bdc86f0f5@yandex.ru> <6e305c9b-7702-133a-3347-f64db05ade3f@yandex.ru> <83mt89kt10.fsf@gnu.org> <834juglesn.fsf@gnu.org> <83r0xkjw5s.fsf@gnu.org> <83pmd3ioxx.fsf@gnu.org> <47153506021498df087c@heytings.org> <83bkomhlmn.fsf@gnu.org> <4715350602cf2ec6860b@heytings.org> <83a646hkat.fsf@gnu.org> <47153506028bbb3bc8b3@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca, dgutov@yandex.ru To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 02 08:07:17 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 1p108j-0001bO-BV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Dec 2022 08:07:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p108Y-0004Ty-J2; Fri, 02 Dec 2022 02:07:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p108U-0004Tc-7l for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 02:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p108T-0000Y0-Vy for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 02:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p108T-0002mO-Qr for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 02:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2022 07:07: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.166996479110658 (code B ref 56682); Fri, 02 Dec 2022 07:07:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 2 Dec 2022 07:06:31 +0000 Original-Received: from localhost ([127.0.0.1]:44751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p107z-0002lq-9a for submit@debbugs.gnu.org; Fri, 02 Dec 2022 02:06:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p107v-0002lk-BO for 56682@debbugs.gnu.org; Fri, 02 Dec 2022 02:06:29 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p107o-0000NR-Bw; Fri, 02 Dec 2022 02:06:21 -0500 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=XI8JWUzJyEMa8dA5+KTCX9jjh8tEp0PUq+kDWt3mI9U=; b=fxEnb04lNRng BdicKKs2QUN3TqVmu+o11+Fm6nrsIbAoMb21Wxho7uXRNXLA0yn7NCK7VrjfM1i0NBh2KicbF1D1D Rk3ao3aGi6q8/5/cNcTF9kWUJz6zxJ9nBsQkEXSsiWjvVfIZzvjt6+jkfB2vlYdRPzNQh2xQjSdqf 6gCWVxYtZeF0+Fl1zk1RA/f8rgVClWNr3yvDL9kqd3khHuJfY+oE6+30L3pbpJWkf3X3GHalEiaVt XlkyQgHkM84UAatnJ2swVqucP/ri+qDhgfxNCQmcAoHcLe3qy4vozfCK7Y3YV2M4sHDFZVCa6zKa9 Il5y5MKW1gfBHslE5AymeA==; Original-Received: from [87.69.77.57] (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 1p107m-0002gt-Q9; Fri, 02 Dec 2022 02:06:19 -0500 In-Reply-To: <47153506028bbb3bc8b3@heytings.org> (message from Gregory Heytings on Thu, 01 Dec 2022 22:23:38 +0000) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249706 Archived-At: > Date: Thu, 01 Dec 2022 22:23:38 +0000 > From: Gregory Heytings > cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca, dgutov@yandex.ru > > > But anyway, what exactly does this prove, and how? I asked why we need > > to look beyond the narrowing, so how does the above answer that > > question? what am I missing? > > It proves that the long line detection loop must be executed on the whole > buffer. No, it doesn't. It shows that the conditions to re-examine buffer text are incomplete and need to be augmented. > In this case there are no modifications to the buffer when it is > widened, so the detection loop is not triggered, and because there was no > long line in BEGV/ZV before widening Emacs did not activate the long line > optimizations. You didn't explain the problem clearly enough, so I didn't understand it originally. The actual problem is not that the restriction changes since the last redisplay, the problem is that the restriction changes _and_ the number of unsaved buffer text modifications is still below the threshold of 8. Once I understood the scenario, the fix was a simple one-liner, which I installed yesterday night.