(2) POS is the last of the current buffer.
(3) A character at POS can't be a following byte of multibyte
character. */
- if (length > 0 && ASCII_BYTE_P (string[length - 1])) /* case (1) */
+ if (length > 0 && ASCII_CHAR_P (string[length - 1])) /* case (1) */
return 0;
if (pos_byte == Z_BYTE) /* case (2) */
return 0;
Lisp_Object start_marker, end_marker;
Lisp_Object preserve_marker;
struct gcpro gcpro1, gcpro2, gcpro3;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct rvoe_arg rvoe_arg;
start = make_number (start_int);
FETCH_START, FETCH_END, Qnil);
}
- if (! NILP (start_marker))
- free_marker (start_marker);
- if (! NILP (end_marker))
- free_marker (end_marker);
RESTORE_VALUE;
UNGCPRO;
- unbind_to (count, Qnil);
+ dynwind_end ();
}
/* Signal a change immediately after it happens.
void
signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
struct rvoe_arg rvoe_arg;
- if (inhibit_modification_hooks)
+ if (inhibit_modification_hooks) {
+ dynwind_end ();
return;
+ }
/* If we are deferring calls to the after-change functions
and there are no before-change functions,
= Fcons (elt, combine_after_change_list);
combine_after_change_buffer = Fcurrent_buffer ();
+ dynwind_end ();
return;
}
report_interval_modification (make_number (charpos),
make_number (charpos + lenins));
- unbind_to (count, Qnil);
+ dynwind_end ();
}
static void
doc: /* This function is for use internally in the function `combine-after-change-calls'. */)
(void)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
ptrdiff_t beg, end, change;
ptrdiff_t begpos, endpos;
Lisp_Object tail;
- if (NILP (combine_after_change_list))
+ if (NILP (combine_after_change_list)) {
+ dynwind_end ();
return Qnil;
+ }
/* It is rare for combine_after_change_buffer to be invalid, but
possible. It can happen when combine-after-change-calls is
|| !BUFFER_LIVE_P (XBUFFER (combine_after_change_buffer)))
{
combine_after_change_list = Qnil;
+ dynwind_end ();
return Qnil;
}
signal_after_change (begpos, endpos - begpos - change, endpos - begpos);
update_compositions (begpos, endpos, CHECK_ALL);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
\f
void
syms_of_insdel (void)
{
+#include "insdel.x"
+
staticpro (&combine_after_change_list);
staticpro (&combine_after_change_buffer);
combine_after_change_list = Qnil;
DEFSYM (Qinhibit_modification_hooks, "inhibit-modification-hooks");
DEFSYM (Qregion_extract_function, "region-extract-function");
-
- defsubr (&Scombine_after_change_execute);
}