Mercurial > emacs
comparison src/keymap.c @ 42510:dde71e46eeeb
(Fcurrent_active_maps): Put the `keymap' property map first.
(Fkey_binding): Try the `keymap' property map first.
(Fdescribe_buffer_bindings): Show `keymap' property bindings before
minor mode bindings.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 03 Jan 2002 21:28:04 +0000 |
parents | ca040d0f5c67 |
children | 0029b0259426 |
comparison
equal
deleted
inserted
replaced
42509:2a33faa5165e | 42510:dde71e46eeeb |
---|---|
1345 | 1345 |
1346 local = get_local_map (PT, current_buffer, Qlocal_map); | 1346 local = get_local_map (PT, current_buffer, Qlocal_map); |
1347 if (!NILP (local)) | 1347 if (!NILP (local)) |
1348 keymaps = Fcons (local, keymaps); | 1348 keymaps = Fcons (local, keymaps); |
1349 | 1349 |
1350 nmaps = current_minor_maps (0, &maps); | |
1351 | |
1352 for (i = --nmaps; i >= 0; i--) | |
1353 if (!NILP (maps[i])) | |
1354 keymaps = Fcons (maps[i], keymaps); | |
1355 | |
1350 local = get_local_map (PT, current_buffer, Qkeymap); | 1356 local = get_local_map (PT, current_buffer, Qkeymap); |
1351 if (!NILP (local)) | 1357 if (!NILP (local)) |
1352 keymaps = Fcons (local, keymaps); | 1358 keymaps = Fcons (local, keymaps); |
1353 | |
1354 nmaps = current_minor_maps (0, &maps); | |
1355 | |
1356 for (i = --nmaps; i >= 0; i--) | |
1357 if (!NILP (maps[i])) | |
1358 keymaps = Fcons (maps[i], keymaps); | |
1359 } | 1359 } |
1360 | 1360 |
1361 return keymaps; | 1361 return keymaps; |
1362 } | 1362 } |
1363 | 1363 |
1397 } | 1397 } |
1398 else | 1398 else |
1399 { | 1399 { |
1400 Lisp_Object local; | 1400 Lisp_Object local; |
1401 | 1401 |
1402 local = get_local_map (PT, current_buffer, Qkeymap); | |
1403 if (! NILP (local)) | |
1404 { | |
1405 value = Flookup_key (local, key, accept_default); | |
1406 if (! NILP (value) && !INTEGERP (value)) | |
1407 RETURN_UNGCPRO (value); | |
1408 } | |
1409 | |
1402 nmaps = current_minor_maps (0, &maps); | 1410 nmaps = current_minor_maps (0, &maps); |
1403 /* Note that all these maps are GCPRO'd | 1411 /* Note that all these maps are GCPRO'd |
1404 in the places where we found them. */ | 1412 in the places where we found them. */ |
1405 | 1413 |
1406 for (i = 0; i < nmaps; i++) | 1414 for (i = 0; i < nmaps; i++) |
1409 value = Flookup_key (maps[i], key, accept_default); | 1417 value = Flookup_key (maps[i], key, accept_default); |
1410 if (! NILP (value) && !INTEGERP (value)) | 1418 if (! NILP (value) && !INTEGERP (value)) |
1411 RETURN_UNGCPRO (value); | 1419 RETURN_UNGCPRO (value); |
1412 } | 1420 } |
1413 | 1421 |
1414 local = get_local_map (PT, current_buffer, Qkeymap); | |
1415 if (! NILP (local)) | |
1416 { | |
1417 value = Flookup_key (local, key, accept_default); | |
1418 if (! NILP (value) && !INTEGERP (value)) | |
1419 RETURN_UNGCPRO (value); | |
1420 } | |
1421 | |
1422 local = get_local_map (PT, current_buffer, Qlocal_map); | 1422 local = get_local_map (PT, current_buffer, Qlocal_map); |
1423 | |
1424 if (! NILP (local)) | 1423 if (! NILP (local)) |
1425 { | 1424 { |
1426 value = Flookup_key (local, key, accept_default); | 1425 value = Flookup_key (local, key, accept_default); |
1427 if (! NILP (value) && !INTEGERP (value)) | 1426 if (! NILP (value) && !INTEGERP (value)) |
1428 RETURN_UNGCPRO (value); | 1427 RETURN_UNGCPRO (value); |
2611 Fset_buffer (buffer); | 2610 Fset_buffer (buffer); |
2612 | 2611 |
2613 nmaps = current_minor_maps (&modes, &maps); | 2612 nmaps = current_minor_maps (&modes, &maps); |
2614 Fset_buffer (outbuf); | 2613 Fset_buffer (outbuf); |
2615 | 2614 |
2615 start1 = get_local_map (BUF_PT (XBUFFER (buffer)), | |
2616 XBUFFER (buffer), Qkeymap); | |
2617 if (!NILP (start1)) | |
2618 { | |
2619 describe_map_tree (start1, 1, shadow, prefix, | |
2620 "\f\n`keymap' Property Bindings", nomenu, 0, 0); | |
2621 shadow = Fcons (start1, shadow); | |
2622 } | |
2623 | |
2616 /* Print the minor mode maps. */ | 2624 /* Print the minor mode maps. */ |
2617 for (i = 0; i < nmaps; i++) | 2625 for (i = 0; i < nmaps; i++) |
2618 { | 2626 { |
2619 /* The title for a minor mode keymap | 2627 /* The title for a minor mode keymap |
2620 is constructed at run time. | 2628 is constructed at run time. |
2640 describe_map_tree (maps[i], 1, shadow, prefix, title, nomenu, 0, 0); | 2648 describe_map_tree (maps[i], 1, shadow, prefix, title, nomenu, 0, 0); |
2641 shadow = Fcons (maps[i], shadow); | 2649 shadow = Fcons (maps[i], shadow); |
2642 } | 2650 } |
2643 | 2651 |
2644 start1 = get_local_map (BUF_PT (XBUFFER (buffer)), | 2652 start1 = get_local_map (BUF_PT (XBUFFER (buffer)), |
2645 XBUFFER (buffer), Qkeymap); | |
2646 if (!NILP (start1)) | |
2647 { | |
2648 describe_map_tree (start1, 1, shadow, prefix, | |
2649 "\f\nChar Property Bindings", nomenu, 0, 0); | |
2650 shadow = Fcons (start1, shadow); | |
2651 } | |
2652 | |
2653 start1 = get_local_map (BUF_PT (XBUFFER (buffer)), | |
2654 XBUFFER (buffer), Qlocal_map); | 2653 XBUFFER (buffer), Qlocal_map); |
2655 if (!NILP (start1)) | 2654 if (!NILP (start1)) |
2656 { | 2655 { |
2657 if (EQ (start1, XBUFFER (buffer)->keymap)) | 2656 if (EQ (start1, XBUFFER (buffer)->keymap)) |
2658 describe_map_tree (start1, 1, shadow, prefix, | 2657 describe_map_tree (start1, 1, shadow, prefix, |
2659 "\f\nMajor Mode Bindings", nomenu, 0, 0); | 2658 "\f\nMajor Mode Bindings", nomenu, 0, 0); |
2660 else | 2659 else |
2661 describe_map_tree (start1, 1, shadow, prefix, | 2660 describe_map_tree (start1, 1, shadow, prefix, |
2662 "\f\nChar Property Bindings", nomenu, 0, 0); | 2661 "\f\n`local-map' Property Bindings", |
2662 nomenu, 0, 0); | |
2663 | 2663 |
2664 shadow = Fcons (start1, shadow); | 2664 shadow = Fcons (start1, shadow); |
2665 } | 2665 } |
2666 } | 2666 } |
2667 | 2667 |