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: Thu, 01 Dec 2022 21:52:03 -0500 Message-ID: References: <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> <47153506021115866615@heytings.org> <20f32a53dc3f5fbc5b65@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="30326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) 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 Fri Dec 02 03:53: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 1p0wAs-0007gY-PU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Dec 2022 03:53:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0wAh-0004jo-Vu; Thu, 01 Dec 2022 21:53: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 1p0wAg-0004jJ-50 for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 21:53: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 1p0wAf-0006Lv-Sm for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 21:53:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0wAf-00052h-P6 for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 21:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2022 02:53: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.166994953519373 (code B ref 56682); Fri, 02 Dec 2022 02:53:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 2 Dec 2022 02:52:15 +0000 Original-Received: from localhost ([127.0.0.1]:43467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0w9u-00052P-KA for submit@debbugs.gnu.org; Thu, 01 Dec 2022 21:52:14 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0w9r-00052J-R9 for 56682@debbugs.gnu.org; Thu, 01 Dec 2022 21:52:13 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6D87E440039; Thu, 1 Dec 2022 21:52:06 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6B8FF442645; Thu, 1 Dec 2022 21:52:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1669949524; bh=UeGpWPml8yASaaa0Wb7ZmesZKCzYGlFeU734Q9QHM3o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OYF0npFLuNovCKiHytLCciqT25X0NC9Ofd2Pc78wY0pHYiAVb/SLLEdSUsz1w2oRs AJT/0zMwv1CR3TuTuGGq1RliwJsZCLiob63tnu0ON4kd1O6beRP5jkwPOMheFtT4NQ Yp8K9mB4Wg0/aoalfOOVHxdSzrYGAH/jQDz1215MM8sMY8U7m3ygmJqXWK5AQ5JAKA WqtTodBf0dvkz2uY9w3v71t2jMSiV7ZPWZ83OpygcE9aheOLjlY/Qj0AcYFkQ+Us15 5rQ9SR8sQsPF1RCdtcRYtXIaQTHrnoTP2h19c4K2TsndqFw0csDJ0DGJJb/E60DKfr 6wZYrgg89nmJQ== Original-Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 42F4A1203FE; Thu, 1 Dec 2022 21:52:04 -0500 (EST) In-Reply-To: <20f32a53dc3f5fbc5b65@heytings.org> (Gregory Heytings's message of "Fri, 02 Dec 2022 00:24:00 +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:249692 Archived-At: >> Maybe another option is to do the scan more lazily, keeping track more >> precisely of what was scanned and/or needs rescanning. > Thanks. It's an option indeed, the problem here is how to keep track of > what was scanned or needs rescanning. My suggestion was to have as "steady state" that "everything is scanned except for a region between BEG...END and no line was found to be larger than MAX_SEEN_LINE_LENGTH". So it requires keeping track of a BEG..END (BEG can be an integer but END would likely be an (insert-before) marker) plus an integer keeping track of MAX_SEEN_LINE_LENGTH. Initially BEG is 1 and END is Z. I can't think of a good way to detect when MAX_SEEN_LINE_LENGTH can be made smaller, tho, so we might still need to rescan the whole buffer every once in a blue moon. Stefan