Subject: Re: bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing.

From: Eli Zaretskii <[email-masked]>
Date: Thu, 09 Feb 2023 17:46:24 +0200

> Date: Thu, 09 Feb 2023 14:39:39 +0000
> From: Gregory Heytings <[email-masked]>
> cc: [email-masked], [email-masked], [email-masked]
> 
> > There's one thing I cannot seem to be able to find in the documentation 
> > you added: how can a Lisp program know that it is being run under a 
> > "labeled narrowing",
> 
> A function/macro to check that could indeed be added, its body would be:
> 
> (save-restriction (widen) (buffer-narrowed-p))

We should add it and document it, but I'm surprised that there's no
easier way.  One problem with the above is that it could cause a more
thorough redisplay because it fiddles with buffer restrictions.

Also, this doesn't return the label itself.

> > and in particular what is the label? Without knowing that, how can Lisp 
> > programs adapt their behavior to this special kind of narrowing, or even 
> > just break out of it using without-narrowing?
> 
> That information should be given in the docstring of the function that 
> creates that narrowing.  It is now present in the docstrings of the three 
> hooks where it is used:

Yes, but how do I know which one of these is in effect when my
function is called?