aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-07-17 22:21:54 +0000
committerKarl Heuer1995-07-17 22:21:54 +0000
commitfbb908296b75005a5d8ca2fc64049ed86e023e8e (patch)
tree963726d924d51053238d51bb09555427cd916ef2 /src
parentee8e09af76dbcb18f33248d0d08b9321b900dd99 (diff)
downloademacs-fbb908296b75005a5d8ca2fc64049ed86e023e8e.tar.gz
emacs-fbb908296b75005a5d8ca2fc64049ed86e023e8e.zip
(current_minor_maps): Catch errors in Findirect_function.
(current_minor_maps_error): New function.
Diffstat (limited to 'src')
-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)
799static Lisp_Object *cmm_modes, *cmm_maps; 799static Lisp_Object *cmm_modes, *cmm_maps;
800static int cmm_size; 800static int cmm_size;
801 801
802/* Error handler used in current_minor_maps. */
803static Lisp_Object
804current_minor_maps_error ()
805{
806 return Qnil;
807}
808
802/* Store a pointer to an array of the keymaps of the currently active 809/* Store a pointer to an array of the keymaps of the currently active
803 minor modes in *buf, and return the number of maps it contains. 810 minor modes in *buf, and return the number of maps it contains.
804 811
@@ -830,6 +837,8 @@ current_minor_maps (modeptr, mapptr)
830 && (val = find_symbol_value (var), ! EQ (val, Qunbound)) 837 && (val = find_symbol_value (var), ! EQ (val, Qunbound))
831 && ! NILP (val)) 838 && ! NILP (val))
832 { 839 {
840 Lisp_Object temp;
841
833 if (i >= cmm_size) 842 if (i >= cmm_size)
834 { 843 {
835 Lisp_Object *newmodes, *newmaps; 844 Lisp_Object *newmodes, *newmaps;
@@ -865,9 +874,17 @@ current_minor_maps (modeptr, mapptr)
865 else 874 else
866 break; 875 break;
867 } 876 }
868 cmm_modes[i] = var; 877
869 cmm_maps [i] = Findirect_function (XCONS (assoc)->cdr); 878 /* Get the keymap definition--or nil if it is not defined. */
870 i++; 879 temp = internal_condition_case_1 (Findirect_function,
880 XCONS (assoc)->cdr,
881 Qerror, current_minor_maps_error);
882 if (!NILP (temp))
883 {
884 cmm_modes[i] = var;
885 cmm_maps [i] = temp;
886 i++;
887 }
871 } 888 }
872 889
873 if (modeptr) *modeptr = cmm_modes; 890 if (modeptr) *modeptr = cmm_modes;