aboutsummaryrefslogtreecommitdiffstats
path: root/src/undo.c
diff options
context:
space:
mode:
authorKen Raeburn1999-09-13 03:35:33 +0000
committerKen Raeburn1999-09-13 03:35:33 +0000
commitc1d497be7013fb68603021cfbd77ec34a9938d0b (patch)
tree14b121ea82a13cb33c4cf35c1dd32f850b9f5458 /src/undo.c
parent03699b140e13aee5b49fa4678e97dff5855e789c (diff)
downloademacs-c1d497be7013fb68603021cfbd77ec34a9938d0b.tar.gz
emacs-c1d497be7013fb68603021cfbd77ec34a9938d0b.zip
Use XCAR and XCDR instead of explicit member access.
Diffstat (limited to 'src/undo.c')
-rw-r--r--src/undo.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/undo.c b/src/undo.c
index 86bcdc9977d..51eaa5a2d8d 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -66,13 +66,13 @@ record_insert (beg, length)
66 if (CONSP (current_buffer->undo_list)) 66 if (CONSP (current_buffer->undo_list))
67 { 67 {
68 Lisp_Object elt; 68 Lisp_Object elt;
69 elt = XCONS (current_buffer->undo_list)->car; 69 elt = XCAR (current_buffer->undo_list);
70 if (CONSP (elt) 70 if (CONSP (elt)
71 && INTEGERP (XCONS (elt)->car) 71 && INTEGERP (XCAR (elt))
72 && INTEGERP (XCONS (elt)->cdr) 72 && INTEGERP (XCDR (elt))
73 && XINT (XCONS (elt)->cdr) == beg) 73 && XINT (XCDR (elt)) == beg)
74 { 74 {
75 XSETINT (XCONS (elt)->cdr, beg + length); 75 XSETINT (XCDR (elt), beg + length);
76 return; 76 return;
77 } 77 }
78 } 78 }
@@ -114,10 +114,10 @@ record_delete (beg, string)
114 114
115 while (1) 115 while (1)
116 { 116 {
117 elt = XCONS (tail)->car; 117 elt = XCAR (tail);
118 if (NILP (elt) || ! (CONSP (elt) && MARKERP (XCONS (elt)->car))) 118 if (NILP (elt) || ! (CONSP (elt) && MARKERP (XCAR (elt))))
119 break; 119 break;
120 tail = XCONS (tail)->cdr; 120 tail = XCDR (tail);
121 } 121 }
122 at_boundary = NILP (elt); 122 at_boundary = NILP (elt);
123 } 123 }
@@ -264,7 +264,7 @@ but another undo command will undo to the previous boundary.")
264 { 264 {
265 /* If we have preallocated the cons cell to use here, 265 /* If we have preallocated the cons cell to use here,
266 use that one. */ 266 use that one. */
267 XCONS (pending_boundary)->cdr = current_buffer->undo_list; 267 XCDR (pending_boundary) = current_buffer->undo_list;
268 current_buffer->undo_list = pending_boundary; 268 current_buffer->undo_list = pending_boundary;
269 pending_boundary = Qnil; 269 pending_boundary = Qnil;
270 } 270 }
@@ -298,33 +298,33 @@ truncate_undo_list (list, minsize, maxsize)
298 Skip, skip, skip the undo, skip, skip, skip the undo, 298 Skip, skip, skip the undo, skip, skip, skip the undo,
299 Skip, skip, skip the undo, skip to the undo bound'ry. 299 Skip, skip, skip the undo, skip to the undo bound'ry.
300 (Get it? "Skip to my Loo?") */ 300 (Get it? "Skip to my Loo?") */
301 if (CONSP (next) && NILP (XCONS (next)->car)) 301 if (CONSP (next) && NILP (XCAR (next)))
302 { 302 {
303 /* Add in the space occupied by this element and its chain link. */ 303 /* Add in the space occupied by this element and its chain link. */
304 size_so_far += sizeof (struct Lisp_Cons); 304 size_so_far += sizeof (struct Lisp_Cons);
305 305
306 /* Advance to next element. */ 306 /* Advance to next element. */
307 prev = next; 307 prev = next;
308 next = XCONS (next)->cdr; 308 next = XCDR (next);
309 } 309 }
310 while (CONSP (next) && ! NILP (XCONS (next)->car)) 310 while (CONSP (next) && ! NILP (XCAR (next)))
311 { 311 {
312 Lisp_Object elt; 312 Lisp_Object elt;
313 elt = XCONS (next)->car; 313 elt = XCAR (next);
314 314
315 /* Add in the space occupied by this element and its chain link. */ 315 /* Add in the space occupied by this element and its chain link. */
316 size_so_far += sizeof (struct Lisp_Cons); 316 size_so_far += sizeof (struct Lisp_Cons);
317 if (CONSP (elt)) 317 if (CONSP (elt))
318 { 318 {
319 size_so_far += sizeof (struct Lisp_Cons); 319 size_so_far += sizeof (struct Lisp_Cons);
320 if (STRINGP (XCONS (elt)->car)) 320 if (STRINGP (XCAR (elt)))
321 size_so_far += (sizeof (struct Lisp_String) - 1 321 size_so_far += (sizeof (struct Lisp_String) - 1
322 + XSTRING (XCONS (elt)->car)->size); 322 + XSTRING (XCAR (elt))->size);
323 } 323 }
324 324
325 /* Advance to next element. */ 325 /* Advance to next element. */
326 prev = next; 326 prev = next;
327 next = XCONS (next)->cdr; 327 next = XCDR (next);
328 } 328 }
329 if (CONSP (next)) 329 if (CONSP (next))
330 last_boundary = prev; 330 last_boundary = prev;
@@ -332,7 +332,7 @@ truncate_undo_list (list, minsize, maxsize)
332 while (CONSP (next)) 332 while (CONSP (next))
333 { 333 {
334 Lisp_Object elt; 334 Lisp_Object elt;
335 elt = XCONS (next)->car; 335 elt = XCAR (next);
336 336
337 /* When we get to a boundary, decide whether to truncate 337 /* When we get to a boundary, decide whether to truncate
338 either before or after it. The lower threshold, MINSIZE, 338 either before or after it. The lower threshold, MINSIZE,
@@ -352,14 +352,14 @@ truncate_undo_list (list, minsize, maxsize)
352 if (CONSP (elt)) 352 if (CONSP (elt))
353 { 353 {
354 size_so_far += sizeof (struct Lisp_Cons); 354 size_so_far += sizeof (struct Lisp_Cons);
355 if (STRINGP (XCONS (elt)->car)) 355 if (STRINGP (XCAR (elt)))
356 size_so_far += (sizeof (struct Lisp_String) - 1 356 size_so_far += (sizeof (struct Lisp_String) - 1
357 + XSTRING (XCONS (elt)->car)->size); 357 + XSTRING (XCAR (elt))->size);
358 } 358 }
359 359
360 /* Advance to next element. */ 360 /* Advance to next element. */
361 prev = next; 361 prev = next;
362 next = XCONS (next)->cdr; 362 next = XCDR (next);
363 } 363 }
364 364
365 /* If we scanned the whole list, it is short enough; don't change it. */ 365 /* If we scanned the whole list, it is short enough; don't change it. */
@@ -369,7 +369,7 @@ truncate_undo_list (list, minsize, maxsize)
369 /* Truncate at the boundary where we decided to truncate. */ 369 /* Truncate at the boundary where we decided to truncate. */
370 if (!NILP (last_boundary)) 370 if (!NILP (last_boundary))
371 { 371 {
372 XCONS (last_boundary)->cdr = Qnil; 372 XCDR (last_boundary) = Qnil;
373 return list; 373 return list;
374 } 374 }
375 else 375 else