comparison src/keymap.c @ 20319:81424cf4d446

(copy_keymap_1): Fix return type. (accessible_keymaps_char_table): Likewise. (where_is_internal_2): Likewise. (describe_vector_princ): Likewise. (Ftext_char_description): Fix type of `str'. (describe_vector): Likewise. Protoize parameter.
author Andreas Schwab <schwab@suse.de>
date Fri, 21 Nov 1997 15:18:28 +0000
parents 374e09781f08
children 0b6c4f1041ae
comparison
equal deleted inserted replaced
20318:1507c5324f4c 20319:81424cf4d446
675 } 675 }
676 676
677 return def; 677 return def;
678 } 678 }
679 679
680 Lisp_Object 680 void
681 copy_keymap_1 (chartable, idx, elt) 681 copy_keymap_1 (chartable, idx, elt)
682 Lisp_Object chartable, idx, elt; 682 Lisp_Object chartable, idx, elt;
683 { 683 {
684 if (!SYMBOLP (elt) && ! NILP (Fkeymapp (elt))) 684 if (!SYMBOLP (elt) && ! NILP (Fkeymapp (elt)))
685 Faset (chartable, idx, Fcopy_keymap (elt)); 685 Faset (chartable, idx, Fcopy_keymap (elt));
1336 return Flist (nmaps, maps); 1336 return Flist (nmaps, maps);
1337 } 1337 }
1338 1338
1339 /* Help functions for describing and documenting keymaps. */ 1339 /* Help functions for describing and documenting keymaps. */
1340 1340
1341 static Lisp_Object accessible_keymaps_char_table (); 1341 static void accessible_keymaps_char_table ();
1342 1342
1343 /* This function cannot GC. */ 1343 /* This function cannot GC. */
1344 1344
1345 DEFUN ("accessible-keymaps", Faccessible_keymaps, Saccessible_keymaps, 1345 DEFUN ("accessible-keymaps", Faccessible_keymaps, Saccessible_keymaps,
1346 1, 2, 0, 1346 1, 2, 0,
1559 } 1559 }
1560 1560
1561 return Fnreverse (good_maps); 1561 return Fnreverse (good_maps);
1562 } 1562 }
1563 1563
1564 static Lisp_Object 1564 static void
1565 accessible_keymaps_char_table (args, index, cmd) 1565 accessible_keymaps_char_table (args, index, cmd)
1566 Lisp_Object args, index, cmd; 1566 Lisp_Object args, index, cmd;
1567 { 1567 {
1568 Lisp_Object tem; 1568 Lisp_Object tem;
1569 Lisp_Object maps, tail, thisseq; 1569 Lisp_Object maps, tail, thisseq;
1570 1570
1571 if (NILP (cmd)) 1571 if (NILP (cmd))
1572 return Qnil; 1572 return;
1573 1573
1574 maps = XCONS (args)->car; 1574 maps = XCONS (args)->car;
1575 tail = XCONS (XCONS (args)->cdr)->car; 1575 tail = XCONS (XCONS (args)->cdr)->car;
1576 thisseq = XCONS (XCONS (args)->cdr)->cdr; 1576 thisseq = XCONS (XCONS (args)->cdr)->cdr;
1577 1577
1585 { 1585 {
1586 tem = append_key (thisseq, index); 1586 tem = append_key (thisseq, index);
1587 nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil)); 1587 nconc2 (tail, Fcons (Fcons (tem, cmd), Qnil));
1588 } 1588 }
1589 } 1589 }
1590 return Qnil;
1591 } 1590 }
1592 1591
1593 Lisp_Object Qsingle_key_description, Qkey_description; 1592 Lisp_Object Qsingle_key_description, Qkey_description;
1594 1593
1595 /* This function cannot GC. */ 1594 /* This function cannot GC. */
1814 1813
1815 CHECK_NUMBER (character, 0); 1814 CHECK_NUMBER (character, 0);
1816 1815
1817 if (!SINGLE_BYTE_CHAR_P (XFASTINT (character))) 1816 if (!SINGLE_BYTE_CHAR_P (XFASTINT (character)))
1818 { 1817 {
1819 char *str; 1818 unsigned char *str;
1820 int len = non_ascii_char_to_string (XFASTINT (character), tem, &str); 1819 int len = non_ascii_char_to_string (XFASTINT (character), tem, &str);
1821 1820
1822 return make_string (str, len); 1821 return make_string (str, len);
1823 } 1822 }
1824 1823
1853 1852
1854 1853
1855 /* where-is - finding a command in a set of keymaps. */ 1854 /* where-is - finding a command in a set of keymaps. */
1856 1855
1857 static Lisp_Object where_is_internal_1 (); 1856 static Lisp_Object where_is_internal_1 ();
1858 static Lisp_Object where_is_internal_2 (); 1857 static void where_is_internal_2 ();
1859 1858
1860 /* This function can GC if Flookup_key autoloads any keymaps. */ 1859 /* This function can GC if Flookup_key autoloads any keymaps. */
1861 1860
1862 DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 4, 0, 1861 DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 4, 0,
1863 "Return list of keys that invoke DEFINITION.\n\ 1862 "Return list of keys that invoke DEFINITION.\n\
2052 . 2051 .
2053 ((THIS . LAST) . (NOMENUS . LAST_IS_META))) 2052 ((THIS . LAST) . (NOMENUS . LAST_IS_META)))
2054 Since map_char_table doesn't really use the return value from this function, 2053 Since map_char_table doesn't really use the return value from this function,
2055 we the result append to RESULT, the slot in ARGS. */ 2054 we the result append to RESULT, the slot in ARGS. */
2056 2055
2057 static Lisp_Object 2056 static void
2058 where_is_internal_2 (args, key, binding) 2057 where_is_internal_2 (args, key, binding)
2059 Lisp_Object args, key, binding; 2058 Lisp_Object args, key, binding;
2060 { 2059 {
2061 Lisp_Object definition, noindirect, keymap, this, last; 2060 Lisp_Object definition, noindirect, keymap, this, last;
2062 Lisp_Object result, sequence; 2061 Lisp_Object result, sequence;
2075 this, last, nomenus, last_is_meta); 2074 this, last, nomenus, last_is_meta);
2076 2075
2077 if (!NILP (sequence)) 2076 if (!NILP (sequence))
2078 XCONS (XCONS (XCONS (args)->car)->cdr)->cdr 2077 XCONS (XCONS (XCONS (args)->car)->cdr)->cdr
2079 = Fcons (sequence, result); 2078 = Fcons (sequence, result);
2080
2081 return Qnil;
2082 } 2079 }
2083 2080
2084 static Lisp_Object 2081 static Lisp_Object
2085 where_is_internal_1 (binding, key, definition, noindirect, keymap, this, last, 2082 where_is_internal_1 (binding, key, definition, noindirect, keymap, this, last,
2086 nomenus, last_is_meta) 2083 nomenus, last_is_meta)
2659 } 2656 }
2660 2657
2661 UNGCPRO; 2658 UNGCPRO;
2662 } 2659 }
2663 2660
2664 static int 2661 static void
2665 describe_vector_princ (elt) 2662 describe_vector_princ (elt)
2666 Lisp_Object elt; 2663 Lisp_Object elt;
2667 { 2664 {
2668 Findent_to (make_number (16), make_number (1)); 2665 Findent_to (make_number (16), make_number (1));
2669 Fprinc (elt, Qnil); 2666 Fprinc (elt, Qnil);
2714 2711
2715 When describing a sub-char-table, INDICES is a list of 2712 When describing a sub-char-table, INDICES is a list of
2716 indices at higher levels in this char-table, 2713 indices at higher levels in this char-table,
2717 and CHAR_TABLE_DEPTH says how many levels down we have gone. */ 2714 and CHAR_TABLE_DEPTH says how many levels down we have gone. */
2718 2715
2716 void.
2719 describe_vector (vector, elt_prefix, elt_describer, 2717 describe_vector (vector, elt_prefix, elt_describer,
2720 partial, shadow, entire_map, 2718 partial, shadow, entire_map,
2721 indices, char_table_depth) 2719 indices, char_table_depth)
2722 register Lisp_Object vector; 2720 register Lisp_Object vector;
2723 Lisp_Object elt_prefix; 2721 Lisp_Object elt_prefix;
2724 int (*elt_describer) (); 2722 void (*elt_describer) P_ ((Lisp_Object));
2725 int partial; 2723 int partial;
2726 Lisp_Object shadow; 2724 Lisp_Object shadow;
2727 Lisp_Object entire_map; 2725 Lisp_Object entire_map;
2728 int *indices; 2726 int *indices;
2729 int char_table_depth; 2727 int char_table_depth;