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#64391: buffer narrowing slowdown regression in emacs 29 Date: Fri, 07 Jul 2023 10:00:48 +0000 Message-ID: References: <87r0psb51z.fsf@ust.hk> <0AD15A09-F669-48C0-AF5C-971D52F5BF8E@gmail.com> <83v8f3q1ff.fsf@gnu.org> <50A46AAC-2089-45CB-A355-CCB2B4EA8D76@gmail.com> <5995c9ed6a0b39c3070c@heytings.org> <83a5wak1tr.fsf@gnu.org> <26cee506f708f3c6cfe1@heytings.org> <26cee506f70bbc9de58b@heytings.org> <83h6qghpdc.fsf@gnu.org> <26cee506f77e9c87e325@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6CfoV80V1X" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acohen@ust.hk, 64391@debbugs.gnu.org, eliz@gnu.org, monnier@iro.umontreal.ca To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 07 12:01:24 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 1qHiHE-000ADi-Bd for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jul 2023 12:01:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHiGu-0006R3-5a; Fri, 07 Jul 2023 06:01:04 -0400 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 1qHiGs-0006QW-QZ for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 06:01:02 -0400 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 1qHiGs-0006te-I8 for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 06:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qHiGs-0004iN-2x; Fri, 07 Jul 2023 06:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 07 Jul 2023 10:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64391 X-GNU-PR-Package: emacs,gnus X-Debbugs-Original-Cc: acohen@ust.hk, 64391@debbugs.gnu.org, Eli Zaretskii , monnier@iro.umontreal.ca, bugs@gnus.org Original-Received: via spool by 64391-submit@debbugs.gnu.org id=B64391.168872405618102 (code B ref 64391); Fri, 07 Jul 2023 10:01:02 +0000 Original-Received: (at 64391) by debbugs.gnu.org; 7 Jul 2023 10:00:56 +0000 Original-Received: from localhost ([127.0.0.1]:42576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHiGm-0004ht-1t for submit@debbugs.gnu.org; Fri, 07 Jul 2023 06:00:56 -0400 Original-Received: from heytings.org ([95.142.160.155]:44314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHiGg-0004hi-Fd for 64391@debbugs.gnu.org; Fri, 07 Jul 2023 06:00:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1688724049; bh=g7H16IVVxkw3ioxqLLtILU11ZU1fBdS8OsCTyp49RN8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=WNasf7RzJdPGYKHb5xiBdbm1XHP58Y8EkFFpcHbx4mzkGSR+FPsdcw1M5WASXD6CU kBMEePJLfD0j+91Dsvbp8z8OoZOcgV5Lwz2Hy6SICKfud84RKf8+YNEHxSA0Ef21fl XFrIy8U7ZS0LziIEW7eESijR5+ofaTMUjmwU0lWGkNOTObySwPxKn7kJ7uCqMC3Yvc VzB8ezV2OhRN/K/PFIC5DocFAVnp+yLfDFDLvQw7SlRs7IGoagjyg+iJO2H5DRtciZ m6SPY51ya6JOo6vpb4uTmKnDiAwH/3Wk35DD2dsaxUsRxdd3aSRjnMyZF0v+ftFsNY u0Z5C1+oWILZA== In-Reply-To: Content-ID: 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:264711 Archived-At: --6CfoV80V1X Content-Type: text/plain; charset=us-ascii; format=flowed Content-ID: Thanks for your feedback! > > I have one question about the new `with-restriction` macro: if it is > intended as a convenience macro for unlabelled narrowing as well, > shouldn't it then expand to the obvious > > (save-restriction > (narrow-to-region BEG END) > BODY) > > instead the much more expensive call to a helper function? > Yes. In fact now that we have a separate function for the labeled case, we can remove the funcall in both cases. Patch attached. > > The documentation should also make it clear that `nil` is not a valid > label. > Is that not already clear in the docstring, which says "in which LABEL is a symbol"? --6CfoV80V1X Content-Type: text/x-diff; name=Simplify-with-restriction-and-without-restriction.patch; charset=us-ascii Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment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