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: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing. Date: Tue, 14 Feb 2023 16:37:16 +0200 Message-ID: <83pmaccnz7.fsf@gnu.org> References: <166939872890.18950.12581667269687468681@vcs2.savannah.gnu.org> <83eds0ksev.fsf@gnu.org> <8aadf0ddd54c85c8144a@heytings.org> <831qnhg3d9.fsf@gnu.org> <9757fbea37611e9c44b9@heytings.org> <83cz6yacxt.fsf@gnu.org> <6943e04e30e5a02a52e6@heytings.org> <838rhk5fy1.fsf@gnu.org> <6943e04e30a40824e107@heytings.org> <83k0143q37.fsf@gnu.org> <94821a0ef100102ac9e0@heytings.org> <83bkmdz04y.fsf@gnu.org> <43562d4dd9dffd81938f@heytings.org> <83357ozhx0.fsf@gnu.org> <83wn4zurit.fsf@gnu.org> <83bkmaueib.fsf@gnu.org> <83357fnwyy.fsf@gnu.org> <83ttzsk6v4.fsf@gnu.org> <83wn4le8s3.fsf@gnu.org> <0f053182b02103503c26@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca, akrl@sdf.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 14 15:38:20 2023 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 1pRwRo-000ARA-4A for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Feb 2023 15:38:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRwRX-0002b5-Vv; Tue, 14 Feb 2023 09:38: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 1pRwRW-0002a5-Ac for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 09:38: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 1pRwRW-0006SG-1T for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 09:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRwRV-0002aR-Tn for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 09:38: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: Tue, 14 Feb 2023 14:38: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.16763854699924 (code B ref 56682); Tue, 14 Feb 2023 14:38:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 14 Feb 2023 14:37:49 +0000 Original-Received: from localhost ([127.0.0.1]:53012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRwRJ-0002Zz-0I for submit@debbugs.gnu.org; Tue, 14 Feb 2023 09:37:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRwRH-0002Zk-Ia for 56682@debbugs.gnu.org; Tue, 14 Feb 2023 09:37:48 -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 1pRwR8-0006QP-CQ; Tue, 14 Feb 2023 09:37:39 -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=g3Us4UtPyMS0kc6jcNwHoMPSQp4dP8mTtWcSiB2jS6I=; b=BUO51QdGns0m ijDhbBnsCKBGDO0bdWYihBUt5W1gfbjiSrd1Jq5PFCEgh0Gj5FlzIWBbKQYwKb0dv8Gh7d1keoZ1h YzX7912M7fpzt4L3tjuaJjBHAeJsCZtmufNJtyFHle0Meqxow4SK7rZYMQWp3IVIkBHoINxOLUUMU PJeXxPqbGozRm6NzRAV2gtS2LA494hrpFZf9t+IfSLRcLq4cWJwZPeKYUoBGDICNHvHy6LdwM9ubt VyeizWRIttN9mE0YBS4vkHsCkT3h/YTjqNMgt6h88wjMkDCEQgdHMS9U87dXxWRhFMcPRf9zIDxIM DsgJh7G1NKC7nm3OeC4kIg==; 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 1pRwR7-0006hf-Hy; Tue, 14 Feb 2023 09:37:38 -0500 In-Reply-To: <0f053182b02103503c26@heytings.org> (message from Gregory Heytings on Tue, 14 Feb 2023 10:30:13 +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:255594 Archived-At: > Date: Tue, 14 Feb 2023 10:30:13 +0000 > From: Gregory Heytings > cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca, akrl@sdf.org > > 1. There are three places (indent.c:line_number_display_width, > xdisp.c:display_count_lines_logically, fileio.c:write_region) where we > currently use > > record_unwind_protect (save_restriction_restore, save_restriction_save ()); > Fwiden (); I'm not sure these should be subject to locked narrowing. They don't present performance problems with very long lines, AFAIK. > 2. In another place (process.c:Finternal_default_process_filter) we > currently have: > > /* If the output marker is outside of the visible region, save > the restriction and widen. */ > if (! (BEGV <= PT && PT <= ZV)) > Fwiden (); > > (without the "save the restriction" mentioned in the comment). This should be fixed to use unwind-protect of some kind, I think, and that's orthogonal to locked narrowing. > 3. Also, in Ferase_buffer, we do Fwiden to "delete the entire contents of > the current buffer". > > These five places probably need to be adapted to handle labeled narrowings > correctly. If you agree with that, I'll write a patch to that effect. I'm not sure what you mean by "adapt to". Please tell more.