Commit ad9cdce4 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fprimitive_undo): Use base buffer's modtime field.

Use SAVE_MODIFF and BUF_SAVE_MODIFF
instead of direct access to the save_modiff field.
parent 3fe8bda5
...@@ -57,7 +57,7 @@ record_insert (beg, length) ...@@ -57,7 +57,7 @@ record_insert (beg, length)
Fundo_boundary (); Fundo_boundary ();
XSETBUFFER (last_undo_buffer, current_buffer); XSETBUFFER (last_undo_buffer, current_buffer);
if (MODIFF <= current_buffer->save_modified) if (MODIFF <= SAVE_MODIFF)
record_first_change (); record_first_change ();
/* If this is following another insertion and consecutive with it /* If this is following another insertion and consecutive with it
...@@ -105,7 +105,7 @@ record_delete (beg, length) ...@@ -105,7 +105,7 @@ record_delete (beg, length)
at_boundary = (CONSP (current_buffer->undo_list) at_boundary = (CONSP (current_buffer->undo_list)
&& NILP (XCONS (current_buffer->undo_list)->car)); && NILP (XCONS (current_buffer->undo_list)->car));
if (MODIFF <= current_buffer->save_modified) if (MODIFF <= SAVE_MODIFF)
record_first_change (); record_first_change ();
if (point == beg + length) if (point == beg + length)
...@@ -146,6 +146,7 @@ record_change (beg, length) ...@@ -146,6 +146,7 @@ record_change (beg, length)
record_first_change () record_first_change ()
{ {
Lisp_Object high, low; Lisp_Object high, low;
struct buffer *base_buffer = current_buffer;
if (EQ (current_buffer->undo_list, Qt)) if (EQ (current_buffer->undo_list, Qt))
return; return;
...@@ -154,8 +155,11 @@ record_first_change () ...@@ -154,8 +155,11 @@ record_first_change ()
Fundo_boundary (); Fundo_boundary ();
XSETBUFFER (last_undo_buffer, current_buffer); XSETBUFFER (last_undo_buffer, current_buffer);
XSETFASTINT (high, (current_buffer->modtime >> 16) & 0xffff); if (base_buffer->base_buffer)
XSETFASTINT (low, current_buffer->modtime & 0xffff); base_buffer = base_buffer->base_buffer;
XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff);
XSETFASTINT (low, base_buffer->modtime & 0xffff);
current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list); current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list);
} }
...@@ -187,7 +191,7 @@ record_property_change (beg, length, prop, value, buffer) ...@@ -187,7 +191,7 @@ record_property_change (beg, length, prop, value, buffer)
if (boundary) if (boundary)
Fundo_boundary (); Fundo_boundary ();
if (MODIFF <= current_buffer->save_modified) if (MODIFF <= SAVE_MODIFF)
record_first_change (); record_first_change ();
XSETINT (lbeg, beg); XSETINT (lbeg, beg);
...@@ -380,14 +384,19 @@ Return what remains of the list.") ...@@ -380,14 +384,19 @@ Return what remains of the list.")
/* Element (t high . low) records previous modtime. */ /* Element (t high . low) records previous modtime. */
Lisp_Object high, low; Lisp_Object high, low;
int mod_time; int mod_time;
struct buffer *base_buffer = current_buffer;
high = Fcar (cdr); high = Fcar (cdr);
low = Fcdr (cdr); low = Fcdr (cdr);
mod_time = (XFASTINT (high) << 16) + XFASTINT (low); mod_time = (XFASTINT (high) << 16) + XFASTINT (low);
if (current_buffer->base_buffer)
base_buffer = current_buffer->base_buffer;
/* If this records an obsolete save /* If this records an obsolete save
(not matching the actual disk file) (not matching the actual disk file)
then don't mark unmodified. */ then don't mark unmodified. */
if (mod_time != current_buffer->modtime) if (mod_time != base_buffer->modtime)
break; break;
#ifdef CLASH_DETECTION #ifdef CLASH_DETECTION
Funlock_buffer (); Funlock_buffer ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment