From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: hw <hw@adminart.net>
Newsgroups: gmane.emacs.help
Subject: What should I use to unrestrict a buffer?
Date: Wed, 24 Jan 2024 21:12:56 +0100
Message-ID: <4df85194384c642c3cda3289cd1ac1a20ee42bcc.camel@adminart.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="39512"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Evolution 3.50.3 (3.50.3-1.fc39)
To: help-gnu-emacs@gnu.org
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 24 21:13:37 2024
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geh-help-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 <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rSjct-000A5E-As
	for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Jan 2024 21:13:35 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <help-gnu-emacs-bounces@gnu.org>)
	id 1rSjcQ-0007GU-Dm; Wed, 24 Jan 2024 15:13:06 -0500
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 <hw@adminart.net>) id 1rSjcN-0007GB-Ja
 for help-gnu-emacs@gnu.org; Wed, 24 Jan 2024 15:13:03 -0500
Original-Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.216])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hw@adminart.net>) id 1rSjcK-0000Or-SF
 for help-gnu-emacs@gnu.org; Wed, 24 Jan 2024 15:13:03 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1706127176; cv=none;
 d=strato.com; s=strato-dkim-0002;
 b=mMbrZT/ctgh+j6VD5+mI1BsPEA99fd4bEouV5oSfO83hj4qex7CgobpwSWamhKdupv
 CwfTWOsfw5u/S7DewLUo84QfZ6SMXAVBTMLE/tbiDLvpHnEK/DL9EqV30k8oWUq0Zs6+
 0kmIYz8lfRBekpRtQXwjn8MLT/49b5kFvUWz90XFcaBSHoD6ms29L2NM8zi+oIKp3MBj
 oxm5189rjf/Hh3nYdYFbr+4BVsL3qoBjRG0olHvFgIktJn3CGNKayFbd0L0nlfO63ANh
 nYoHvdb88UvMuKB9aO/YmWfyHnmt8a/j++kOfQa3mBCU0yGh6ifwCQopXLiPJjChwYbJ
 zNLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1706127176;
 s=strato-dkim-0002; d=strato.com;
 h=Date:To:From:Subject:Message-ID:Cc:Date:From:Subject:Sender;
 bh=yWw8ptueuF818wzXWyFmghKZV7dUvgUao+ZSxlF02IE=;
 b=hKMJpINwXPFuC+2qxd4FwU7BGeDVADWKf7RJbJKUBH8uAjkmV//Y2KwWvTZRgQbCYw
 QNnTxEQB+B6D9rkQ1dadyZ/7uPKfY2aQ7CPAQCdvl+AZ8mQYrYmQ1JzBbHj7wy6UbuGn
 /DcRRIwZxUj9Luvi7KKJl5sla2RUE7mAC7fRzkyvg3Sd5YpBSucPd3LefnOLYp2ady1p
 RWcOUZROMFz046EB78g18gIMSRzxgxr9+AlnOvwXxhuxAm1Kznv5FS0vhRw19h9L6Gde
 Dd587yMdq5LDk0sggTA7OZfeBTUdodJ0q6k2KYpkrzWdnWUUe2SObLdIC4+fk6QsEA+s
 7oqA==
ARC-Authentication-Results: i=1; strato.com;
    arc=none;
    dkim=none
X-RZG-CLASS-ID: mo00
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1706127176;
 s=strato-dkim-0002; d=adminart.net;
 h=Date:To:From:Subject:Message-ID:Cc:Date:From:Subject:Sender;
 bh=yWw8ptueuF818wzXWyFmghKZV7dUvgUao+ZSxlF02IE=;
 b=KlU/9qzPfrPYGN7T+eVJ7FhBZ2mcPV+E4EKC/aRRT7SzGgbnsm21H043XzBhbQESdv
 QCEqT2La7XHK9pAYWz44laNLGmLRhOwMOmFX/R1U9a6iTsBgA5hZ6+QCrhaocwRD2TLY
 PUEERkQFwQLfaMVHG6nQgm4cf20TtH7CS7hp8AEsxG0TDOTrfk7b//YikFyNf7ROvz3A
 cLLgu5p35HEmjUCRStHDH1tzT+txbbOKDnpJpN7bIZEvVo2rwly4jPY0qYB4u1toV4rM
 69IRPnitwBN6DYBxI/sPJYUIzUxIs4K6LjCPTdhIkDW0uPu4AMyVVhkx5/Cd7SW/qEy8
 PxNg==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1706127176;
 s=strato-dkim-0003; d=adminart.net;
 h=Date:To:From:Subject:Message-ID:Cc:Date:From:Subject:Sender;
 bh=yWw8ptueuF818wzXWyFmghKZV7dUvgUao+ZSxlF02IE=;
 b=Ogz/94jD02CU1GE2EYIR5VBVtf+G074qDiFjeuRUa66hittqBuaDJsGDOAQeAwb8zf
 3WwsOvevTaX9WQeF20CQ==
X-RZG-AUTH: ":O2kGeEG7b/pS1Ey9Rna9iAZFrfz26y6zbtmqiE/f0+UVPWzfkhbRoUzSCTTNnjIupuXQshKqSmhSDVvony6i1weUKtlbj4WMF+E="
Original-Received: from [IPv6:2a09:8e40:377f:1c00:1:ff:ff:f]
 by smtp.strato.de (RZmta 49.11.2 AUTH)
 with ESMTPSA id U7e39f00OKCu32e
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits))
 (Client did not present a certificate) for <help-gnu-emacs@gnu.org>;
 Wed, 24 Jan 2024 21:12:56 +0100 (CET)
Received-SPF: none client-ip=81.169.146.216; envelope-from=hw@adminart.net;
 helo=mo4-p00-ob.smtp.rzone.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_PASS=-0.001, SPF_NONE=0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
 <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
 <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.help:145799
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/145799>

Hi,

in a function, I would like to remove all restrictions from a buffer
because I want to perform an operation with it that doesn't work well
on it when the buffer is restricted (i. e. narrowed).  Essentially,
the buffer contents are piped through an external program and then get
replaced by its output, using

(shell-command-on-region (point-min) (point-max) ...).

I found that only the part of the buffer is piped and replaced which
the buffer is narrowed to, and that is very undesirable because
everything outside the narrowing gets lost that way.


At first I thought I can just use (widen) to remove the narrowing, but
the documentation of that indicates that there can be more
restrictions, possibly using labels, that can apparently narrow a
buffer.

Can there be other restrictions on a buffer that might interfere?

Also, I don't want possible restrictions to be restored, like
(without-restriction) would do.

So what should I use to unrestrict a buffer?

Is there a way to find out if there are any restrictions that might
interfere?  It might suffice to give a warning message that
restrictions need to be removed before the operation can be performed;
then they could be removed manually.