/[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.246 by pj, Tue Nov 13 07:48:37 2001 UTC revision 1.247 by monnier, Mon Nov 19 22:46:37 2001 UTC
# Line 55  Lisp_Object Vminibuffer_local_map; Line 55  Lisp_Object Vminibuffer_local_map;
55                                     minibuf */                                     minibuf */
56    
57  /* was MinibufLocalNSMap */  /* was MinibufLocalNSMap */
58  Lisp_Object Vminibuffer_local_ns_map;                    Lisp_Object Vminibuffer_local_ns_map;
59                                  /* The keymap used by the minibuf for local                                  /* The keymap used by the minibuf for local
60                                     bindings when spaces are not encouraged                                     bindings when spaces are not encouraged
61                                     in the minibuf */                                     in the minibuf */
# Line 107  static Lisp_Object store_in_keymap P_ (( Line 107  static Lisp_Object store_in_keymap P_ ((
107  static void fix_submap_inheritance P_ ((Lisp_Object, Lisp_Object, Lisp_Object));  static void fix_submap_inheritance P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
108    
109  static Lisp_Object define_as_prefix P_ ((Lisp_Object, Lisp_Object));  static Lisp_Object define_as_prefix P_ ((Lisp_Object, Lisp_Object));
110  static void describe_command P_ ((Lisp_Object));  static void describe_command P_ ((Lisp_Object, Lisp_Object));
111  static void describe_translation P_ ((Lisp_Object));  static void describe_translation P_ ((Lisp_Object, Lisp_Object));
112  static void describe_map P_ ((Lisp_Object, Lisp_Object,  static void describe_map P_ ((Lisp_Object, Lisp_Object,
113                                void (*) P_ ((Lisp_Object)),                                void (*) P_ ((Lisp_Object, Lisp_Object)),
114                                int, Lisp_Object, Lisp_Object*, int));                                int, Lisp_Object, Lisp_Object*, int));
115    
116  /* Keymap object support - constructors and predicates.                 */  /* Keymap object support - constructors and predicates.                 */
# Line 1932  push_key_description (c, p, force_multib Line 1932  push_key_description (c, p, force_multib
1932          p += CHAR_STRING (c, p);          p += CHAR_STRING (c, p);
1933      }      }
1934    
1935    return p;      return p;
1936  }  }
1937    
1938  /* This function cannot GC.  */  /* This function cannot GC.  */
# Line 2033  push_text_char_description (c, p) Line 2033  push_text_char_description (c, p)
2033      }      }
2034    else    else
2035      *p++ = c;      *p++ = c;
2036    return p;      return p;
2037  }  }
2038    
2039  /* This function cannot GC.  */  /* This function cannot GC.  */
# Line 2751  key             binding\n\ Line 2751  key             binding\n\
2751  static int previous_description_column;  static int previous_description_column;
2752    
2753  static void  static void
2754  describe_command (definition)  describe_command (definition, args)
2755       Lisp_Object definition;       Lisp_Object definition, args;
2756  {  {
2757    register Lisp_Object tem1;    register Lisp_Object tem1;
2758    int column = current_column ();    int column = current_column ();
# Line 2788  describe_command (definition) Line 2788  describe_command (definition)
2788  }  }
2789    
2790  static void  static void
2791  describe_translation (definition)  describe_translation (definition, args)
2792       Lisp_Object definition;       Lisp_Object definition, args;
2793  {  {
2794    register Lisp_Object tem1;    register Lisp_Object tem1;
2795    
# Line 2820  static void Line 2820  static void
2820  describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu)  describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu)
2821       register Lisp_Object map;       register Lisp_Object map;
2822       Lisp_Object keys;       Lisp_Object keys;
2823       void (*elt_describer) P_ ((Lisp_Object));       void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
2824       int partial;       int partial;
2825       Lisp_Object shadow;       Lisp_Object shadow;
2826       Lisp_Object *seen;       Lisp_Object *seen;
# Line 2863  describe_map (map, keys, elt_describer, Line 2863  describe_map (map, keys, elt_describer,
2863        if (VECTORP (XCAR (tail))        if (VECTORP (XCAR (tail))
2864            || CHAR_TABLE_P (XCAR (tail)))            || CHAR_TABLE_P (XCAR (tail)))
2865          describe_vector (XCAR (tail),          describe_vector (XCAR (tail),
2866                           elt_prefix, elt_describer, partial, shadow, map,                           elt_prefix, Qnil, elt_describer, partial, shadow, map,
2867                           (int *)0, 0);                           (int *)0, 0);
2868        else if (CONSP (XCAR (tail)))        else if (CONSP (XCAR (tail)))
2869          {          {
# Line 2917  describe_map (map, keys, elt_describer, Line 2917  describe_map (map, keys, elt_describer,
2917            /* Print a description of the definition of this character.            /* Print a description of the definition of this character.
2918               elt_describer will take care of spacing out far enough               elt_describer will take care of spacing out far enough
2919               for alignment purposes.  */               for alignment purposes.  */
2920            (*elt_describer) (definition);            (*elt_describer) (definition, Qnil);
2921          }          }
2922        else if (EQ (XCAR (tail), Qkeymap))        else if (EQ (XCAR (tail), Qkeymap))
2923          {          {
# Line 2935  describe_map (map, keys, elt_describer, Line 2935  describe_map (map, keys, elt_describer,
2935  }  }
2936    
2937  static void  static void
2938  describe_vector_princ (elt)  describe_vector_princ (elt, fun)
2939       Lisp_Object elt;       Lisp_Object elt, fun;
2940  {  {
2941    Findent_to (make_number (16), make_number (1));    Findent_to (make_number (16), make_number (1));
2942    Fprinc (elt, Qnil);    call1 (fun, elt);
2943    Fterpri (Qnil);    Fterpri (Qnil);
2944  }  }
2945    
2946  DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 1, 0,  DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0,
2947         doc: /* Insert a description of contents of VECTOR.         doc: /* Insert a description of contents of VECTOR.
2948  This is text showing the elements of vector matched against indices.  */)  This is text showing the elements of vector matched against indices.  */)
2949       (vector)       (vector, describer)
2950       Lisp_Object vector;       Lisp_Object vector, describer;
2951  {  {
2952    int count = specpdl_ptr - specpdl;    int count = specpdl_ptr - specpdl;
2953      if (NILP (describer))
2954        describer = intern ("princ");
2955    specbind (Qstandard_output, Fcurrent_buffer ());    specbind (Qstandard_output, Fcurrent_buffer ());
2956    CHECK_VECTOR_OR_CHAR_TABLE (vector);    CHECK_VECTOR_OR_CHAR_TABLE (vector);
2957    describe_vector (vector, Qnil, describe_vector_princ, 0,    describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
2958                     Qnil, Qnil, (int *)0, 0);                     Qnil, Qnil, (int *)0, 0);
2959    
2960    return unbind_to (count, Qnil);    return unbind_to (count, Qnil);
# Line 2987  This is text showing the elements of vec Line 2988  This is text showing the elements of vec
2988    
2989     When describing a sub-char-table, INDICES is a list of     When describing a sub-char-table, INDICES is a list of
2990     indices at higher levels in this char-table,     indices at higher levels in this char-table,
2991     and CHAR_TABLE_DEPTH says how many levels down we have gone.  */     and CHAR_TABLE_DEPTH says how many levels down we have gone.
2992    
2993       ARGS is simply passed as the second argument to ELT_DESCRIBER.  */
2994    
2995  void  void
2996  describe_vector (vector, elt_prefix, elt_describer,  describe_vector (vector, elt_prefix, args, elt_describer,
2997                   partial, shadow, entire_map,                   partial, shadow, entire_map,
2998                   indices, char_table_depth)                   indices, char_table_depth)
2999       register Lisp_Object vector;       register Lisp_Object vector;
3000       Lisp_Object elt_prefix;       Lisp_Object elt_prefix, args;
3001       void (*elt_describer) P_ ((Lisp_Object));       void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
3002       int partial;       int partial;
3003       Lisp_Object shadow;       Lisp_Object shadow;
3004       Lisp_Object entire_map;       Lisp_Object entire_map;
# Line 3088  describe_vector (vector, elt_prefix, elt Line 3091  describe_vector (vector, elt_prefix, elt
3091        else        else
3092          definition = get_keyelt (AREF (vector, i), 0);          definition = get_keyelt (AREF (vector, i), 0);
3093    
3094        if (NILP (definition)) continue;              if (NILP (definition)) continue;
3095    
3096        /* Don't mention suppressed commands.  */        /* Don't mention suppressed commands.  */
3097        if (SYMBOLP (definition) && partial)        if (SYMBOLP (definition) && partial)
# Line 3204  describe_vector (vector, elt_prefix, elt Line 3207  describe_vector (vector, elt_prefix, elt
3207        if (CHAR_TABLE_P (vector) && SUB_CHAR_TABLE_P (definition))        if (CHAR_TABLE_P (vector) && SUB_CHAR_TABLE_P (definition))
3208          {          {
3209            insert ("\n", 1);            insert ("\n", 1);
3210            describe_vector (definition, elt_prefix, elt_describer,            describe_vector (definition, elt_prefix, args, elt_describer,
3211                             partial, shadow, entire_map,                             partial, shadow, entire_map,
3212                             indices, char_table_depth + 1);                             indices, char_table_depth + 1);
3213            continue;            continue;
# Line 3277  describe_vector (vector, elt_prefix, elt Line 3280  describe_vector (vector, elt_prefix, elt
3280        /* Print a description of the definition of this character.        /* Print a description of the definition of this character.
3281           elt_describer will take care of spacing out far enough           elt_describer will take care of spacing out far enough
3282           for alignment purposes.  */           for alignment purposes.  */
3283        (*elt_describer) (definition);        (*elt_describer) (definition, args);
3284      }      }
3285    
3286    /* For (sub) char-table, print `defalt' slot at last.  */    /* For (sub) char-table, print `defalt' slot at last.  */
# Line 3285  describe_vector (vector, elt_prefix, elt Line 3288  describe_vector (vector, elt_prefix, elt
3288      {      {
3289        insert ("    ", char_table_depth * 2);        insert ("    ", char_table_depth * 2);
3290        insert_string ("<<default>>");        insert_string ("<<default>>");
3291        (*elt_describer) (XCHAR_TABLE (vector)->defalt);        (*elt_describer) (XCHAR_TABLE (vector)->defalt, args);
3292      }      }
3293    
3294    UNGCPRO;    UNGCPRO;

Legend:
Removed from v.1.246  
changed lines
  Added in v.1.247

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