unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: hw <hw@adminart.net>
To: help-gnu-emacs@gnu.org
Subject: What should I use to unrestrict a buffer?
Date: Wed, 24 Jan 2024 21:12:56 +0100	[thread overview]
Message-ID: <4df85194384c642c3cda3289cd1ac1a20ee42bcc.camel@adminart.net> (raw)

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	other threads:[~2024-01-24 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 20:12 hw [this message]
2024-01-25  7:14 ` What should I use to unrestrict a buffer? Eli Zaretskii
2024-01-25 18:30   ` hw
2024-01-25 19:03     ` Eli Zaretskii
2024-02-08  5:38       ` hw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4df85194384c642c3cda3289cd1ac1a20ee42bcc.camel@adminart.net \
    --to=hw@adminart.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).