unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* What should I use to unrestrict a buffer?
@ 2024-01-24 20:12 hw
  2024-01-25  7:14 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: hw @ 2024-01-24 20:12 UTC (permalink / raw)
  To: help-gnu-emacs

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.







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-08  5:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24 20:12 What should I use to unrestrict a buffer? hw
2024-01-25  7:14 ` Eli Zaretskii
2024-01-25 18:30   ` hw
2024-01-25 19:03     ` Eli Zaretskii
2024-02-08  5:38       ` hw

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