Function: widen
widen is an interactive function defined in editfns.c.
Signature
(widen)
Documentation
Remove restrictions (narrowing) from current buffer.
This allows the buffer's full text to be seen and edited.
However, when restrictions have been set by with-restriction with a
label, widen restores the narrowing limits set by with-restriction.
To gain access to other portions of the buffer, use
without-restriction with the same label.
Probably introduced at or before Emacs version 19.1.
Key Bindings
Source Code
// Defined in /usr/src/emacs/src/editfns.c
{
Lisp_Object buf = Fcurrent_buffer ();
Lisp_Object label = labeled_restrictions_peek_label (buf);
if (NILP (label))
{
if (BEG != BEGV || Z != ZV)
current_buffer->clip_changed = 1;
BEGV = BEG;
BEGV_BYTE = BEG_BYTE;
SET_BUF_ZV_BOTH (current_buffer, Z, Z_BYTE);
}
else
{
Lisp_Object begv = labeled_restrictions_get_bound (buf, true, false);
Lisp_Object zv = labeled_restrictions_get_bound (buf, false, false);
eassert (! NILP (begv) && ! NILP (zv));
ptrdiff_t begv_charpos = marker_position (begv);
ptrdiff_t zv_charpos = marker_position (zv);
if (begv_charpos != BEGV || zv_charpos != ZV)
current_buffer->clip_changed = 1;
SET_BUF_BEGV_BOTH (current_buffer,
begv_charpos, marker_byte_position (begv));
SET_BUF_ZV_BOTH (current_buffer,
zv_charpos, marker_byte_position (zv));
/* If the only remaining bounds in labeled_restrictions for
current_buffer are the bounds that were set by the user, no
labeled restriction is in effect in current_buffer anymore:
remove it from the labeled_restrictions alist. */
if (BASE_EQ (label, Qoutermost_restriction))
labeled_restrictions_pop (buf);
}
/* Changing the buffer bounds invalidates any recorded current column. */
invalidate_current_column ();
return Qnil;
}