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: Sun, 09 Jul 2023 18:03:02 +0000 Message-ID: <17bc58613018aff5cea9@heytings.org> 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> <239e2a5aa11924a2f1d3@heytings.org> <239e2a5aa14d33c1b087@heytings.org> <83jzv9bp0a.fsf@gnu.org> <17bc5861309c808fe41c@heytings.org> <831qhhbh60.fsf@gnu.org> <17bc5861306adf83809a@heytings.org> <837cr99gz1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22129"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acohen@ust.hk, 64391@debbugs.gnu.org, mattias.engdegard@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 09 20:04:19 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 1qIYle-0005Uu-35 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Jul 2023 20:04:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIYlP-0003dp-UT; Sun, 09 Jul 2023 14:04:03 -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 1qIYlO-0003dV-Em for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 14:04: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 1qIYlO-0006Q7-6p for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 14:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qIYlN-0006qs-VD; Sun, 09 Jul 2023 14:04:01 -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: Sun, 09 Jul 2023 18:04:01 +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.engdegard@gmail.com, monnier@iro.umontreal.ca, bugs@gnus.org Original-Received: via spool by 64391-submit@debbugs.gnu.org id=B64391.168892578626266 (code B ref 64391); Sun, 09 Jul 2023 18:04:01 +0000 Original-Received: (at 64391) by debbugs.gnu.org; 9 Jul 2023 18:03:06 +0000 Original-Received: from localhost ([127.0.0.1]:47139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIYkT-0006pY-PO for submit@debbugs.gnu.org; Sun, 09 Jul 2023 14:03:06 -0400 Original-Received: from heytings.org ([95.142.160.155]:47792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIYkR-0006pG-HZ for 64391@debbugs.gnu.org; Sun, 09 Jul 2023 14:03:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1688925782; bh=rzdBpsyMGswGKE2qkBnhWGByc2XU5NzvHjRDrhtab1Y=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=QbBDFMbiHjFumTLKkxT3H0JTF6/uIjXAnUdksmeN2aj/9kNb9aKDmq0DpgE+TmNTb aOXHOZcspAPPjQiPEXuKMC6vNJQDS22Dycxu/GtvbihWM1VmDQcbSDDa72sfiD5v2w z9mHb35iZYaHwDgY20XNcXrE4w8RPibosZzArYHPBPHH4H1JRFDv+0hEICU0fbBAQO jikzeoHVa1SvXPMVigiY/cLqRCnPCU0c+mAPvcwSDSop/oEG3xglOzDat5MEA/uJeB k3Vb9uHFH2i4uhdabizZe/pgKu9bUhYL/tRFRqPKlkJIc2ea+AvxznhMIczcaThqf+ CbakHrxBCQ3qg== In-Reply-To: <837cr99gz1.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:264851 Archived-At: >> On a second thought, I believe its better to not replace LABEL with >> TAG, because that would mean changing that word in many places, >> including places in which such a change would make the text less >> understandable, e.g. the docstring of narrow-to-region: > > LABEL implies a string or a symbol, whereas :label can accept "any > object that is not nil". The description of 'catch' uses TAG. > I know, and I agree that in principle TAG would be better. However all the code and documentation was written with the word "label", and although using a non-symbol is possible, LABEL is intended to be a symbol, not an arbitrary Lisp object. So perhaps the best thing to do would be this: diff --git a/lisp/subr.el b/lisp/subr.el index 0b397b7bebf..c2110cb4bb2 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3972,7 +3972,8 @@ with-restriction \(fn START END [:label LABEL] BODY)" (declare (indent 2) (debug t)) - (if (eq (car rest) :label) + (if (and (eq (car rest) :label) + (symbolp (cadr rest))) `(internal--with-restriction ,start ,end (lambda () ,@(cddr rest)) ,(cadr rest)) `(internal--with-restriction ,start ,end (lambda () ,@rest)))) >> --- a/doc/lispref/positions.texi >> +++ b/doc/lispref/positions.texi >> @@ -1169,9 +1169,10 @@ Narrowing >> >> @cindex labeled narrowing >> @cindex labeled restriction >> -When the optional argument @var{label}, a symbol, is present, the >> -narrowing is @dfn{labeled}. A labeled narrowing differs from a >> -non-labeled one in several ways: >> +When the optional argument @var{label}, which is evaluated to get the >> +label to use and must not be @code{nil}, > > What "must not be nil": the label or the result of its evaluation? > The result of the evaluation of the label argument. I don't know how to make this clearer.