# HG changeset patch # User Karl Heuer # Date 806019714 0 # Node ID f86a10208f7e7280dfe35998427b9d8a78cddaf6 # Parent 33a4586124e9c87269d8e5cf164655af66a14d60 (current_minor_maps): Catch errors in Findirect_function. (current_minor_maps_error): New function. diff -r 33a4586124e9 -r f86a10208f7e src/keymap.c --- a/src/keymap.c Mon Jul 17 22:21:21 1995 +0000 +++ b/src/keymap.c Mon Jul 17 22:21:54 1995 +0000 @@ -799,6 +799,13 @@ 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 @@ && (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 @@ 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;