all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.