# HG changeset patch # User Stefan Monnier # Date 1006813821 0 # Node ID bc65be224d92893828692347cca306251a1b2527 # Parent b89d0c514129088cb044eae709b158e2949bd780 (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. diff -r b89d0c514129 -r bc65be224d92 src/keymap.c --- a/src/keymap.c Mon Nov 26 21:15:29 2001 +0000 +++ b/src/keymap.c Mon Nov 26 22:30:21 2001 +0000 @@ -589,14 +589,25 @@ /* Character codes with modifiers are not included in a char-table. All character codes without modifiers are included. */ - if (NATNUMP (idx) - && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) - val = Faref (binding, idx); + if (NATNUMP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) + { + val = Faref (binding, idx); + /* `nil' has a special meaning for char-tables, so + we use something else to record an explicitly + unbound entry. */ + if (NILP (val)) + val = Qunbound; + } } /* If we found a binding, clean it up and return it. */ if (!EQ (val, Qunbound)) { + if (EQ (val, Qt)) + /* A Qt binding is just like an explicit nil binding + (i.e. it shadows any parent binding but not bindings in + keymaps of lower precedence). */ + val = Qnil; val = get_keyelt (val, autoload); if (KEYMAPP (val)) fix_submap_inheritance (map, idx, val); @@ -765,12 +776,13 @@ /* Character codes with modifiers are not included in a char-table. All character codes without modifiers are included. */ - if (NATNUMP (idx) - && ! (XFASTINT (idx) - & (CHAR_ALT | CHAR_SUPER | CHAR_HYPER - | CHAR_SHIFT | CHAR_CTL | CHAR_META))) + if (NATNUMP (idx) && !(XFASTINT (idx) & CHAR_MODIFIER_MASK)) { - Faset (elt, idx, def); + Faset (elt, idx, + /* `nil' has a special meaning for char-tables, so + we use something else to record an explicitly + unbound entry. */ + NILP (def) ? Qt : def); return def; } insertion_point = tail;