diff options
| author | Jim Blandy | 1992-10-31 05:39:17 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-10-31 05:39:17 +0000 |
| commit | 213861c758e02024c33e51b0c0f1e21152d412c6 (patch) | |
| tree | 485054d5e9e4467a2ae1e6d5b1ea7c84ddf257ec | |
| parent | d084e9427ff5c524cca4e079dc2d72713e280d5c (diff) | |
| download | emacs-213861c758e02024c33e51b0c0f1e21152d412c6.tar.gz emacs-213861c758e02024c33e51b0c0f1e21152d412c6.zip | |
* undo.c (record_insert): Use accessors on BEG and LENGTH.
(truncate_undo_list): Use NILP, not == Qnil.
| -rw-r--r-- | src/undo.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/undo.c b/src/undo.c index bc59c25a62d..53dc6ae2c54 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -54,16 +54,17 @@ record_insert (beg, length) | |||
| 54 | if (XTYPE (elt) == Lisp_Cons | 54 | if (XTYPE (elt) == Lisp_Cons |
| 55 | && XTYPE (XCONS (elt)->car) == Lisp_Int | 55 | && XTYPE (XCONS (elt)->car) == Lisp_Int |
| 56 | && XTYPE (XCONS (elt)->cdr) == Lisp_Int | 56 | && XTYPE (XCONS (elt)->cdr) == Lisp_Int |
| 57 | && XINT (XCONS (elt)->cdr) == beg) | 57 | && XINT (XCONS (elt)->cdr) == XINT (beg)) |
| 58 | { | 58 | { |
| 59 | XSETINT (XCONS (elt)->cdr, beg + length); | 59 | XSETINT (XCONS (elt)->cdr, XINT (beg) + XINT (length)); |
| 60 | return; | 60 | return; |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | XFASTINT (lbeg) = beg; | 64 | lbeg = beg; |
| 65 | XFASTINT (lend) = beg + length; | 65 | XSET (lend, Lisp_Int, XINT (beg) + XINT (length)); |
| 66 | current_buffer->undo_list = Fcons (Fcons (lbeg, lend), current_buffer->undo_list); | 66 | current_buffer->undo_list = Fcons (Fcons (lbeg, lend), |
| 67 | current_buffer->undo_list); | ||
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | /* Record that a deletion is about to take place, | 70 | /* Record that a deletion is about to take place, |
| @@ -163,7 +164,7 @@ truncate_undo_list (list, minsize, maxsize) | |||
| 163 | Skip, skip, skip the undo, skip to the undo bound'ry. | 164 | Skip, skip, skip the undo, skip to the undo bound'ry. |
| 164 | (Get it? "Skip to my Loo?") */ | 165 | (Get it? "Skip to my Loo?") */ |
| 165 | if (XTYPE (next) == Lisp_Cons | 166 | if (XTYPE (next) == Lisp_Cons |
| 166 | && XCONS (next)->car == Qnil) | 167 | && NILP (XCONS (next)->car)) |
| 167 | { | 168 | { |
| 168 | /* Add in the space occupied by this element and its chain link. */ | 169 | /* Add in the space occupied by this element and its chain link. */ |
| 169 | size_so_far += sizeof (struct Lisp_Cons); | 170 | size_so_far += sizeof (struct Lisp_Cons); |
| @@ -173,7 +174,7 @@ truncate_undo_list (list, minsize, maxsize) | |||
| 173 | next = XCONS (next)->cdr; | 174 | next = XCONS (next)->cdr; |
| 174 | } | 175 | } |
| 175 | while (XTYPE (next) == Lisp_Cons | 176 | while (XTYPE (next) == Lisp_Cons |
| 176 | && XCONS (next)->car != Qnil) | 177 | && ! NILP (XCONS (next)->car)) |
| 177 | { | 178 | { |
| 178 | Lisp_Object elt; | 179 | Lisp_Object elt; |
| 179 | elt = XCONS (next)->car; | 180 | elt = XCONS (next)->car; |