- while (CONSP (functions))
- {
- call3 (XCONS (functions)->car,
- make_number (pos), make_number (pos + lenins),
- make_number (lendel));
- functions = XCONS (functions)->cdr;
- }
- unbind_to (count, Qnil);
+ if (!NILP (current_buffer->overlays_before)
+ || !NILP (current_buffer->overlays_after))
+ report_overlay_modification (make_number (pos),
+ make_number (pos + lenins),
+ 1,
+ make_number (pos), make_number (pos + lenins),
+ make_number (lendel));
+
+ /* After an insertion, call the text properties
+ insert-behind-hooks or insert-in-front-hooks. */
+ if (lendel == 0)
+ report_interval_modification (pos, pos + lenins);
+}
+
+Lisp_Object
+Fcombine_after_change_execute_1 (val)
+ Lisp_Object val;
+{
+ Vcombine_after_change_calls = val;
+ return val;
+}
+
+DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
+ Scombine_after_change_execute, 0, 0, 0,
+ "This function is for use internally in `combine-after-change-calls'.")
+ ()
+{
+ register Lisp_Object val;
+ int count = specpdl_ptr - specpdl;
+ int beg, end, change;
+ int begpos, endpos;
+ Lisp_Object tail;
+
+ record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+
+ Fset_buffer (combine_after_change_buffer);
+
+ /* # chars unchanged at beginning of buffer. */
+ beg = Z - BEG;
+ /* # chars unchanged at end of buffer. */
+ end = beg;
+ /* Total amount of insertion (negative for deletion). */
+ change = 0;
+
+ /* Scan the various individual changes,
+ accumulating the range info in BEG, END and CHANGE. */
+ for (tail = combine_after_change_list; CONSP (tail);
+ tail = XCONS (tail)->cdr)
+ {
+ Lisp_Object elt;
+ int thisbeg, thisend, thischange;
+
+ /* Extract the info from the next element. */
+ elt = XCONS (tail)->car;
+ if (! CONSP (elt))
+ continue;
+ thisbeg = XINT (XCONS (elt)->car);
+
+ elt = XCONS (elt)->cdr;
+ if (! CONSP (elt))
+ continue;
+ thisend = XINT (XCONS (elt)->car);
+
+ elt = XCONS (elt)->cdr;
+ if (! CONSP (elt))
+ continue;
+ thischange = XINT (XCONS (elt)->car);
+
+ /* Merge this range into the accumulated range. */
+ change += thischange;
+ if (thisbeg < beg)
+ beg = thisbeg;
+ if (thisend < end)
+ end = thisend;