Mercurial > emacs
comparison src/textprop.c @ 85372:f7d19cfed7da
* xselect.c (x_own_selection, x_handle_selection_clear)
(x_clear_frame_selections):
* w32menu.c (list_of_panes, list_of_items):
* w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list):
* textprop.c (validate_plist, interval_has_all_properties)
(interval_has_some_properties, interval_has_some_properties_list)
(add_properties, text_property_list):
* process.c (Fget_buffer_process, list_processes_1, status_notify):
* minibuf.c (Fassoc_string):
* macselect.c (x_own_selection, x_clear_frame_selections)
(Fx_disown_selection_internal):
* keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree):
Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 17 Oct 2007 23:43:52 +0000 |
parents | 1677cf1c2509 |
children | d3e87ee5aa0e 1251cabc40b7 |
comparison
equal
deleted
inserted
replaced
85371:8f7b544a943f | 85372:f7d19cfed7da |
---|---|
199 | 199 |
200 if (CONSP (list)) | 200 if (CONSP (list)) |
201 { | 201 { |
202 register int i; | 202 register int i; |
203 register Lisp_Object tail; | 203 register Lisp_Object tail; |
204 for (i = 0, tail = list; !NILP (tail); i++) | 204 for (i = 0, tail = list; CONSP (tail); i++) |
205 { | 205 { |
206 tail = Fcdr (tail); | 206 tail = XCDR (tail); |
207 QUIT; | 207 QUIT; |
208 } | 208 } |
209 if (i & 1) | 209 if (i & 1) |
210 error ("Odd length text property list"); | 210 error ("Odd length text property list"); |
211 return list; | 211 return list; |
224 { | 224 { |
225 register Lisp_Object tail1, tail2, sym1; | 225 register Lisp_Object tail1, tail2, sym1; |
226 register int found; | 226 register int found; |
227 | 227 |
228 /* Go through each element of PLIST. */ | 228 /* Go through each element of PLIST. */ |
229 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) | 229 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) |
230 { | 230 { |
231 sym1 = Fcar (tail1); | 231 sym1 = XCAR (tail1); |
232 found = 0; | 232 found = 0; |
233 | 233 |
234 /* Go through I's plist, looking for sym1 */ | 234 /* Go through I's plist, looking for sym1 */ |
235 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) | 235 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) |
236 if (EQ (sym1, Fcar (tail2))) | 236 if (EQ (sym1, XCAR (tail2))) |
237 { | 237 { |
238 /* Found the same property on both lists. If the | 238 /* Found the same property on both lists. If the |
239 values are unequal, return zero. */ | 239 values are unequal, return zero. */ |
240 if (! EQ (Fcar (Fcdr (tail1)), Fcar (Fcdr (tail2)))) | 240 if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2)))) |
241 return 0; | 241 return 0; |
242 | 242 |
243 /* Property has same value on both lists; go to next one. */ | 243 /* Property has same value on both lists; go to next one. */ |
244 found = 1; | 244 found = 1; |
245 break; | 245 break; |
261 INTERVAL i; | 261 INTERVAL i; |
262 { | 262 { |
263 register Lisp_Object tail1, tail2, sym; | 263 register Lisp_Object tail1, tail2, sym; |
264 | 264 |
265 /* Go through each element of PLIST. */ | 265 /* Go through each element of PLIST. */ |
266 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) | 266 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) |
267 { | 267 { |
268 sym = Fcar (tail1); | 268 sym = XCAR (tail1); |
269 | 269 |
270 /* Go through i's plist, looking for tail1 */ | 270 /* Go through i's plist, looking for tail1 */ |
271 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) | 271 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) |
272 if (EQ (sym, Fcar (tail2))) | 272 if (EQ (sym, XCAR (tail2))) |
273 return 1; | 273 return 1; |
274 } | 274 } |
275 | 275 |
276 return 0; | 276 return 0; |
277 } | 277 } |
285 INTERVAL i; | 285 INTERVAL i; |
286 { | 286 { |
287 register Lisp_Object tail1, tail2, sym; | 287 register Lisp_Object tail1, tail2, sym; |
288 | 288 |
289 /* Go through each element of LIST. */ | 289 /* Go through each element of LIST. */ |
290 for (tail1 = list; ! NILP (tail1); tail1 = XCDR (tail1)) | 290 for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1)) |
291 { | 291 { |
292 sym = Fcar (tail1); | 292 sym = Fcar (tail1); |
293 | 293 |
294 /* Go through i's plist, looking for tail1 */ | 294 /* Go through i's plist, looking for tail1 */ |
295 for (tail2 = i->plist; ! NILP (tail2); tail2 = XCDR (XCDR (tail2))) | 295 for (tail2 = i->plist; CONSP (tail2); tail2 = XCDR (XCDR (tail2))) |
296 if (EQ (sym, XCAR (tail2))) | 296 if (EQ (sym, XCAR (tail2))) |
297 return 1; | 297 return 1; |
298 } | 298 } |
299 | 299 |
300 return 0; | 300 return 0; |
389 where it is a buffer, and live buffers are always protected. | 389 where it is a buffer, and live buffers are always protected. |
390 I and its plist are also protected, via OBJECT. */ | 390 I and its plist are also protected, via OBJECT. */ |
391 GCPRO3 (tail1, sym1, val1); | 391 GCPRO3 (tail1, sym1, val1); |
392 | 392 |
393 /* Go through each element of PLIST. */ | 393 /* Go through each element of PLIST. */ |
394 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) | 394 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1))) |
395 { | 395 { |
396 sym1 = Fcar (tail1); | 396 sym1 = XCAR (tail1); |
397 val1 = Fcar (Fcdr (tail1)); | 397 val1 = Fcar (XCDR (tail1)); |
398 found = 0; | 398 found = 0; |
399 | 399 |
400 /* Go through I's plist, looking for sym1 */ | 400 /* Go through I's plist, looking for sym1 */ |
401 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) | 401 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2))) |
402 if (EQ (sym1, Fcar (tail2))) | 402 if (EQ (sym1, XCAR (tail2))) |
403 { | 403 { |
404 /* No need to gcpro, because tail2 protects this | 404 /* No need to gcpro, because tail2 protects this |
405 and it must be a cons cell (we get an error otherwise). */ | 405 and it must be a cons cell (we get an error otherwise). */ |
406 register Lisp_Object this_cdr; | 406 register Lisp_Object this_cdr; |
407 | 407 |
408 this_cdr = Fcdr (tail2); | 408 this_cdr = XCDR (tail2); |
409 /* Found the property. Now check its value. */ | 409 /* Found the property. Now check its value. */ |
410 found = 1; | 410 found = 1; |
411 | 411 |
412 /* The properties have the same value on both lists. | 412 /* The properties have the same value on both lists. |
413 Continue to the next property. */ | 413 Continue to the next property. */ |
1963 len = interval_end - s; | 1963 len = interval_end - s; |
1964 | 1964 |
1965 plist = i->plist; | 1965 plist = i->plist; |
1966 | 1966 |
1967 if (!NILP (prop)) | 1967 if (!NILP (prop)) |
1968 for (; !NILP (plist); plist = Fcdr (Fcdr (plist))) | 1968 for (; CONSP (plist); plist = Fcdr (XCDR (plist))) |
1969 if (EQ (Fcar (plist), prop)) | 1969 if (EQ (XCAR (plist), prop)) |
1970 { | 1970 { |
1971 plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil)); | 1971 plist = Fcons (prop, Fcons (Fcar (XCDR (plist)), Qnil)); |
1972 break; | 1972 break; |
1973 } | 1973 } |
1974 | 1974 |
1975 if (!NILP (plist)) | 1975 if (!NILP (plist)) |
1976 result = Fcons (Fcons (make_number (s), | 1976 result = Fcons (Fcons (make_number (s), |