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#64391: buffer narrowing slowdown regression in emacs 29 Date: Fri, 07 Jul 2023 11:49:19 -0400 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> <06A8380F-08A6-464E-9946-02F8498031EC@gmail.com> 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="12406"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: acohen@ust.hk, 64391@debbugs.gnu.org, mattias.engdegard@gmail.com, eliz@gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 07 17:50:28 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 1qHnj2-00031c-KF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jul 2023 17:50:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHnii-0003zR-5V; Fri, 07 Jul 2023 11:50:08 -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 1qHnid-0003yc-GE for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 11:50:05 -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 1qHnic-0003mw-Rj for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 11:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qHnic-0002SV-4E; Fri, 07 Jul 2023 11:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 07 Jul 2023 15:50: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, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii , bugs@gnus.org Original-Received: via spool by 64391-submit@debbugs.gnu.org id=B64391.16887449699400 (code B ref 64391); Fri, 07 Jul 2023 15:50:02 +0000 Original-Received: (at 64391) by debbugs.gnu.org; 7 Jul 2023 15:49:29 +0000 Original-Received: from localhost ([127.0.0.1]:43643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHni5-0002RY-FY for submit@debbugs.gnu.org; Fri, 07 Jul 2023 11:49:29 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHni3-0002RK-5G for 64391@debbugs.gnu.org; Fri, 07 Jul 2023 11:49:28 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DA4A31000BA; Fri, 7 Jul 2023 11:49:21 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D3C4A10001F; Fri, 7 Jul 2023 11:49:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688744960; bh=xw2Nt3BOQeL4CAccnKuQ9IArXhVRnBjNRRwIXUceiwg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lki51+56gmyhZq8oT8O9uLLuvP1QxUI0lQaM212gaJhHpwAOW/xhpVKiiMj4+78Vp MFN6djKKk+gUBmufqqqBBFziKmPWAa93tT7sUUv2Eq3DgEfwEuLDuDF3c0PYtdj/Yy HO5cEmIUKZbBn2M8gxnjrMSOmBMkqwZiHY94Hre9LiT6v8dqfcGmZ402DXFU+Hq6Gs OhXyX/lnEhUSSP439j8VtJDGs7JKyx1+ntD8PjFSZVYd7nZJxTwMqfaqKy2ZPsdpQz BvUIYj9Z85uLS2yHEFRPekKQDZEkusieJU4rLMZ2JZFWqkArX6s4F0oPlY1zs8HU8w WVyQNslgwEQRg== Original-Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9BD55120377; Fri, 7 Jul 2023 11:49:20 -0400 (EDT) In-Reply-To: (Gregory Heytings's message of "Fri, 07 Jul 2023 12:42:28 +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:264731 Archived-At: > I'm sorry, I don't understand your question. The only way (except by using > internal functions) to enter a labeled restriction is to use the > with-restriction special form with its optional label argument. Nitpick: it's not a special form, it's a macro. There's a *big* difference because adding a special form requires changing `macroexpand-all`, the compiler, yadayada, and it introduces backward incompatibilities with packages doing their own code-walks. > Indeed, but I'd say it's clear enough from the context that "symbol" means > a quoted symbol here. Other nitpick: nil can also be quoted :-) BTW, "LABEL is a symbol" sends the wrong message (a quoted symbol evaluates to a symbol but it's not itself a symbol). IOW the docstring should clarify that LABEL is an expression that's evaluated at runtime (and should return a symbol). While I'm here, is it important that LABEL evaluates to a symbol? Or is it like `catch/throw` where we expect most uses to use a symbol but where any other (non-nil) value works as well? Stefan diff --git a/lisp/subr.el b/lisp/subr.el index 85adef5b689..f8a34796584 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3964,11 +3964,11 @@ with-restriction The current restrictions, if any, are restored upon return. -When the optional :label LABEL argument is present, in which -LABEL is a symbol, inside BODY, `narrow-to-region' and `widen' -can be used only within the START and END limits. To gain access -to other portions of the buffer, use `without-restriction' with the -same LABEL argument. +When the optional :label LABEL argument is present (in which +LABEL evaluates to a non-nil symbol) inside BODY, `narrow-to-region' +and `widen' can be used only within the START and END limits. +To gain access to other portions of the buffer, use `without-restriction' +with the same LABEL argument. \(fn START END [:label LABEL] BODY)" (declare (indent 2) (debug t))