summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-07-17 22:21:54 +0000
committerKarl Heuer <kwzh@gnu.org>1995-07-17 22:21:54 +0000
commit63c26f7da492f7b093aeb271444e7265a00d67af (patch)
tree9f14f4e8c3f3b1d26413954d7fc164831c892714
parent466aeaeb0380fb1e27c83e83dd7ac90d68152cca (diff)
downloademacs-63c26f7da492f7b093aeb271444e7265a00d67af.tar.gz
(current_minor_maps): Catch errors in Findirect_function.
(current_minor_maps_error): New function.
-rw-r--r--src/keymap.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 114282b8f83..034b5d64260 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -799,6 +799,13 @@ append_key (key_sequence, key)
static Lisp_Object *cmm_modes, *cmm_maps;
static int cmm_size;
+/* Error handler used in current_minor_maps. */
+static Lisp_Object
+current_minor_maps_error ()
+{
+ return Qnil;
+}
+
/* Store a pointer to an array of the keymaps of the currently active
minor modes in *buf, and return the number of maps it contains.
@@ -830,6 +837,8 @@ current_minor_maps (modeptr, mapptr)
&& (val = find_symbol_value (var), ! EQ (val, Qunbound))
&& ! NILP (val))
{
+ Lisp_Object temp;
+
if (i >= cmm_size)
{
Lisp_Object *newmodes, *newmaps;
@@ -865,9 +874,17 @@ current_minor_maps (modeptr, mapptr)
else
break;
}
- cmm_modes[i] = var;
- cmm_maps [i] = Findirect_function (XCONS (assoc)->cdr);
- i++;
+
+ /* Get the keymap definition--or nil if it is not defined. */
+ temp = internal_condition_case_1 (Findirect_function,
+ XCONS (assoc)->cdr,
+ Qerror, current_minor_maps_error);
+ if (!NILP (temp))
+ {
+ cmm_modes[i] = var;
+ cmm_maps [i] = temp;
+ i++;
+ }
}
if (modeptr) *modeptr = cmm_modes;