From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56682: locked narrowing Date: Wed, 30 Nov 2022 14:40:36 +0000 Message-ID: References: <83o7wjc6o2.fsf@gnu.org> <83lernc5gu.fsf@gnu.org> <83k076dd7d.fsf@gnu.org> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33369"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 30 15:41:15 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 1p0OGx-0008Pa-2t for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Nov 2022 15:41:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0OGm-0005Je-6J; Wed, 30 Nov 2022 09:41:04 -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 1p0OGk-0005JJ-VN for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2022 09:41: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 1p0OGk-0004Ry-Mo for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2022 09:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0OGj-0005vF-Pl for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2022 09:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Nov 2022 14:41: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.166981924922750 (code B ref 56682); Wed, 30 Nov 2022 14:41:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 30 Nov 2022 14:40:49 +0000 Original-Received: from localhost ([127.0.0.1]:33175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0OGX-0005us-Fc for submit@debbugs.gnu.org; Wed, 30 Nov 2022 09:40:49 -0500 Original-Received: from heytings.org ([95.142.160.155]:37900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0OGM-0005um-21 for 56682@debbugs.gnu.org; Wed, 30 Nov 2022 09:40:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1669819237; bh=c+2fxztJpekByAwov5ZNuwDWPs1c4oRbdbqlbuUSAkA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=ahLXJJ3FdmEBUIMFpoiKCE5DT/qcmmnOqKw8//UlZf92jwJ5+xLWWysSvypQSp+0k i/vpl6mBkPWAHQ25GIIJD4kD32sC6hBBsuso0VnitpxStD8YFmNMbwIRsQmed9yPau ysyLOucSa+YOo7/3onRP2bfTzkgf95FkcyDXXp5qYoNJKctpeGyd9ysOurlLWsmw6K D0p8THVnFsLl+p6COhJO0aDoQLUPd/3/6+/WygbqAbvrCW14EajgfaryFW86UCd/mb 0Y6Ca4mzGbm62KUXQy5r96COFYtOJ0qRXvta/bThZexZIntK3qE0DuUHoacXvrIC6S gLDV6Q8jZmTPA== In-Reply-To: <834juglesn.fsf@gnu.org> 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:249511 Archived-At: > > I don't think I understand why it should be problematic or unsafe to > limit the same loop we have to a smaller region of the buffer. > I see that you already changed the loop to scan from BEG to Z to only scan from BEGV to ZV; somehow I missed that change. I don't think even that is correct: a command could insert text in the buffer outside of BEGV/ZV. While limiting the loop to a smaller region of the buffer looks like a reasonable thing to do, the question is: how can we determine that region? And I don't see how this can be done, because the detection code is called only when a buffer is about to be displayed, and at that moment we cannot know where characters were inserted in the buffer. What the code does now is "if enough characters have been inserted in the buffer since last redisplay, check again whether the buffer contains long lines". > > It should be clear that triggering such long searches should not be too > hard. > The search is not that long, and it is not triggered for regular editing commands, e.g. while typing or when killing / yanking a line in a buffer.