unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Gregory Heytings <gregory@heytings.org>
Cc: acohen@ust.hk, 64391@debbugs.gnu.org,
	mattias.engdegard@gmail.com, eliz@gnu.org
Subject: bug#64391: buffer narrowing slowdown regression in emacs 29
Date: Fri, 07 Jul 2023 11:49:19 -0400	[thread overview]
Message-ID: <jwvpm53wx84.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <e642cb1e373857526eb2@heytings.org> (Gregory Heytings's message of "Fri, 07 Jul 2023 12:42:28 +0000")

> 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))






  reply	other threads:[~2023-07-07 15:49 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  0:15 bug#64391: 30.0.50; buffer narrowing slowdown regression in emacs 29 Andrew Cohen
2023-07-01  2:45 ` bug#64391: bug 64391 wrong git info Andrew Cohen
2023-07-01  4:59 ` bug#64391: more info Andrew Cohen
2023-07-01 11:37   ` bug#64391: buffer narrowing slowdown regression in emacs 29 Mattias Engdegård
2023-07-01 12:08     ` Eli Zaretskii
2023-07-01 12:52       ` Mattias Engdegård
2023-07-02  7:35         ` Gregory Heytings
2023-07-05 11:57           ` Eli Zaretskii
2023-07-06 14:41             ` Gregory Heytings
2023-07-06 17:33               ` Gregory Heytings
2023-07-06 18:22                 ` Eli Zaretskii
2023-07-06 18:45                   ` Gregory Heytings
2023-07-07  9:30                     ` Mattias Engdegård
2023-07-07 10:00                       ` Gregory Heytings
2023-07-07 10:23                         ` Eli Zaretskii
2023-07-07 10:31                           ` Gregory Heytings
2023-07-07 12:41                             ` Eli Zaretskii
2023-07-07 12:46                               ` Gregory Heytings
2023-07-07 11:33                         ` Mattias Engdegård
2023-07-07 12:42                           ` Gregory Heytings
2023-07-07 15:49                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-07-08 20:58                               ` Gregory Heytings
2023-07-08 21:42                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-08 22:21                                   ` Gregory Heytings
2023-07-08 23:22                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-09 16:03                                       ` Gregory Heytings
2023-07-09 18:57                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-09  6:03                                     ` Eli Zaretskii
2023-07-09  8:35                                       ` Gregory Heytings
2023-07-09  8:52                                         ` Eli Zaretskii
2023-07-09 16:04                                           ` Gregory Heytings
2023-07-09 16:39                                             ` Eli Zaretskii
2023-07-09 18:03                                               ` Gregory Heytings
2023-07-09 18:52                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-09 19:19                                                   ` Gregory Heytings
2023-07-09 19:42                                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-09 19:44                                                       ` Gregory Heytings
2023-07-09 19:03                                                 ` Eli Zaretskii
2023-07-09 19:06                                                   ` Eli Zaretskii
2023-07-09 19:29                                                     ` Gregory Heytings
2023-07-07 10:27                       ` Eli Zaretskii
2023-07-07 11:27                         ` Mattias Engdegård
2023-07-07 12:50                           ` Eli Zaretskii
2023-07-07 16:49                             ` Mattias Engdegård
2023-07-07 18:22                               ` Eli Zaretskii
2023-07-08  8:01                 ` Eli Zaretskii
2023-07-08 19:41                   ` Gregory Heytings
2023-07-02  9:37         ` Mattias Engdegård
2023-07-01  7:07 ` bug#64391: 30.0.50; " Eli Zaretskii
2023-07-01  7:31   ` Andrew Cohen
2023-07-01  8:09     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvpm53wx84.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64391@debbugs.gnu.org \
    --cc=acohen@ust.hk \
    --cc=eliz@gnu.org \
    --cc=gregory@heytings.org \
    --cc=mattias.engdegard@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).