/[emacs]/emacs/src/keymap.c
ViewVC logotype

Diff of /emacs/src/keymap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.282 by rms, Sat May 17 12:47:55 2003 UTC revision 1.282.4.1 by handa, Mon Sep 8 12:48:11 2003 UTC
# Line 25  Boston, MA 02111-1307, USA.  */ Line 25  Boston, MA 02111-1307, USA.  */
25  #include "lisp.h"  #include "lisp.h"
26  #include "commands.h"  #include "commands.h"
27  #include "buffer.h"  #include "buffer.h"
28    #include "character.h"
29  #include "charset.h"  #include "charset.h"
30  #include "keyboard.h"  #include "keyboard.h"
31  #include "termhooks.h"  #include "termhooks.h"
# Line 413  PARENT should be nil or another keymap. Line 414  PARENT should be nil or another keymap.
414            Lisp_Object indices[3];            Lisp_Object indices[3];
415    
416            map_char_table (fix_submap_inheritance, Qnil,            map_char_table (fix_submap_inheritance, Qnil,
417                            XCAR (list), XCAR (list),                            XCAR (list), keymap);
                           keymap, 0, indices);  
418          }          }
419      }      }
420    
# Line 550  access_keymap (map, idx, t_ok, noinherit Line 550  access_keymap (map, idx, t_ok, noinherit
550    
551      GCPRO4 (map, tail, idx, t_binding);      GCPRO4 (map, tail, idx, t_binding);
552    
553      /* If `t_ok' is 2, both `t' and generic-char bindings are accepted.      /* If `t_ok' is 2, both `t' is accepted.  */
        If it is 1, only generic-char bindings are accepted.  
        Otherwise, neither are.  */  
554      t_ok = t_ok ? 2 : 0;      t_ok = t_ok ? 2 : 0;
555    
556      for (tail = XCDR (map);      for (tail = XCDR (map);
# Line 576  access_keymap (map, idx, t_ok, noinherit Line 574  access_keymap (map, idx, t_ok, noinherit
574    
575              if (EQ (key, idx))              if (EQ (key, idx))
576                val = XCDR (binding);                val = XCDR (binding);
             else if (t_ok  
                      && INTEGERP (idx)  
                      && (XINT (idx) & CHAR_MODIFIER_MASK) == 0  
                      && INTEGERP (key)  
                      && (XINT (key) & CHAR_MODIFIER_MASK) == 0  
                      && !SINGLE_BYTE_CHAR_P (XINT (idx))  
                      && !SINGLE_BYTE_CHAR_P (XINT (key))  
                      && CHAR_VALID_P (XINT (key), 1)  
                      && !CHAR_VALID_P (XINT (key), 0)  
                      && (CHAR_CHARSET (XINT (key))  
                          == CHAR_CHARSET (XINT (idx))))  
               {  
                 /* KEY is the generic character of the charset of IDX.  
                    Use KEY's binding if there isn't a binding for IDX  
                    itself.  */  
                 t_binding = XCDR (binding);  
                 t_ok = 0;  
               }  
577              else if (t_ok > 1 && EQ (key, Qt))              else if (t_ok > 1 && EQ (key, Qt))
578                {                {
579                  t_binding = XCDR (binding);                  t_binding = XCDR (binding);
# Line 687  map_keymap (map, fun, args, data, autolo Line 667  map_keymap (map, fun, args, data, autolo
667         tail = XCDR (tail))         tail = XCDR (tail))
668      {      {
669        Lisp_Object binding = XCAR (tail);        Lisp_Object binding = XCAR (tail);
670          
671        if (CONSP (binding))        if (CONSP (binding))
672          map_keymap_item (fun, args, XCAR (binding), XCDR (binding), data);          map_keymap_item (fun, args, XCAR (binding), XCDR (binding), data);
673        else if (VECTORP (binding))        else if (VECTORP (binding))
# Line 706  map_keymap (map, fun, args, data, autolo Line 686  map_keymap (map, fun, args, data, autolo
686        else if (CHAR_TABLE_P (binding))        else if (CHAR_TABLE_P (binding))
687          {          {
688            Lisp_Object indices[3];            Lisp_Object indices[3];
689            map_char_table (map_keymap_char_table_item, Qnil, binding, binding,            map_char_table (map_keymap_char_table_item, Qnil, binding,
690                            Fcons (make_save_value (fun, 0),                            Fcons (make_save_value (fun, 0),
691                                   Fcons (make_save_value (data, 0),                                   Fcons (make_save_value (data, 0),
692                                          args)),                                          args)));
                           0, indices);  
693          }          }
694      }      }
695    UNGCPRO;    UNGCPRO;
# Line 906  store_in_keymap (keymap, idx, def) Line 885  store_in_keymap (keymap, idx, def)
885                         NILP (def) ? Qt : def);                         NILP (def) ? Qt : def);
886                  return def;                  return def;
887                }                }
888                else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
889                  {
890                    Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
891                    return def;
892                  }
893              insertion_point = tail;              insertion_point = tail;
894            }            }
895          else if (CONSP (elt))          else if (CONSP (elt))
# Line 1016  static void Line 1000  static void
1000  copy_keymap_1 (chartable, idx, elt)  copy_keymap_1 (chartable, idx, elt)
1001       Lisp_Object chartable, idx, elt;       Lisp_Object chartable, idx, elt;
1002  {  {
1003    Faset (chartable, idx, copy_keymap_item (elt));    Fset_char_table_range (chartable, idx, copy_keymap_item (elt));
1004  }  }
1005    
1006  DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0,  DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0,
# Line 1041  is not copied.  */) Line 1025  is not copied.  */)
1025          {          {
1026            Lisp_Object indices[3];            Lisp_Object indices[3];
1027            elt = Fcopy_sequence (elt);            elt = Fcopy_sequence (elt);
1028            map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices);            map_char_table (copy_keymap_1, Qnil, elt, elt);
1029          }          }
1030        else if (VECTORP (elt))        else if (VECTORP (elt))
1031          {          {
# Line 1122  binding KEY to DEF is added at the front Line 1106  binding KEY to DEF is added at the front
1106      {      {
1107        c = Faref (key, make_number (idx));        c = Faref (key, make_number (idx));
1108    
1109        if (CONSP (c) && lucid_event_type_list_p (c))        if (CONSP (c))
1110          c = Fevent_convert_list (c);          {
1111              /* C may be a cons (FROM . TO) specifying a range of
1112                 characters.  */
1113              if (CHARACTERP (XCAR (c)))
1114                CHECK_CHARACTER_CDR (c);
1115              else if (lucid_event_type_list_p (c))
1116                c = Fevent_convert_list (c);
1117            }
1118    
1119        if (SYMBOLP (c))        if (SYMBOLP (c))
1120          silly_event_symbol_error (c);          silly_event_symbol_error (c);
# Line 1144  binding KEY to DEF is added at the front Line 1135  binding KEY to DEF is added at the front
1135            idx++;            idx++;
1136          }          }
1137    
1138        if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c))        if (!INTEGERP (c) && !SYMBOLP (c)
1139              && (!CONSP (c)
1140                  /* If C is a range, it must be a leaf.  */
1141                  || (INTEGERP (XCAR (c)) && idx != length)))
1142          error ("Key sequence contains invalid event");          error ("Key sequence contains invalid event");
1143    
1144        if (idx == length)        if (idx == length)
# Line 1792  accessible_keymaps_1 (key, cmd, maps, ta Line 1786  accessible_keymaps_1 (key, cmd, maps, ta
1786        int meta_bit = meta_modifier;        int meta_bit = meta_modifier;
1787        Lisp_Object last = make_number (XINT (Flength (thisseq)) - 1);        Lisp_Object last = make_number (XINT (Flength (thisseq)) - 1);
1788        tem = Fcopy_sequence (thisseq);        tem = Fcopy_sequence (thisseq);
1789          
1790        Faset (tem, last, make_number (XINT (key) | meta_bit));        Faset (tem, last, make_number (XINT (key) | meta_bit));
1791          
1792        /* This new sequence is the same length as        /* This new sequence is the same length as
1793           thisseq, so stick it in the list right           thisseq, so stick it in the list right
1794           after this one.  */           after this one.  */
# Line 1915  then the value includes only maps for pr Line 1909  then the value includes only maps for pr
1909              {              {
1910                Lisp_Object indices[3];                Lisp_Object indices[3];
1911    
1912                map_char_table (accessible_keymaps_char_table, Qnil, elt,                map_char_table (accessible_keymaps_char_table, Qnil,
1913                                elt, Fcons (Fcons (maps, make_number (is_metized)),                                elt, Fcons (Fcons (maps, make_number (is_metized)),
1914                                            Fcons (tail, thisseq)),                                            Fcons (tail, thisseq)));
                               0, indices);  
1915              }              }
1916            else if (VECTORP (elt))            else if (VECTORP (elt))
1917              {              {
# Line 2115  push_key_description (c, p, force_multib Line 2108  push_key_description (c, p, force_multib
2108      {      {
2109        *p++ = c;        *p++ = c;
2110      }      }
2111      else if (CHARACTERP (make_number (c)))
2112        {
2113          if (NILP (current_buffer->enable_multibyte_characters)
2114              && ! force_multibyte)
2115            *p++ = multibyte_char_to_unibyte (c, Qnil);
2116          else
2117            p += CHAR_STRING (c, (unsigned char *) p);
2118        }
2119    else    else
2120      {      {
2121        int valid_p = SINGLE_BYTE_CHAR_P (c) || char_valid_p (c, 0);        int bit_offset;
2122          *p++ = '\\';
2123        if (force_multibyte && valid_p)        /* The biggest character code uses 22 bits.  */
2124          for (bit_offset = 21; bit_offset >= 0; bit_offset -= 3)
2125          {          {
2126            if (SINGLE_BYTE_CHAR_P (c))            if (c >= (1 << bit_offset))
2127              c = unibyte_char_to_multibyte (c);              *p++ = ((c & (7 << bit_offset)) >> bit_offset) + '0';
           p += CHAR_STRING (c, p);  
         }  
       else if (NILP (current_buffer->enable_multibyte_characters)  
                || valid_p)  
         {  
           int bit_offset;  
           *p++ = '\\';  
           /* The biggest character code uses 19 bits.  */  
           for (bit_offset = 18; bit_offset >= 0; bit_offset -= 3)  
             {  
               if (c >= (1 << bit_offset))  
                 *p++ = ((c & (7 << bit_offset)) >> bit_offset) + '0';  
             }  
2128          }          }
       else  
         p += CHAR_STRING (c, p);  
2129      }      }
2130    
2131    return p;    return p;
# Line 2162  around function keys and event symbols. Line 2149  around function keys and event symbols.
2149    
2150    if (INTEGERP (key))           /* Normal character */    if (INTEGERP (key))           /* Normal character */
2151      {      {
2152        unsigned int charset, c1, c2;        char tem[KEY_DESCRIPTION_SIZE];
       int without_bits = XINT (key) & ~((-1) << CHARACTERBITS);  
   
       if (SINGLE_BYTE_CHAR_P (without_bits))  
         charset = 0;  
       else  
         SPLIT_CHAR (without_bits, charset, c1, c2);  
2153    
2154        if (charset        *push_key_description (XUINT (key), tem, 1) = 0;
2155            && CHARSET_DEFINED_P (charset)        return build_string (tem);
           && ((c1 >= 0 && c1 < 32)  
               || (c2 >= 0 && c2 < 32)))  
         {  
           /* Handle a generic character.  */  
           Lisp_Object name;  
           name = CHARSET_TABLE_INFO (charset, CHARSET_LONG_NAME_IDX);  
           CHECK_STRING (name);  
           return concat2 (build_string ("Character set "), name);  
         }  
       else  
         {  
           char tem[KEY_DESCRIPTION_SIZE], *end;  
           int nbytes, nchars;  
           Lisp_Object string;  
   
           end = push_key_description (XUINT (key), tem, 1);  
           nbytes = end - tem;  
           nchars = multibyte_chars_in_text (tem, nbytes);  
           if (nchars == nbytes)  
             {  
               *end = '\0';  
               string = build_string (tem);  
             }  
           else  
             string = make_multibyte_string (tem, nchars, nbytes);  
           return string;  
         }  
2156      }      }
2157    else if (SYMBOLP (key))       /* Function key or event-symbol */    else if (SYMBOLP (key))       /* Function key or event-symbol */
2158      {      {
# Line 2260  Control characters turn into "^char", et Line 2214  Control characters turn into "^char", et
2214    CHECK_NUMBER (character);    CHECK_NUMBER (character);
2215    
2216    c = XINT (character);    c = XINT (character);
2217    if (!SINGLE_BYTE_CHAR_P (c))    if (!ASCII_CHAR_P (c))
2218      {      {
2219        int len = CHAR_STRING (c, str);        int len = CHAR_STRING (c, str);
2220    
# Line 2432  where_is_internal (definition, keymaps, Line 2386  where_is_internal (definition, keymaps,
2386                              Fcons (Fcons (this, last),                              Fcons (Fcons (this, last),
2387                                     Fcons (make_number (nomenus),                                     Fcons (make_number (nomenus),
2388                                            make_number (last_is_meta))));                                            make_number (last_is_meta))));
2389                map_char_table (where_is_internal_2, Qnil, elt, elt, args,                map_char_table (where_is_internal_2, Qnil, elt, args);
                               0, indices);  
2390                sequences = XCDR (XCAR (args));                sequences = XCDR (XCAR (args));
2391              }              }
2392            else if (CONSP (elt))            else if (CONSP (elt))
# Line 3246  This is text showing the elements of vec Line 3199  This is text showing the elements of vec
3199     If the definition in effect in the whole map does not match     If the definition in effect in the whole map does not match
3200     the one in this vector, we ignore this one.     the one in this vector, we ignore this one.
3201    
3202     When describing a sub-char-table, INDICES is a list of     ARGS is simply passed as the second argument to ELT_DESCRIBER.
    indices at higher levels in this char-table,  
    and CHAR_TABLE_DEPTH says how many levels down we have gone.  
3203    
3204     ARGS is simply passed as the second argument to ELT_DESCRIBER.  */     INDICES and CHAR_TABLE_DEPTH are ignored.  They will be removed in
3205       the near future.  */
3206    
3207  void  void
3208  describe_vector (vector, elt_prefix, args, elt_describer,  describe_vector (vector, elt_prefix, args, elt_describer,
# Line 3267  describe_vector (vector, elt_prefix, arg Line 3219  describe_vector (vector, elt_prefix, arg
3219  {  {
3220    Lisp_Object definition;    Lisp_Object definition;
3221    Lisp_Object tem2;    Lisp_Object tem2;
3222    register int i;    int i;
3223    Lisp_Object suppress;    Lisp_Object suppress;
3224    Lisp_Object kludge;    Lisp_Object kludge;
   int first = 1;  
3225    struct gcpro gcpro1, gcpro2, gcpro3;    struct gcpro gcpro1, gcpro2, gcpro3;
3226    /* Range of elements to be handled.  */    /* Range of elements to be handled.  */
3227    int from, to;    int from, to;
3228    /* A flag to tell if a leaf in this level of char-table is not a    Lisp_Object character;
      generic character (i.e. a complete multibyte character).  */  
   int complete_char;  
   int character;  
3229    int starting_i;    int starting_i;
3230      int first = 1;
3231    
3232    suppress = Qnil;    suppress = Qnil;
3233    
   if (indices == 0)  
     indices = (int *) alloca (3 * sizeof (int));  
   
3234    definition = Qnil;    definition = Qnil;
3235    
3236    /* This vector gets used to present single keys to Flookup_key.  Since    /* This vector gets used to present single keys to Flookup_key.  Since
# Line 3296  describe_vector (vector, elt_prefix, arg Line 3242  describe_vector (vector, elt_prefix, arg
3242    if (partial)    if (partial)
3243      suppress = intern ("suppress-keymap");      suppress = intern ("suppress-keymap");
3244    
3245    if (CHAR_TABLE_P (vector))    from = 0;
3246      {    to = CHAR_TABLE_P (vector) ? MAX_CHAR + 1 : XVECTOR (vector)->size;
       if (char_table_depth == 0)  
         {  
           /* VECTOR is a top level char-table.  */  
           complete_char = 1;  
           from = 0;  
           to = CHAR_TABLE_ORDINARY_SLOTS;  
         }  
       else  
         {  
           /* VECTOR is a sub char-table.  */  
           if (char_table_depth >= 3)  
             /* A char-table is never that deep.  */  
             error ("Too deep char table");  
   
           complete_char  
             = (CHARSET_VALID_P (indices[0])  
                && ((CHARSET_DIMENSION (indices[0]) == 1  
                     && char_table_depth == 1)  
                    || char_table_depth == 2));  
   
           /* Meaningful elements are from 32th to 127th.  */  
           from = 32;  
           to = SUB_CHAR_TABLE_ORDINARY_SLOTS;  
         }  
     }  
   else  
     {  
       /* This does the right thing for ordinary vectors.  */  
   
       complete_char = 1;  
       from = 0;  
       to = XVECTOR (vector)->size;  
     }  
3247    
3248    for (i = from; i < to; i++)    for (i = from; i < to; i++)
3249      {      {
3250        QUIT;        int range_beg, range_end;
3251          Lisp_Object val;
3252    
3253        if (CHAR_TABLE_P (vector))        QUIT;
         {  
           if (char_table_depth == 0 && i >= CHAR_TABLE_SINGLE_BYTE_SLOTS)  
             complete_char = 0;  
3254    
3255            if (i >= CHAR_TABLE_SINGLE_BYTE_SLOTS        starting_i = i;
               && !CHARSET_DEFINED_P (i - 128))  
             continue;  
3256    
3257            definition        if (CHAR_TABLE_P (vector))
3258              = get_keyelt (XCHAR_TABLE (vector)->contents[i], 0);          val = char_table_ref_and_range (vector, i, &range_beg, &i);
         }  
3259        else        else
3260          definition = get_keyelt (AREF (vector, i), 0);          val = AREF (vector, i);
3261          definition = get_keyelt (val, 0);
3262    
3263        if (NILP (definition)) continue;        if (NILP (definition)) continue;
3264    
# Line 3363  describe_vector (vector, elt_prefix, arg Line 3272  describe_vector (vector, elt_prefix, arg
3272            if (!NILP (tem)) continue;            if (!NILP (tem)) continue;
3273          }          }
3274    
3275        /* Set CHARACTER to the character this entry describes, if any.        character = make_number (starting_i);
          Also update *INDICES.  */  
       if (CHAR_TABLE_P (vector))  
         {  
           indices[char_table_depth] = i;  
   
           if (char_table_depth == 0)  
             {  
               character = i;  
               indices[0] = i - 128;  
             }  
           else if (complete_char)  
             {  
               character = MAKE_CHAR (indices[0], indices[1], indices[2]);  
             }  
           else  
             character = 0;  
         }  
       else  
         character = i;  
3276    
3277        /* If this binding is shadowed by some other map, ignore it.  */        /* If this binding is shadowed by some other map, ignore it.  */
3278        if (!NILP (shadow) && complete_char)        if (!NILP (shadow))
3279          {          {
3280            Lisp_Object tem;            Lisp_Object tem;
3281    
3282            ASET (kludge, 0, make_number (character));            ASET (kludge, 0, character);
3283            tem = shadow_lookup (shadow, kludge, Qt);            tem = shadow_lookup (shadow, kludge, Qt);
3284    
3285            if (!NILP (tem)) continue;            if (!NILP (tem)) continue;
# Line 3397  describe_vector (vector, elt_prefix, arg Line 3287  describe_vector (vector, elt_prefix, arg
3287    
3288        /* Ignore this definition if it is shadowed by an earlier        /* Ignore this definition if it is shadowed by an earlier
3289           one in the same keymap.  */           one in the same keymap.  */
3290        if (!NILP (entire_map) && complete_char)        if (!NILP (entire_map))
3291          {          {
3292            Lisp_Object tem;            Lisp_Object tem;
3293    
3294            ASET (kludge, 0, make_number (character));            ASET (kludge, 0, character);
3295            tem = Flookup_key (entire_map, kludge, Qt);            tem = Flookup_key (entire_map, kludge, Qt);
3296    
3297            if (!EQ (tem, definition))            if (!EQ (tem, definition))
# Line 3410  describe_vector (vector, elt_prefix, arg Line 3300  describe_vector (vector, elt_prefix, arg
3300    
3301        if (first)        if (first)
3302          {          {
3303            if (char_table_depth == 0)            insert ("\n", 1);
             insert ("\n", 1);  
3304            first = 0;            first = 0;
3305          }          }
3306    
       /* For a sub char-table, show the depth by indentation.  
          CHAR_TABLE_DEPTH can be greater than 0 only for a char-table.  */  
       if (char_table_depth > 0)  
         insert ("    ", char_table_depth * 2); /* depth is 1 or 2.  */  
   
3307        /* Output the prefix that applies to every entry in this map.  */        /* Output the prefix that applies to every entry in this map.  */
3308        if (!NILP (elt_prefix))        if (!NILP (elt_prefix))
3309          insert1 (elt_prefix);          insert1 (elt_prefix);
3310    
3311        /* Insert or describe the character this slot is for,        insert1 (Fsingle_key_description (character, Qnil));
          or a description of what it is for.  */  
       if (SUB_CHAR_TABLE_P (vector))  
         {  
           if (complete_char)  
             insert_char (character);  
           else  
             {  
               /* We need an octal representation for this block of  
                  characters.  */  
               char work[16];  
               sprintf (work, "(row %d)", i);  
               insert (work, strlen (work));  
             }  
         }  
       else if (CHAR_TABLE_P (vector))  
         {  
           if (complete_char)  
             insert1 (Fsingle_key_description (make_number (character), Qnil));  
           else  
             {  
               /* Print the information for this character set.  */  
               insert_string ("<");  
               tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX);  
               if (STRINGP (tem2))  
                 insert_from_string (tem2, 0, 0, SCHARS (tem2),  
                                     SBYTES (tem2), 0);  
               else  
                 insert ("?", 1);  
               insert (">", 1);  
             }  
         }  
       else  
         {  
           insert1 (Fsingle_key_description (make_number (character), Qnil));  
         }  
   
       /* If we find a sub char-table within a char-table,  
          scan it recursively; it defines the details for  
          a character set or a portion of a character set.  */  
       if (CHAR_TABLE_P (vector) && SUB_CHAR_TABLE_P (definition))  
         {  
           insert ("\n", 1);  
           describe_vector (definition, elt_prefix, args, elt_describer,  
                            partial, shadow, entire_map,  
                            indices, char_table_depth + 1);  
           continue;  
         }  
   
       starting_i = i;  
3312    
3313        /* Find all consecutive characters or rows that have the same        /* Find all consecutive characters or rows that have the same
3314           definition.  But, for elements of a top level char table, if           definition.  But, for elements of a top level char table, if
3315           they are for charsets, we had better describe one by one even           they are for charsets, we had better describe one by one even
3316           if they have the same definition.  */           if they have the same definition.  */
3317        if (CHAR_TABLE_P (vector))        if (CHAR_TABLE_P (vector))
3318          {          while (i + 1 < to
3319            int limit = to;                 && (val = char_table_ref_and_range (vector, i + 1,
3320                                                       &range_beg, &range_end),
3321            if (char_table_depth == 0)                     tem2 = get_keyelt (val, 0),
3322              limit = CHAR_TABLE_SINGLE_BYTE_SLOTS;                     !NILP (tem2))
3323                   && !NILP (Fequal (tem2, definition)))
3324            while (i + 1 < limit            i = range_end;
                  && (tem2 = get_keyelt (XCHAR_TABLE (vector)->contents[i + 1], 0),  
                      !NILP (tem2))  
                  && !NILP (Fequal (tem2, definition)))  
             i++;  
         }  
3325        else        else
3326          while (i + 1 < to          while (i + 1 < to
3327                 && (tem2 = get_keyelt (AREF (vector, i + 1), 0),                 && (tem2 = get_keyelt (AREF (vector, i + 1), 0),
# Line 3499  describe_vector (vector, elt_prefix, arg Line 3329  describe_vector (vector, elt_prefix, arg
3329                 && !NILP (Fequal (tem2, definition)))                 && !NILP (Fequal (tem2, definition)))
3330            i++;            i++;
3331    
   
3332        /* If we have a range of more than one character,        /* If we have a range of more than one character,
3333           print where the range reaches to.  */           print where the range reaches to.  */
3334    
# Line 3510  describe_vector (vector, elt_prefix, arg Line 3339  describe_vector (vector, elt_prefix, arg
3339            if (!NILP (elt_prefix))            if (!NILP (elt_prefix))
3340              insert1 (elt_prefix);              insert1 (elt_prefix);
3341    
3342            if (CHAR_TABLE_P (vector))            insert1 (Fsingle_key_description (make_number (i), Qnil));
             {  
               if (char_table_depth == 0)  
                 {  
                   insert1 (Fsingle_key_description (make_number (i), Qnil));  
                 }  
               else if (complete_char)  
                 {  
                   indices[char_table_depth] = i;  
                   character = MAKE_CHAR (indices[0], indices[1], indices[2]);  
                   insert_char (character);  
                 }  
               else  
                 {  
                   /* We need an octal representation for this block of  
                      characters.  */  
                   char work[16];  
                   sprintf (work, "(row %d)", i);  
                   insert (work, strlen (work));  
                 }  
             }  
           else  
             {  
               insert1 (Fsingle_key_description (make_number (i), Qnil));  
             }  
3343          }          }
3344    
3345        /* Print a description of the definition of this character.        /* Print a description of the definition of this character.
# Line 3543  describe_vector (vector, elt_prefix, arg Line 3348  describe_vector (vector, elt_prefix, arg
3348        (*elt_describer) (definition, args);        (*elt_describer) (definition, args);
3349      }      }
3350    
   /* For (sub) char-table, print `defalt' slot at last.  */  
   if (CHAR_TABLE_P (vector) && !NILP (XCHAR_TABLE (vector)->defalt))  
     {  
       insert ("    ", char_table_depth * 2);  
       insert_string ("<<default>>");  
       (*elt_describer) (XCHAR_TABLE (vector)->defalt, args);  
     }  
   
3351    UNGCPRO;    UNGCPRO;
3352  }  }
3353    

Legend:
Removed from v.1.282  
changed lines
  Added in v.1.282.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26