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

From: Juri Linkov <[email-masked]>
Date: Thu, 09 Feb 2023 19:44:00 +0200

>> >> (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.
>>
>> If necessary, a specific function which does not widen could be added to
>> do that, using narrowing_lock_peek_tag:
>>
>> DEFUN ("...", ...) (void)
>> {
>>    if (NILP (narrowing_lock_peek_tag (Fcurrent_buffer ())))
>>      return Qnil;
>>    else
>>      return Qt;
>> }
>
> I don't see how we can get away without doing something like that.
> And I think it should return the tag itself, not just a boolean flag.

'buffer-narrowed-p' could return different symbols(tags) for narrowing lock.