Mercurial > emacs
comparison src/keymap.c @ 9312:dfaf1d41e53d
(synkey, access_keymap, store_in_keymap, Faccessible_keymaps,
Fkey_description, ascii_sequence_p, Fwhere_is_internal, describe_vector):
Don't use XFASTINT as an lvalue.
| author | Karl Heuer <kwzh@gnu.org> |
|---|---|
| date | Tue, 04 Oct 1994 16:05:05 +0000 |
| parents | 129621997564 |
| children | d35ed70c84d4 |
comparison
equal
deleted
inserted
replaced
| 9311:6e40f49dc6fb | 9312:dfaf1d41e53d |
|---|---|
| 162 struct Lisp_Vector *frommap, *tomap; | 162 struct Lisp_Vector *frommap, *tomap; |
| 163 int fromchar, tochar; | 163 int fromchar, tochar; |
| 164 { | 164 { |
| 165 Lisp_Object v, c; | 165 Lisp_Object v, c; |
| 166 XSETVECTOR (v, tomap); | 166 XSETVECTOR (v, tomap); |
| 167 XFASTINT (c) = tochar; | 167 XSETFASTINT (c, tochar); |
| 168 frommap->contents[fromchar] = Fcons (v, c); | 168 frommap->contents[fromchar] = Fcons (v, c); |
| 169 } | 169 } |
| 170 #endif /* 0 */ | 170 #endif /* 0 */ |
| 171 | 171 |
| 172 DEFUN ("keymapp", Fkeymapp, Skeymapp, 1, 1, 0, | 172 DEFUN ("keymapp", Fkeymapp, Skeymapp, 1, 1, 0, |
| 282 if (SYMBOLP (idx)) | 282 if (SYMBOLP (idx)) |
| 283 idx = reorder_modifiers (idx); | 283 idx = reorder_modifiers (idx); |
| 284 else if (INTEGERP (idx)) | 284 else if (INTEGERP (idx)) |
| 285 /* Clobber the high bits that can be present on a machine | 285 /* Clobber the high bits that can be present on a machine |
| 286 with more than 24 bits of integer. */ | 286 with more than 24 bits of integer. */ |
| 287 XFASTINT (idx) = XINT (idx) & (CHAR_META | (CHAR_META - 1)); | 287 XSETFASTINT (idx, XINT (idx) & (CHAR_META | (CHAR_META - 1))); |
| 288 | 288 |
| 289 { | 289 { |
| 290 Lisp_Object tail; | 290 Lisp_Object tail; |
| 291 Lisp_Object t_binding; | 291 Lisp_Object t_binding; |
| 292 | 292 |
| 412 if (SYMBOLP (idx)) | 412 if (SYMBOLP (idx)) |
| 413 idx = reorder_modifiers (idx); | 413 idx = reorder_modifiers (idx); |
| 414 else if (INTEGERP (idx)) | 414 else if (INTEGERP (idx)) |
| 415 /* Clobber the high bits that can be present on a machine | 415 /* Clobber the high bits that can be present on a machine |
| 416 with more than 24 bits of integer. */ | 416 with more than 24 bits of integer. */ |
| 417 XFASTINT (idx) = XINT (idx) & (CHAR_META | (CHAR_META - 1)); | 417 XSETFASTINT (idx, XINT (idx) & (CHAR_META | (CHAR_META - 1))); |
| 418 | 418 |
| 419 /* Scan the keymap for a binding of idx. */ | 419 /* Scan the keymap for a binding of idx. */ |
| 420 { | 420 { |
| 421 Lisp_Object tail; | 421 Lisp_Object tail; |
| 422 | 422 |
| 1315 { | 1315 { |
| 1316 int i; | 1316 int i; |
| 1317 for (i = 0; i < prefixlen; i++) | 1317 for (i = 0; i < prefixlen; i++) |
| 1318 { | 1318 { |
| 1319 Lisp_Object i1; | 1319 Lisp_Object i1; |
| 1320 XFASTINT (i1) = i; | 1320 XSETFASTINT (i1, i); |
| 1321 if (!EQ (Faref (thisseq, i1), Faref (prefix, i1))) | 1321 if (!EQ (Faref (thisseq, i1), Faref (prefix, i1))) |
| 1322 break; | 1322 break; |
| 1323 } | 1323 } |
| 1324 if (i == prefixlen) | 1324 if (i == prefixlen) |
| 1325 good_maps = Fcons (elt, good_maps); | 1325 good_maps = Fcons (elt, good_maps); |
| 1350 Lisp_Object vector; | 1350 Lisp_Object vector; |
| 1351 vector = Fmake_vector (Flength (keys), Qnil); | 1351 vector = Fmake_vector (Flength (keys), Qnil); |
| 1352 for (i = 0; i < XSTRING (keys)->size; i++) | 1352 for (i = 0; i < XSTRING (keys)->size; i++) |
| 1353 { | 1353 { |
| 1354 if (XSTRING (keys)->data[i] & 0x80) | 1354 if (XSTRING (keys)->data[i] & 0x80) |
| 1355 XFASTINT (XVECTOR (vector)->contents[i]) | 1355 XSETFASTINT (XVECTOR (vector)->contents[i], |
| 1356 = meta_modifier | (XSTRING (keys)->data[i] & ~0x80); | 1356 meta_modifier | (XSTRING (keys)->data[i] & ~0x80)); |
| 1357 else | 1357 else |
| 1358 XFASTINT (XVECTOR (vector)->contents[i]) | 1358 XSETFASTINT (XVECTOR (vector)->contents[i], |
| 1359 = XSTRING (keys)->data[i]; | 1359 XSTRING (keys)->data[i]); |
| 1360 } | 1360 } |
| 1361 keys = vector; | 1361 keys = vector; |
| 1362 } | 1362 } |
| 1363 else if (!VECTORP (keys)) | 1363 else if (!VECTORP (keys)) |
| 1364 keys = wrong_type_argument (Qarrayp, keys); | 1364 keys = wrong_type_argument (Qarrayp, keys); |
| 1566 a meta bit. */ | 1566 a meta bit. */ |
| 1567 static int | 1567 static int |
| 1568 ascii_sequence_p (seq) | 1568 ascii_sequence_p (seq) |
| 1569 Lisp_Object seq; | 1569 Lisp_Object seq; |
| 1570 { | 1570 { |
| 1571 Lisp_Object i; | 1571 int i; |
| 1572 int len = XINT (Flength (seq)); | 1572 int len = XINT (Flength (seq)); |
| 1573 | 1573 |
| 1574 for (XFASTINT (i) = 0; XFASTINT (i) < len; XFASTINT (i)++) | 1574 for (i = 0; i < len; i++) |
| 1575 { | 1575 { |
| 1576 Lisp_Object elt; | 1576 Lisp_Object ii, elt; |
| 1577 | 1577 |
| 1578 elt = Faref (seq, i); | 1578 XSETFASTINT (ii, i); |
| 1579 elt = Faref (seq, ii); | |
| 1579 | 1580 |
| 1580 if (!INTEGERP (elt) | 1581 if (!INTEGERP (elt) |
| 1581 || (XUINT (elt) & ~CHAR_META) >= 0x80) | 1582 || (XUINT (elt) & ~CHAR_META) >= 0x80) |
| 1582 return 0; | 1583 return 0; |
| 1583 } | 1584 } |
| 1690 advance map and i to the next binding. */ | 1691 advance map and i to the next binding. */ |
| 1691 if (VECTORP (elt)) | 1692 if (VECTORP (elt)) |
| 1692 { | 1693 { |
| 1693 /* In a vector, look at each element. */ | 1694 /* In a vector, look at each element. */ |
| 1694 binding = XVECTOR (elt)->contents[i]; | 1695 binding = XVECTOR (elt)->contents[i]; |
| 1695 XFASTINT (key) = i; | 1696 XSETFASTINT (key, i); |
| 1696 i++; | 1697 i++; |
| 1697 | 1698 |
| 1698 /* If we've just finished scanning a vector, advance map | 1699 /* If we've just finished scanning a vector, advance map |
| 1699 to the next element, and reset i in anticipation of the | 1700 to the next element, and reset i in anticipation of the |
| 1700 next vector we may find. */ | 1701 next vector we may find. */ |
| 2305 /* Output the prefix that applies to every entry in this map. */ | 2306 /* Output the prefix that applies to every entry in this map. */ |
| 2306 if (!NILP (elt_prefix)) | 2307 if (!NILP (elt_prefix)) |
| 2307 insert1 (elt_prefix); | 2308 insert1 (elt_prefix); |
| 2308 | 2309 |
| 2309 /* Get the string to describe the character I, and print it. */ | 2310 /* Get the string to describe the character I, and print it. */ |
| 2310 XFASTINT (dummy) = i; | 2311 XSETFASTINT (dummy, i); |
| 2311 | 2312 |
| 2312 /* THIS gets the string to describe the character DUMMY. */ | 2313 /* THIS gets the string to describe the character DUMMY. */ |
| 2313 this = Fsingle_key_description (dummy); | 2314 this = Fsingle_key_description (dummy); |
| 2314 insert1 (this); | 2315 insert1 (this); |
| 2315 | 2316 |
| 2326 { | 2327 { |
| 2327 insert (" .. ", 4); | 2328 insert (" .. ", 4); |
| 2328 if (!NILP (elt_prefix)) | 2329 if (!NILP (elt_prefix)) |
| 2329 insert1 (elt_prefix); | 2330 insert1 (elt_prefix); |
| 2330 | 2331 |
| 2331 XFASTINT (dummy) = i; | 2332 XSETFASTINT (dummy, i); |
| 2332 insert1 (Fsingle_key_description (dummy)); | 2333 insert1 (Fsingle_key_description (dummy)); |
| 2333 } | 2334 } |
| 2334 | 2335 |
| 2335 /* Print a description of the definition of this character. | 2336 /* Print a description of the definition of this character. |
| 2336 elt_describer will take care of spacing out far enough | 2337 elt_describer will take care of spacing out far enough |
