bset_point_before_scroll (current_buffer, Qnil);
}
+/* Signal that we are about to make a change that may result in new
+ undo information.
+ */
+static void
+run_undoable_change (void)
+{
+ if (EQ (BVAR (current_buffer, undo_list), Qt))
+ return;
+
+ call0 (Qundo_auto__undoable_change);
+}
+
/* Check that it is okay to modify the buffer between START and END,
which are char positions.
if (!NILP (BVAR (current_buffer, read_only)))
Fbarf_if_buffer_read_only (temp);
+ run_undoable_change();
+
bset_redisplay (current_buffer);
if (buffer_intervals (current_buffer))
combine_after_change_list = Qnil;
combine_after_change_buffer = Qnil;
+ DEFSYM (Qundo_auto__undoable_change, "undo-auto--undoable-change");
+
DEFVAR_LISP ("combine-after-change-calls", Vcombine_after_change_calls,
doc: /* Used internally by the function `combine-after-change-calls' macro. */);
Vcombine_after_change_calls = Qnil;
an undo-boundary. */
static Lisp_Object pending_boundary;
-static void
-run_undoable_change (void)
-{
- call0 (Qundo_auto__undoable_change);
-}
-
/* Record point as it was at beginning of this command (if necessary)
and prepare the undo info for recording a change.
PT is the position of point that will naturally occur as a result of the
if (NILP (pending_boundary))
pending_boundary = Fcons (Qnil, Qnil);
- run_undoable_change ();
-
at_boundary = ! CONSP (BVAR (current_buffer, undo_list))
|| NILP (XCAR (BVAR (current_buffer, undo_list)));
if (NILP (pending_boundary))
pending_boundary = Fcons (Qnil, Qnil);
- run_undoable_change ();
-
for (m = BUF_MARKERS (current_buffer); m; m = m->next)
{
charpos = m->charpos;
if (NILP (pending_boundary))
pending_boundary = Fcons (Qnil, Qnil);
- /* Switch temporarily to the buffer that was changed. */
- set_buffer_internal (buf);
-
- run_undoable_change ();
-
if (MODIFF <= SAVE_MODIFF)
record_first_change ();
entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend))));
bset_undo_list (current_buffer,
Fcons (entry, BVAR (current_buffer, undo_list)));
-
- /* Reset the buffer */
- set_buffer_internal (obuf);
}
DEFUN ("undo-boundary", Fundo_boundary, Sundo_boundary, 0, 0, 0,
syms_of_undo (void)
{
DEFSYM (Qinhibit_read_only, "inhibit-read-only");
- DEFSYM (Qundo_auto__undoable_change, "undo-auto--undoable-change");
DEFSYM (Qundo_auto__last_boundary_cause, "undo-auto--last-boundary-cause");
DEFSYM (Qexplicit, "explicit");