Mercurial > emacs
comparison src/textprop.c @ 25645:a14111a2a100
Use XCAR, XCDR, XFLOAT_DATA instead of explicit member access.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Sun, 12 Sep 1999 05:07:01 +0000 |
parents | 866dad44a275 |
children | 1902e7e63fa7 |
comparison
equal
deleted
inserted
replaced
25644:2ae0f7963ccc | 25645:a14111a2a100 |
---|---|
65 Lisp_Object Qfront_sticky, Qrear_nonsticky; | 65 Lisp_Object Qfront_sticky, Qrear_nonsticky; |
66 | 66 |
67 /* If o1 is a cons whose cdr is a cons, return non-zero and set o2 to | 67 /* If o1 is a cons whose cdr is a cons, return non-zero and set o2 to |
68 the o1's cdr. Otherwise, return zero. This is handy for | 68 the o1's cdr. Otherwise, return zero. This is handy for |
69 traversing plists. */ | 69 traversing plists. */ |
70 #define PLIST_ELT_P(o1, o2) (CONSP (o1) && ((o2)=XCONS (o1)->cdr, CONSP (o2))) | 70 #define PLIST_ELT_P(o1, o2) (CONSP (o1) && ((o2)=XCDR (o1), CONSP (o2))) |
71 | 71 |
72 Lisp_Object Vinhibit_point_motion_hooks; | 72 Lisp_Object Vinhibit_point_motion_hooks; |
73 Lisp_Object Vdefault_text_properties; | 73 Lisp_Object Vdefault_text_properties; |
74 | 74 |
75 /* verify_interval_modification saves insertion hooks here | 75 /* verify_interval_modification saves insertion hooks here |
266 Lisp_Object plist, prop; | 266 Lisp_Object plist, prop; |
267 { | 267 { |
268 Lisp_Object value; | 268 Lisp_Object value; |
269 | 269 |
270 while (PLIST_ELT_P (plist, value)) | 270 while (PLIST_ELT_P (plist, value)) |
271 if (EQ (XCONS (plist)->car, prop)) | 271 if (EQ (XCAR (plist), prop)) |
272 return XCONS (value)->car; | 272 return XCAR (value); |
273 else | 273 else |
274 plist = XCONS (value)->cdr; | 274 plist = XCDR (value); |
275 | 275 |
276 return Qunbound; | 276 return Qunbound; |
277 } | 277 } |
278 | 278 |
279 /* Set the properties of INTERVAL to PROPERTIES, | 279 /* Set the properties of INTERVAL to PROPERTIES, |
291 { | 291 { |
292 /* For each property in the old plist which is missing from PROPERTIES, | 292 /* For each property in the old plist which is missing from PROPERTIES, |
293 or has a different value in PROPERTIES, make an undo record. */ | 293 or has a different value in PROPERTIES, make an undo record. */ |
294 for (sym = interval->plist; | 294 for (sym = interval->plist; |
295 PLIST_ELT_P (sym, value); | 295 PLIST_ELT_P (sym, value); |
296 sym = XCONS (value)->cdr) | 296 sym = XCDR (value)) |
297 if (! EQ (property_value (properties, XCONS (sym)->car), | 297 if (! EQ (property_value (properties, XCAR (sym)), |
298 XCONS (value)->car)) | 298 XCAR (value))) |
299 { | 299 { |
300 record_property_change (interval->position, LENGTH (interval), | 300 record_property_change (interval->position, LENGTH (interval), |
301 XCONS (sym)->car, XCONS (value)->car, | 301 XCAR (sym), XCAR (value), |
302 object); | 302 object); |
303 } | 303 } |
304 | 304 |
305 /* For each new property that has no value at all in the old plist, | 305 /* For each new property that has no value at all in the old plist, |
306 make an undo record binding it to nil, so it will be removed. */ | 306 make an undo record binding it to nil, so it will be removed. */ |
307 for (sym = properties; | 307 for (sym = properties; |
308 PLIST_ELT_P (sym, value); | 308 PLIST_ELT_P (sym, value); |
309 sym = XCONS (value)->cdr) | 309 sym = XCDR (value)) |
310 if (EQ (property_value (interval->plist, XCONS (sym)->car), Qunbound)) | 310 if (EQ (property_value (interval->plist, XCAR (sym)), Qunbound)) |
311 { | 311 { |
312 record_property_change (interval->position, LENGTH (interval), | 312 record_property_change (interval->position, LENGTH (interval), |
313 XCONS (sym)->car, Qnil, | 313 XCAR (sym), Qnil, |
314 object); | 314 object); |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 /* Store new properties. */ | 318 /* Store new properties. */ |
1533 | 1533 |
1534 item = XCAR (list); | 1534 item = XCAR (list); |
1535 end = XCAR (XCDR (item)); | 1535 end = XCAR (XCDR (item)); |
1536 | 1536 |
1537 if (EQ (end, old_end)) | 1537 if (EQ (end, old_end)) |
1538 XCONS (XCDR (item))->car = new_end; | 1538 XCAR (XCDR (item)) = new_end; |
1539 } | 1539 } |
1540 } | 1540 } |
1541 | 1541 |
1542 | 1542 |
1543 | 1543 |