Commit 213861c7 authored by Jim Blandy's avatar Jim Blandy
Browse files

* undo.c (record_insert): Use accessors on BEG and LENGTH.

	(truncate_undo_list): Use NILP, not == Qnil.
parent d084e942
...@@ -54,16 +54,17 @@ record_insert (beg, length) ...@@ -54,16 +54,17 @@ record_insert (beg, length)
if (XTYPE (elt) == Lisp_Cons if (XTYPE (elt) == Lisp_Cons
&& XTYPE (XCONS (elt)->car) == Lisp_Int && XTYPE (XCONS (elt)->car) == Lisp_Int
&& XTYPE (XCONS (elt)->cdr) == Lisp_Int && XTYPE (XCONS (elt)->cdr) == Lisp_Int
&& XINT (XCONS (elt)->cdr) == beg) && XINT (XCONS (elt)->cdr) == XINT (beg))
{ {
XSETINT (XCONS (elt)->cdr, beg + length); XSETINT (XCONS (elt)->cdr, XINT (beg) + XINT (length));
return; return;
} }
} }
XFASTINT (lbeg) = beg; lbeg = beg;
XFASTINT (lend) = beg + length; XSET (lend, Lisp_Int, XINT (beg) + XINT (length));
current_buffer->undo_list = Fcons (Fcons (lbeg, lend), current_buffer->undo_list); current_buffer->undo_list = Fcons (Fcons (lbeg, lend),
current_buffer->undo_list);
} }
/* Record that a deletion is about to take place, /* Record that a deletion is about to take place,
...@@ -163,7 +164,7 @@ truncate_undo_list (list, minsize, maxsize) ...@@ -163,7 +164,7 @@ truncate_undo_list (list, minsize, maxsize)
Skip, skip, skip the undo, skip to the undo bound'ry. Skip, skip, skip the undo, skip to the undo bound'ry.
(Get it? "Skip to my Loo?") */ (Get it? "Skip to my Loo?") */
if (XTYPE (next) == Lisp_Cons if (XTYPE (next) == Lisp_Cons
&& XCONS (next)->car == Qnil) && NILP (XCONS (next)->car))
{ {
/* Add in the space occupied by this element and its chain link. */ /* Add in the space occupied by this element and its chain link. */
size_so_far += sizeof (struct Lisp_Cons); size_so_far += sizeof (struct Lisp_Cons);
...@@ -173,7 +174,7 @@ truncate_undo_list (list, minsize, maxsize) ...@@ -173,7 +174,7 @@ truncate_undo_list (list, minsize, maxsize)
next = XCONS (next)->cdr; next = XCONS (next)->cdr;
} }
while (XTYPE (next) == Lisp_Cons while (XTYPE (next) == Lisp_Cons
&& XCONS (next)->car != Qnil) && ! NILP (XCONS (next)->car))
{ {
Lisp_Object elt; Lisp_Object elt;
elt = XCONS (next)->car; elt = XCONS (next)->car;
......
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