aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorKenichi Handa2012-10-11 20:29:47 +0900
committerKenichi Handa2012-10-11 20:29:47 +0900
commitd3e4228575e9ba9e99dc4a7dae788280ffcc4566 (patch)
tree97d35f3c0766372c166a31f3c0f7aba791a38dde /src/keymap.c
parentcde44a7728488ca6bc6a46c18d9c5e647b160547 (diff)
parentfd2f90cf5c6a15610aa1e17e73d6d8a5f8cb1999 (diff)
downloademacs-d3e4228575e9ba9e99dc4a7dae788280ffcc4566.tar.gz
emacs-d3e4228575e9ba9e99dc4a7dae788280ffcc4566.zip
merge trunk
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c159
1 files changed, 77 insertions, 82 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 6ea142651bf..fbdd31e0de3 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -99,12 +99,12 @@ static void describe_command (Lisp_Object, Lisp_Object);
99static void describe_translation (Lisp_Object, Lisp_Object); 99static void describe_translation (Lisp_Object, Lisp_Object);
100static void describe_map (Lisp_Object, Lisp_Object, 100static void describe_map (Lisp_Object, Lisp_Object,
101 void (*) (Lisp_Object, Lisp_Object), 101 void (*) (Lisp_Object, Lisp_Object),
102 int, Lisp_Object, Lisp_Object*, int, int); 102 bool, Lisp_Object, Lisp_Object*, bool, bool);
103static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object, 103static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object,
104 void (*) (Lisp_Object, Lisp_Object), int, 104 void (*) (Lisp_Object, Lisp_Object), bool,
105 Lisp_Object, Lisp_Object, int, int); 105 Lisp_Object, Lisp_Object, bool, bool);
106static void silly_event_symbol_error (Lisp_Object); 106static void silly_event_symbol_error (Lisp_Object);
107static Lisp_Object get_keyelt (Lisp_Object, int); 107static Lisp_Object get_keyelt (Lisp_Object, bool);
108 108
109/* Keymap object support - constructors and predicates. */ 109/* Keymap object support - constructors and predicates. */
110 110
@@ -207,15 +207,12 @@ when reading a key-sequence to be looked-up in this keymap. */)
207/* Check that OBJECT is a keymap (after dereferencing through any 207/* Check that OBJECT is a keymap (after dereferencing through any
208 symbols). If it is, return it. 208 symbols). If it is, return it.
209 209
210 If AUTOLOAD is non-zero and OBJECT is a symbol whose function value 210 If AUTOLOAD and if OBJECT is a symbol whose function value
211 is an autoload form, do the autoload and try again. 211 is an autoload form, do the autoload and try again.
212 If AUTOLOAD is nonzero, callers must assume GC is possible. 212 If AUTOLOAD, callers must assume GC is possible.
213
214 If the map needs to be autoloaded, but AUTOLOAD is zero (and ERROR
215 is zero as well), return Qt.
216 213
217 ERROR_IF_NOT_KEYMAP controls how we respond if OBJECT isn't a keymap. 214 ERROR_IF_NOT_KEYMAP controls how we respond if OBJECT isn't a keymap.
218 If ERROR_IF_NOT_KEYMAP is non-zero, signal an error; otherwise, 215 If ERROR_IF_NOT_KEYMAP, signal an error; otherwise,
219 just return Qnil. 216 just return Qnil.
220 217
221 Note that most of the time, we don't want to pursue autoloads. 218 Note that most of the time, we don't want to pursue autoloads.
@@ -224,11 +221,11 @@ when reading a key-sequence to be looked-up in this keymap. */)
224 but it seems to me that only read_key_sequence, Flookup_key, and 221 but it seems to me that only read_key_sequence, Flookup_key, and
225 Fdefine_key should cause keymaps to be autoloaded. 222 Fdefine_key should cause keymaps to be autoloaded.
226 223
227 This function can GC when AUTOLOAD is non-zero, because it calls 224 This function can GC when AUTOLOAD is true, because it calls
228 Fautoload_do_load which can GC. */ 225 Fautoload_do_load which can GC. */
229 226
230Lisp_Object 227Lisp_Object
231get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload) 228get_keymap (Lisp_Object object, bool error_if_not_keymap, bool autoload)
232{ 229{
233 Lisp_Object tem; 230 Lisp_Object tem;
234 231
@@ -280,7 +277,7 @@ get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
280 We assume that KEYMAP is a valid keymap. */ 277 We assume that KEYMAP is a valid keymap. */
281 278
282static Lisp_Object 279static Lisp_Object
283keymap_parent (Lisp_Object keymap, int autoload) 280keymap_parent (Lisp_Object keymap, bool autoload)
284{ 281{
285 Lisp_Object list; 282 Lisp_Object list;
286 283
@@ -307,7 +304,7 @@ If KEYMAP has no parent, return nil. */)
307} 304}
308 305
309/* Check whether MAP is one of MAPS parents. */ 306/* Check whether MAP is one of MAPS parents. */
310static int 307static bool
311keymap_memberp (Lisp_Object map, Lisp_Object maps) 308keymap_memberp (Lisp_Object map, Lisp_Object maps)
312{ 309{
313 if (NILP (map)) return 0; 310 if (NILP (map)) return 0;
@@ -365,19 +362,20 @@ Return PARENT. PARENT should be nil or another keymap. */)
365 362
366 MAP must be a keymap or a list of keymaps. 363 MAP must be a keymap or a list of keymaps.
367 364
368 If T_OK is non-zero, bindings for Qt are treated as default 365 If T_OK, bindings for Qt are treated as default
369 bindings; any key left unmentioned by other tables and bindings is 366 bindings; any key left unmentioned by other tables and bindings is
370 given the binding of Qt. 367 given the binding of Qt.
371 368
372 If T_OK is zero, bindings for Qt are not treated specially. 369 If not T_OK, bindings for Qt are not treated specially.
373 370
374 If NOINHERIT, don't accept a subkeymap found in an inherited keymap. 371 If NOINHERIT, don't accept a subkeymap found in an inherited keymap.
375 372
376 Returns Qunbound if no binding was found (and returns Qnil if a nil 373 Return Qunbound if no binding was found (and return Qnil if a nil
377 binding was found). */ 374 binding was found). */
378 375
379static Lisp_Object 376static Lisp_Object
380access_keymap_1 (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int autoload) 377access_keymap_1 (Lisp_Object map, Lisp_Object idx,
378 bool t_ok, bool noinherit, bool autoload)
381{ 379{
382 /* If idx is a list (some sort of mouse click, perhaps?), 380 /* If idx is a list (some sort of mouse click, perhaps?),
383 the index we want to use is the car of the list, which 381 the index we want to use is the car of the list, which
@@ -547,7 +545,7 @@ access_keymap_1 (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int
547 545
548Lisp_Object 546Lisp_Object
549access_keymap (Lisp_Object map, Lisp_Object idx, 547access_keymap (Lisp_Object map, Lisp_Object idx,
550 int t_ok, int noinherit, int autoload) 548 bool t_ok, bool noinherit, bool autoload)
551{ 549{
552 Lisp_Object val = access_keymap_1 (map, idx, t_ok, noinherit, autoload); 550 Lisp_Object val = access_keymap_1 (map, idx, t_ok, noinherit, autoload);
553 return EQ (val, Qunbound) ? Qnil : val; 551 return EQ (val, Qunbound) ? Qnil : val;
@@ -630,9 +628,10 @@ map_keymap_call (Lisp_Object key, Lisp_Object val, Lisp_Object fun, void *dummy)
630} 628}
631 629
632/* Same as map_keymap_internal, but traverses parent keymaps as well. 630/* Same as map_keymap_internal, but traverses parent keymaps as well.
633 A non-zero AUTOLOAD indicates that autoloaded keymaps should be loaded. */ 631 AUTOLOAD indicates that autoloaded keymaps should be loaded. */
634void 632void
635map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args, void *data, int autoload) 633map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args,
634 void *data, bool autoload)
636{ 635{
637 struct gcpro gcpro1; 636 struct gcpro gcpro1;
638 GCPRO1 (args); 637 GCPRO1 (args);
@@ -711,13 +710,13 @@ usage: (map-keymap FUNCTION KEYMAP) */)
711 Also if OBJECT has a menu string as the first element, 710 Also if OBJECT has a menu string as the first element,
712 remove that. Also remove a menu help string as second element. 711 remove that. Also remove a menu help string as second element.
713 712
714 If AUTOLOAD is nonzero, load autoloadable keymaps 713 If AUTOLOAD, load autoloadable keymaps
715 that are referred to with indirection. 714 that are referred to with indirection.
716 715
717 This can GC because menu_item_eval_property calls Feval. */ 716 This can GC because menu_item_eval_property calls Feval. */
718 717
719static Lisp_Object 718static Lisp_Object
720get_keyelt (Lisp_Object object, int autoload) 719get_keyelt (Lisp_Object object, bool autoload)
721{ 720{
722 while (1) 721 while (1)
723 { 722 {
@@ -1114,10 +1113,10 @@ binding is altered. If there is no binding for KEY, the new pair
1114binding KEY to DEF is added at the front of KEYMAP. */) 1113binding KEY to DEF is added at the front of KEYMAP. */)
1115 (Lisp_Object keymap, Lisp_Object key, Lisp_Object def) 1114 (Lisp_Object keymap, Lisp_Object key, Lisp_Object def)
1116{ 1115{
1117 register ptrdiff_t idx; 1116 ptrdiff_t idx;
1118 register Lisp_Object c; 1117 Lisp_Object c;
1119 register Lisp_Object cmd; 1118 Lisp_Object cmd;
1120 int metized = 0; 1119 bool metized = 0;
1121 int meta_bit; 1120 int meta_bit;
1122 ptrdiff_t length; 1121 ptrdiff_t length;
1123 struct gcpro gcpro1, gcpro2, gcpro3; 1122 struct gcpro gcpro1, gcpro2, gcpro3;
@@ -1271,11 +1270,11 @@ third optional argument ACCEPT-DEFAULT is non-nil, `lookup-key' will
1271recognize the default bindings, just as `read-key-sequence' does. */) 1270recognize the default bindings, just as `read-key-sequence' does. */)
1272 (Lisp_Object keymap, Lisp_Object key, Lisp_Object accept_default) 1271 (Lisp_Object keymap, Lisp_Object key, Lisp_Object accept_default)
1273{ 1272{
1274 register ptrdiff_t idx; 1273 ptrdiff_t idx;
1275 register Lisp_Object cmd; 1274 Lisp_Object cmd;
1276 register Lisp_Object c; 1275 Lisp_Object c;
1277 ptrdiff_t length; 1276 ptrdiff_t length;
1278 int t_ok = !NILP (accept_default); 1277 bool t_ok = !NILP (accept_default);
1279 struct gcpro gcpro1, gcpro2; 1278 struct gcpro gcpro1, gcpro2;
1280 1279
1281 GCPRO2 (keymap, key); 1280 GCPRO2 (keymap, key);
@@ -1887,7 +1886,7 @@ DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_
1887struct accessible_keymaps_data { 1886struct accessible_keymaps_data {
1888 Lisp_Object maps, tail, thisseq; 1887 Lisp_Object maps, tail, thisseq;
1889 /* Does the current sequence end in the meta-prefix-char? */ 1888 /* Does the current sequence end in the meta-prefix-char? */
1890 int is_metized; 1889 bool is_metized;
1891}; 1890};
1892 1891
1893static void 1892static void
@@ -1898,7 +1897,7 @@ accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void *
1898 Lisp_Object maps = d->maps; 1897 Lisp_Object maps = d->maps;
1899 Lisp_Object tail = d->tail; 1898 Lisp_Object tail = d->tail;
1900 Lisp_Object thisseq = d->thisseq; 1899 Lisp_Object thisseq = d->thisseq;
1901 int is_metized = d->is_metized && INTEGERP (key); 1900 bool is_metized = d->is_metized && INTEGERP (key);
1902 Lisp_Object tem; 1901 Lisp_Object tem;
1903 1902
1904 cmd = get_keymap (get_keyelt (cmd, 0), 0, 0); 1903 cmd = get_keymap (get_keyelt (cmd, 0), 0, 0);
@@ -2060,7 +2059,7 @@ The `kbd' macro is an approximate inverse of this. */)
2060 Lisp_Object sep = build_string (" "); 2059 Lisp_Object sep = build_string (" ");
2061 Lisp_Object key; 2060 Lisp_Object key;
2062 Lisp_Object result; 2061 Lisp_Object result;
2063 int add_meta = 0; 2062 bool add_meta = 0;
2064 USE_SAFE_ALLOCA; 2063 USE_SAFE_ALLOCA;
2065 2064
2066 if (!NILP (prefix)) 2065 if (!NILP (prefix))
@@ -2155,9 +2154,10 @@ The `kbd' macro is an approximate inverse of this. */)
2155 2154
2156 2155
2157char * 2156char *
2158push_key_description (EMACS_INT ch, char *p, int force_multibyte) 2157push_key_description (EMACS_INT ch, char *p)
2159{ 2158{
2160 int c, c2, tab_as_ci; 2159 int c, c2;
2160 bool tab_as_ci;
2161 2161
2162 /* Clear all the meaningless bits above the meta bit. */ 2162 /* Clear all the meaningless bits above the meta bit. */
2163 c = ch & (meta_modifier | ~ - meta_modifier); 2163 c = ch & (meta_modifier | ~ - meta_modifier);
@@ -2256,21 +2256,12 @@ push_key_description (EMACS_INT ch, char *p, int force_multibyte)
2256 *p++ = 'P'; 2256 *p++ = 'P';
2257 *p++ = 'C'; 2257 *p++ = 'C';
2258 } 2258 }
2259 else if (c < 128 2259 else if (c < 128)
2260 || (NILP (BVAR (current_buffer, enable_multibyte_characters)) 2260 *p++ = c;
2261 && SINGLE_BYTE_CHAR_P (c)
2262 && !force_multibyte))
2263 {
2264 *p++ = c;
2265 }
2266 else 2261 else
2267 { 2262 {
2268 /* Now we are sure that C is a valid character code. */ 2263 /* Now we are sure that C is a valid character code. */
2269 if (NILP (BVAR (current_buffer, enable_multibyte_characters)) 2264 p += CHAR_STRING (c, (unsigned char *) p);
2270 && ! force_multibyte)
2271 *p++ = multibyte_char_to_unibyte (c);
2272 else
2273 p += CHAR_STRING (c, (unsigned char *) p);
2274 } 2265 }
2275 2266
2276 return p; 2267 return p;
@@ -2299,9 +2290,8 @@ around function keys and event symbols. */)
2299 2290
2300 if (INTEGERP (key)) /* Normal character. */ 2291 if (INTEGERP (key)) /* Normal character. */
2301 { 2292 {
2302 char tem[KEY_DESCRIPTION_SIZE], *p; 2293 char tem[KEY_DESCRIPTION_SIZE];
2303 2294 char *p = push_key_description (XINT (key), tem);
2304 p = push_key_description (XINT (key), tem, 1);
2305 *p = 0; 2295 *p = 0;
2306 return make_specified_string (tem, -1, p - tem, 1); 2296 return make_specified_string (tem, -1, p - tem, 1);
2307 } 2297 }
@@ -2429,7 +2419,7 @@ static void where_is_internal_1 (Lisp_Object key, Lisp_Object binding,
2429 2419
2430static Lisp_Object 2420static Lisp_Object
2431shadow_lookup (Lisp_Object shadow, Lisp_Object key, Lisp_Object flag, 2421shadow_lookup (Lisp_Object shadow, Lisp_Object key, Lisp_Object flag,
2432 int remap) 2422 bool remap)
2433{ 2423{
2434 Lisp_Object tail, value; 2424 Lisp_Object tail, value;
2435 2425
@@ -2461,7 +2451,7 @@ static Lisp_Object Vmouse_events;
2461 2451
2462struct where_is_internal_data { 2452struct where_is_internal_data {
2463 Lisp_Object definition, this, last; 2453 Lisp_Object definition, this, last;
2464 int last_is_meta, noindirect; 2454 bool last_is_meta, noindirect;
2465 Lisp_Object sequences; 2455 Lisp_Object sequences;
2466}; 2456};
2467 2457
@@ -2474,7 +2464,7 @@ struct where_is_internal_data {
2474 2464
2475static Lisp_Object 2465static Lisp_Object
2476where_is_internal (Lisp_Object definition, Lisp_Object keymaps, 2466where_is_internal (Lisp_Object definition, Lisp_Object keymaps,
2477 int noindirect, int nomenus) 2467 bool noindirect, bool nomenus)
2478{ 2468{
2479 Lisp_Object maps = Qnil; 2469 Lisp_Object maps = Qnil;
2480 Lisp_Object found; 2470 Lisp_Object found;
@@ -2523,7 +2513,7 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps,
2523 [M-CHAR] sequences, check if last character of the sequence 2513 [M-CHAR] sequences, check if last character of the sequence
2524 is the meta-prefix char. */ 2514 is the meta-prefix char. */
2525 Lisp_Object last; 2515 Lisp_Object last;
2526 int last_is_meta; 2516 bool last_is_meta;
2527 2517
2528 this = Fcar (XCAR (maps)); 2518 this = Fcar (XCAR (maps));
2529 map = Fcdr (XCAR (maps)); 2519 map = Fcdr (XCAR (maps));
@@ -2606,7 +2596,7 @@ The optional 5th arg NO-REMAP alters how command remapping is handled:
2606 /* Actually relevant bindings. */ 2596 /* Actually relevant bindings. */
2607 Lisp_Object found = Qnil; 2597 Lisp_Object found = Qnil;
2608 /* 1 means ignore all menu bindings entirely. */ 2598 /* 1 means ignore all menu bindings entirely. */
2609 int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii); 2599 bool nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
2610 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; 2600 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
2611 /* List of sequences found via remapping. Keep them in a separate 2601 /* List of sequences found via remapping. Keep them in a separate
2612 variable, so as to push them later, since we prefer 2602 variable, so as to push them later, since we prefer
@@ -2615,7 +2605,7 @@ The optional 5th arg NO-REMAP alters how command remapping is handled:
2615 /* Whether or not we're handling remapped sequences. This is needed 2605 /* Whether or not we're handling remapped sequences. This is needed
2616 because remapping is not done recursively by Fcommand_remapping: you 2606 because remapping is not done recursively by Fcommand_remapping: you
2617 can't remap a remapped command. */ 2607 can't remap a remapped command. */
2618 int remapped = 0; 2608 bool remapped = 0;
2619 Lisp_Object tem = Qnil; 2609 Lisp_Object tem = Qnil;
2620 2610
2621 /* Refresh the C version of the modifier preference. */ 2611 /* Refresh the C version of the modifier preference. */
@@ -2767,10 +2757,10 @@ where_is_internal_1 (Lisp_Object key, Lisp_Object binding, Lisp_Object args, voi
2767{ 2757{
2768 struct where_is_internal_data *d = data; /* Cast! */ 2758 struct where_is_internal_data *d = data; /* Cast! */
2769 Lisp_Object definition = d->definition; 2759 Lisp_Object definition = d->definition;
2770 int noindirect = d->noindirect; 2760 bool noindirect = d->noindirect;
2771 Lisp_Object this = d->this; 2761 Lisp_Object this = d->this;
2772 Lisp_Object last = d->last; 2762 Lisp_Object last = d->last;
2773 int last_is_meta = d->last_is_meta; 2763 bool last_is_meta = d->last_is_meta;
2774 Lisp_Object sequence; 2764 Lisp_Object sequence;
2775 2765
2776 /* Search through indirections unless that's not wanted. */ 2766 /* Search through indirections unless that's not wanted. */
@@ -2821,8 +2811,8 @@ The optional argument MENUS, if non-nil, says to mention menu bindings.
2821 (Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus) 2811 (Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus)
2822{ 2812{
2823 Lisp_Object outbuf, shadow; 2813 Lisp_Object outbuf, shadow;
2824 int nomenu = NILP (menus); 2814 bool nomenu = NILP (menus);
2825 register Lisp_Object start1; 2815 Lisp_Object start1;
2826 struct gcpro gcpro1; 2816 struct gcpro gcpro1;
2827 2817
2828 const char *alternate_heading 2818 const char *alternate_heading
@@ -2857,10 +2847,10 @@ You type Translation\n\
2857 alternate_heading = 0; 2847 alternate_heading = 0;
2858 } 2848 }
2859 2849
2860 bufend = push_key_description (translate[c], buf, 1); 2850 bufend = push_key_description (translate[c], buf);
2861 insert (buf, bufend - buf); 2851 insert (buf, bufend - buf);
2862 Findent_to (make_number (16), make_number (1)); 2852 Findent_to (make_number (16), make_number (1));
2863 bufend = push_key_description (c, buf, 1); 2853 bufend = push_key_description (c, buf);
2864 insert (buf, bufend - buf); 2854 insert (buf, bufend - buf);
2865 2855
2866 insert ("\n", 1); 2856 insert ("\n", 1);
@@ -2977,34 +2967,34 @@ You type Translation\n\
2977 2967
2978/* Insert a description of the key bindings in STARTMAP, 2968/* Insert a description of the key bindings in STARTMAP,
2979 followed by those of all maps reachable through STARTMAP. 2969 followed by those of all maps reachable through STARTMAP.
2980 If PARTIAL is nonzero, omit certain "uninteresting" commands 2970 If PARTIAL, omit certain "uninteresting" commands
2981 (such as `undefined'). 2971 (such as `undefined').
2982 If SHADOW is non-nil, it is a list of maps; 2972 If SHADOW is non-nil, it is a list of maps;
2983 don't mention keys which would be shadowed by any of them. 2973 don't mention keys which would be shadowed by any of them.
2984 PREFIX, if non-nil, says mention only keys that start with PREFIX. 2974 PREFIX, if non-nil, says mention only keys that start with PREFIX.
2985 TITLE, if not 0, is a string to insert at the beginning. 2975 TITLE, if not 0, is a string to insert at the beginning.
2986 TITLE should not end with a colon or a newline; we supply that. 2976 TITLE should not end with a colon or a newline; we supply that.
2987 If NOMENU is not 0, then omit menu-bar commands. 2977 If NOMENU, then omit menu-bar commands.
2988 2978
2989 If TRANSL is nonzero, the definitions are actually key translations 2979 If TRANSL, the definitions are actually key translations
2990 so print strings and vectors differently. 2980 so print strings and vectors differently.
2991 2981
2992 If ALWAYS_TITLE is nonzero, print the title even if there are no maps 2982 If ALWAYS_TITLE, print the title even if there are no maps
2993 to look through. 2983 to look through.
2994 2984
2995 If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW, 2985 If MENTION_SHADOW, then when something is shadowed by SHADOW,
2996 don't omit it; instead, mention it but say it is shadowed. 2986 don't omit it; instead, mention it but say it is shadowed.
2997 2987
2998 Any inserted text ends in two newlines (used by `help-make-xrefs'). */ 2988 Any inserted text ends in two newlines (used by `help-make-xrefs'). */
2999 2989
3000void 2990void
3001describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, 2991describe_map_tree (Lisp_Object startmap, bool partial, Lisp_Object shadow,
3002 Lisp_Object prefix, const char *title, int nomenu, int transl, 2992 Lisp_Object prefix, const char *title, bool nomenu,
3003 int always_title, int mention_shadow) 2993 bool transl, bool always_title, bool mention_shadow)
3004{ 2994{
3005 Lisp_Object maps, orig_maps, seen, sub_shadows; 2995 Lisp_Object maps, orig_maps, seen, sub_shadows;
3006 struct gcpro gcpro1, gcpro2, gcpro3; 2996 struct gcpro gcpro1, gcpro2, gcpro3;
3007 int something = 0; 2997 bool something = 0;
3008 const char *key_heading 2998 const char *key_heading
3009 = "\ 2999 = "\
3010key binding\n\ 3000key binding\n\
@@ -3179,7 +3169,12 @@ describe_translation (Lisp_Object definition, Lisp_Object args)
3179 into an array of `struct describe_map_elt', 3169 into an array of `struct describe_map_elt',
3180 then sorts them by the events. */ 3170 then sorts them by the events. */
3181 3171
3182struct describe_map_elt { Lisp_Object event; Lisp_Object definition; int shadowed; }; 3172struct describe_map_elt
3173{
3174 Lisp_Object event;
3175 Lisp_Object definition;
3176 bool shadowed;
3177};
3183 3178
3184/* qsort comparison function for sorting `struct describe_map_elt' by 3179/* qsort comparison function for sorting `struct describe_map_elt' by
3185 the event field. */ 3180 the event field. */
@@ -3209,14 +3204,14 @@ describe_map_compare (const void *aa, const void *bb)
3209static void 3204static void
3210describe_map (Lisp_Object map, Lisp_Object prefix, 3205describe_map (Lisp_Object map, Lisp_Object prefix,
3211 void (*elt_describer) (Lisp_Object, Lisp_Object), 3206 void (*elt_describer) (Lisp_Object, Lisp_Object),
3212 int partial, Lisp_Object shadow, 3207 bool partial, Lisp_Object shadow,
3213 Lisp_Object *seen, int nomenu, int mention_shadow) 3208 Lisp_Object *seen, bool nomenu, bool mention_shadow)
3214{ 3209{
3215 Lisp_Object tail, definition, event; 3210 Lisp_Object tail, definition, event;
3216 Lisp_Object tem; 3211 Lisp_Object tem;
3217 Lisp_Object suppress; 3212 Lisp_Object suppress;
3218 Lisp_Object kludge; 3213 Lisp_Object kludge;
3219 int first = 1; 3214 bool first = 1;
3220 struct gcpro gcpro1, gcpro2, gcpro3; 3215 struct gcpro gcpro1, gcpro2, gcpro3;
3221 3216
3222 /* These accumulate the values from sparse keymap bindings, 3217 /* These accumulate the values from sparse keymap bindings,
@@ -3258,7 +3253,7 @@ describe_map (Lisp_Object map, Lisp_Object prefix,
3258 1, mention_shadow); 3253 1, mention_shadow);
3259 else if (CONSP (XCAR (tail))) 3254 else if (CONSP (XCAR (tail)))
3260 { 3255 {
3261 int this_shadowed = 0; 3256 bool this_shadowed = 0;
3262 3257
3263 event = XCAR (XCAR (tail)); 3258 event = XCAR (XCAR (tail));
3264 3259
@@ -3428,7 +3423,7 @@ DESCRIBER is the output function used; nil means use `princ'. */)
3428 of bytes that lead to the character set or portion of a character 3423 of bytes that lead to the character set or portion of a character
3429 set described by this chartable. 3424 set described by this chartable.
3430 3425
3431 If PARTIAL is nonzero, it means do not mention suppressed commands 3426 If PARTIAL, it means do not mention suppressed commands
3432 (that assumes the vector is in a keymap). 3427 (that assumes the vector is in a keymap).
3433 3428
3434 SHADOW is a list of keymaps that shadow this map. 3429 SHADOW is a list of keymaps that shadow this map.
@@ -3448,8 +3443,8 @@ DESCRIBER is the output function used; nil means use `princ'. */)
3448static void 3443static void
3449describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, 3444describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3450 void (*elt_describer) (Lisp_Object, Lisp_Object), 3445 void (*elt_describer) (Lisp_Object, Lisp_Object),
3451 int partial, Lisp_Object shadow, Lisp_Object entire_map, 3446 bool partial, Lisp_Object shadow, Lisp_Object entire_map,
3452 int keymap_p, int mention_shadow) 3447 bool keymap_p, bool mention_shadow)
3453{ 3448{
3454 Lisp_Object definition; 3449 Lisp_Object definition;
3455 Lisp_Object tem2; 3450 Lisp_Object tem2;
@@ -3457,7 +3452,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3457 int i; 3452 int i;
3458 Lisp_Object suppress; 3453 Lisp_Object suppress;
3459 Lisp_Object kludge; 3454 Lisp_Object kludge;
3460 int first = 1; 3455 bool first = 1;
3461 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 3456 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
3462 /* Range of elements to be handled. */ 3457 /* Range of elements to be handled. */
3463 int from, to, stop; 3458 int from, to, stop;
@@ -3497,7 +3492,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3497 3492
3498 for (i = from; ; i++) 3493 for (i = from; ; i++)
3499 { 3494 {
3500 int this_shadowed = 0; 3495 bool this_shadowed = 0;
3501 int range_beg, range_end; 3496 int range_beg, range_end;
3502 Lisp_Object val; 3497 Lisp_Object val;
3503 3498