diff options
| author | Stefan Monnier | 2001-11-26 22:30:21 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-26 22:30:21 +0000 |
| commit | 4dc3eb25ae5ff785198b5e08f688595c29d941ab (patch) | |
| tree | 9d35fdf441b9a6f9398ae5924e4bb2e926933dde /src | |
| parent | 9714ec23e431fc9958605bc2cc8f16fa1e7d10da (diff) | |
| download | emacs-4dc3eb25ae5ff785198b5e08f688595c29d941ab.tar.gz emacs-4dc3eb25ae5ff785198b5e08f688595c29d941ab.zip | |
(access_keymap): Handle t bindings like nil bindings.
Make nil bindings in char-tables transparent.
(store_in_keymap): Turn a nil binding into a t binding for char-tables.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/keymap.c b/src/keymap.c index ea8637c3b1a..33e3244c061 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -589,14 +589,25 @@ access_keymap (map, idx, t_ok, noinherit, autoload) | |||
| 589 | /* Character codes with modifiers | 589 | /* Character codes with modifiers |
| 590 | are not included in a char-table. | 590 | are not included in a char-table. |
| 591 | All character codes without modifiers are included. */ | 591 | All character codes without modifiers are included. */ |
| 592 | if (NATNUMP (idx) | 592 | if (NATNUMP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) |
| 593 | && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) | 593 | { |
| 594 | val = Faref (binding, idx); | 594 | val = Faref (binding, idx); |
| 595 | /* `nil' has a special meaning for char-tables, so | ||
| 596 | we use something else to record an explicitly | ||
| 597 | unbound entry. */ | ||
| 598 | if (NILP (val)) | ||
| 599 | val = Qunbound; | ||
| 600 | } | ||
| 595 | } | 601 | } |
| 596 | 602 | ||
| 597 | /* If we found a binding, clean it up and return it. */ | 603 | /* If we found a binding, clean it up and return it. */ |
| 598 | if (!EQ (val, Qunbound)) | 604 | if (!EQ (val, Qunbound)) |
| 599 | { | 605 | { |
| 606 | if (EQ (val, Qt)) | ||
| 607 | /* A Qt binding is just like an explicit nil binding | ||
| 608 | (i.e. it shadows any parent binding but not bindings in | ||
| 609 | keymaps of lower precedence). */ | ||
| 610 | val = Qnil; | ||
| 600 | val = get_keyelt (val, autoload); | 611 | val = get_keyelt (val, autoload); |
| 601 | if (KEYMAPP (val)) | 612 | if (KEYMAPP (val)) |
| 602 | fix_submap_inheritance (map, idx, val); | 613 | fix_submap_inheritance (map, idx, val); |
| @@ -765,12 +776,13 @@ store_in_keymap (keymap, idx, def) | |||
| 765 | /* Character codes with modifiers | 776 | /* Character codes with modifiers |
| 766 | are not included in a char-table. | 777 | are not included in a char-table. |
| 767 | All character codes without modifiers are included. */ | 778 | All character codes without modifiers are included. */ |
| 768 | if (NATNUMP (idx) | 779 | if (NATNUMP (idx) && !(XFASTINT (idx) & CHAR_MODIFIER_MASK)) |
| 769 | && ! (XFASTINT (idx) | ||
| 770 | & (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | ||
| 771 | | CHAR_SHIFT | CHAR_CTL | CHAR_META))) | ||
| 772 | { | 780 | { |
| 773 | Faset (elt, idx, def); | 781 | Faset (elt, idx, |
| 782 | /* `nil' has a special meaning for char-tables, so | ||
| 783 | we use something else to record an explicitly | ||
| 784 | unbound entry. */ | ||
| 785 | NILP (def) ? Qt : def); | ||
| 774 | return def; | 786 | return def; |
| 775 | } | 787 | } |
| 776 | insertion_point = tail; | 788 | insertion_point = tail; |