summaryrefslogtreecommitdiff
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-11-26 22:30:21 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-11-26 22:30:21 +0000
commit4dc3eb25ae5ff785198b5e08f688595c29d941ab (patch)
tree9d35fdf441b9a6f9398ae5924e4bb2e926933dde /src/keymap.c
parent9714ec23e431fc9958605bc2cc8f16fa1e7d10da (diff)
downloademacs-4dc3eb25ae5ff785198b5e08f688595c29d941ab.tar.gz
(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/keymap.c')
-rw-r--r--src/keymap.c28
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)
/* 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 @@ store_in_keymap (keymap, idx, def)
/* 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;