help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What should I use to unrestrict a buffer?


From: hw
Subject: What should I use to unrestrict a buffer?
Date: Wed, 24 Jan 2024 21:12:56 +0100
User-agent: Evolution 3.50.3 (3.50.3-1.fc39)

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.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]