emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/keymap.c


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/src/keymap.c
Date: Tue, 15 Feb 2005 01:39:19 -0500

Index: emacs/src/keymap.c
diff -c emacs/src/keymap.c:1.301 emacs/src/keymap.c:1.302
*** emacs/src/keymap.c:1.301    Fri Jan 28 16:25:10 2005
--- emacs/src/keymap.c  Tue Feb 15 06:39:18 2005
***************
*** 120,129 ****
  static void describe_translation P_ ((Lisp_Object, Lisp_Object));
  static void describe_map P_ ((Lisp_Object, Lisp_Object,
                              void (*) P_ ((Lisp_Object, Lisp_Object)),
!                             int, Lisp_Object, Lisp_Object*, int));
  static void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
                                 void (*) (Lisp_Object, Lisp_Object), int,
!                                Lisp_Object, Lisp_Object, int *, int, int));
  static void silly_event_symbol_error P_ ((Lisp_Object));
  
  /* Keymap object support - constructors and predicates.                       
*/
--- 120,130 ----
  static void describe_translation P_ ((Lisp_Object, Lisp_Object));
  static void describe_map P_ ((Lisp_Object, Lisp_Object,
                              void (*) P_ ((Lisp_Object, Lisp_Object)),
!                             int, Lisp_Object, Lisp_Object*, int, int));
  static void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
                                 void (*) (Lisp_Object, Lisp_Object), int,
!                                Lisp_Object, Lisp_Object, int *,
!                                int, int, int));
  static void silly_event_symbol_error P_ ((Lisp_Object));
  
  /* Keymap object support - constructors and predicates.                       
*/
***************
*** 2834,2840 ****
  
    if (!NILP (Vkey_translation_map))
      describe_map_tree (Vkey_translation_map, 0, Qnil, prefix,
!                      "Key translations", nomenu, 1, 0);
  
  
    /* Print the (major mode) local map.  */
--- 2835,2841 ----
  
    if (!NILP (Vkey_translation_map))
      describe_map_tree (Vkey_translation_map, 0, Qnil, prefix,
!                      "Key translations", nomenu, 1, 0, 0);
  
  
    /* Print the (major mode) local map.  */
***************
*** 2847,2853 ****
    if (!NILP (start1))
      {
        describe_map_tree (start1, 1, shadow, prefix,
!                        "\f\nOverriding Bindings", nomenu, 0, 0);
        shadow = Fcons (start1, shadow);
      }
    else
--- 2848,2854 ----
    if (!NILP (start1))
      {
        describe_map_tree (start1, 1, shadow, prefix,
!                        "\f\nOverriding Bindings", nomenu, 0, 0, 0);
        shadow = Fcons (start1, shadow);
      }
    else
***************
*** 2868,2874 ****
        if (!NILP (start1))
        {
          describe_map_tree (start1, 1, shadow, prefix,
!                            "\f\n`keymap' Property Bindings", nomenu, 0, 0);
          shadow = Fcons (start1, shadow);
        }
  
--- 2869,2876 ----
        if (!NILP (start1))
        {
          describe_map_tree (start1, 1, shadow, prefix,
!                            "\f\n`keymap' Property Bindings", nomenu,
!                            0, 0, 0);
          shadow = Fcons (start1, shadow);
        }
  
***************
*** 2896,2902 ****
          p += sizeof (" Minor Mode Bindings") - 1;
          *p = 0;
  
!         describe_map_tree (maps[i], 1, shadow, prefix, title, nomenu, 0, 0);
          shadow = Fcons (maps[i], shadow);
        }
  
--- 2898,2905 ----
          p += sizeof (" Minor Mode Bindings") - 1;
          *p = 0;
  
!         describe_map_tree (maps[i], 1, shadow, prefix,
!                            title, nomenu, 0, 0, 0);
          shadow = Fcons (maps[i], shadow);
        }
  
***************
*** 2906,2928 ****
        {
          if (EQ (start1, XBUFFER (buffer)->keymap))
            describe_map_tree (start1, 1, shadow, prefix,
!                              "\f\nMajor Mode Bindings", nomenu, 0, 0);
          else
            describe_map_tree (start1, 1, shadow, prefix,
                               "\f\n`local-map' Property Bindings",
!                              nomenu, 0, 0);
  
          shadow = Fcons (start1, shadow);
        }
      }
  
    describe_map_tree (current_global_map, 1, shadow, prefix,
!                    "\f\nGlobal Bindings", nomenu, 0, 1);
  
    /* Print the function-key-map translations under this prefix.  */
    if (!NILP (Vfunction_key_map))
      describe_map_tree (Vfunction_key_map, 0, Qnil, prefix,
!                      "\f\nFunction key map translations", nomenu, 1, 0);
  
    UNGCPRO;
    return Qnil;
--- 2909,2931 ----
        {
          if (EQ (start1, XBUFFER (buffer)->keymap))
            describe_map_tree (start1, 1, shadow, prefix,
!                              "\f\nMajor Mode Bindings", nomenu, 0, 0, 0);
          else
            describe_map_tree (start1, 1, shadow, prefix,
                               "\f\n`local-map' Property Bindings",
!                              nomenu, 0, 0, 0);
  
          shadow = Fcons (start1, shadow);
        }
      }
  
    describe_map_tree (current_global_map, 1, shadow, prefix,
!                    "\f\nGlobal Bindings", nomenu, 0, 1, 0);
  
    /* Print the function-key-map translations under this prefix.  */
    if (!NILP (Vfunction_key_map))
      describe_map_tree (Vfunction_key_map, 0, Qnil, prefix,
!                      "\f\nFunction key map translations", nomenu, 1, 0, 0);
  
    UNGCPRO;
    return Qnil;
***************
*** 2943,2959 ****
     so print strings and vectors differently.
  
     If ALWAYS_TITLE is nonzero, print the title even if there are no maps
!    to look through.  */
  
  void
  describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl,
!                  always_title)
       Lisp_Object startmap, shadow, prefix;
       int partial;
       char *title;
       int nomenu;
       int transl;
       int always_title;
  {
    Lisp_Object maps, orig_maps, seen, sub_shadows;
    struct gcpro gcpro1, gcpro2, gcpro3;
--- 2946,2966 ----
     so print strings and vectors differently.
  
     If ALWAYS_TITLE is nonzero, print the title even if there are no maps
!    to look through.
! 
!    If MENTION_SHADOW is nonzero, then when something is shadowed by SHADOW,
!    don't omit it; instead, mention it but say it is shadowed.  */
  
  void
  describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl,
!                  always_title, mention_shadow)
       Lisp_Object startmap, shadow, prefix;
       int partial;
       char *title;
       int nomenu;
       int transl;
       int always_title;
+      int mention_shadow;
  {
    Lisp_Object maps, orig_maps, seen, sub_shadows;
    struct gcpro gcpro1, gcpro2, gcpro3;
***************
*** 3055,3061 ****
  
        describe_map (Fcdr (elt), prefix,
                    transl ? describe_translation : describe_command,
!                   partial, sub_shadows, &seen, nomenu);
  
      skip: ;
      }
--- 3062,3068 ----
  
        describe_map (Fcdr (elt), prefix,
                    transl ? describe_translation : describe_command,
!                   partial, sub_shadows, &seen, nomenu, mention_shadow);
  
      skip: ;
      }
***************
*** 3135,3141 ****
     PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above.  */
  
  static void
! describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu)
       register Lisp_Object map;
       Lisp_Object prefix;
       void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
--- 3142,3149 ----
     PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above.  */
  
  static void
! describe_map (map, prefix, elt_describer, partial, shadow,
!             seen, nomenu, mention_shadow)
       register Lisp_Object map;
       Lisp_Object prefix;
       void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
***************
*** 3143,3148 ****
--- 3151,3157 ----
       Lisp_Object shadow;
       Lisp_Object *seen;
       int nomenu;
+      int mention_shadow;
  {
    Lisp_Object tail, definition, event;
    Lisp_Object tem;
***************
*** 3172,3180 ****
          || CHAR_TABLE_P (XCAR (tail)))
        describe_vector (XCAR (tail),
                         prefix, Qnil, elt_describer, partial, shadow, map,
!                        (int *)0, 0, 1);
        else if (CONSP (XCAR (tail)))
        {
          event = XCAR (XCAR (tail));
  
          /* Ignore bindings whose "prefix" are not really valid events.
--- 3181,3190 ----
          || CHAR_TABLE_P (XCAR (tail)))
        describe_vector (XCAR (tail),
                         prefix, Qnil, elt_describer, partial, shadow, map,
!                        (int *)0, 0, 1, mention_shadow);
        else if (CONSP (XCAR (tail)))
        {
+         int this_shadowed = 0;
          event = XCAR (XCAR (tail));
  
          /* Ignore bindings whose "prefix" are not really valid events.
***************
*** 3203,3209 ****
          if (!NILP (shadow))
            {
              tem = shadow_lookup (shadow, kludge, Qt);
!             if (!NILP (tem)) continue;
            }
  
          tem = Flookup_key (map, kludge, Qt);
--- 3213,3225 ----
          if (!NILP (shadow))
            {
              tem = shadow_lookup (shadow, kludge, Qt);
!             if (!NILP (tem))
!               {
!                 if (mention_shadow)
!                   this_shadowed = 1;
!                 else
!                   continue;
!               }
            }
  
          tem = Flookup_key (map, kludge, Qt);
***************
*** 3223,3228 ****
--- 3239,3251 ----
             elt_describer will take care of spacing out far enough
             for alignment purposes.  */
          (*elt_describer) (definition, Qnil);
+ 
+         if (this_shadowed)
+           {
+             SET_PT (PT - 1);
+             insert_string ("  (binding currently shadowed)");
+             SET_PT (PT + 1);
+           }
        }
        else if (EQ (XCAR (tail), Qkeymap))
        {
***************
*** 3261,3267 ****
    specbind (Qstandard_output, Fcurrent_buffer ());
    CHECK_VECTOR_OR_CHAR_TABLE (vector);
    describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
!                  Qnil, Qnil, (int *)0, 0, 0);
  
    return unbind_to (count, Qnil);
  }
--- 3284,3290 ----
    specbind (Qstandard_output, Fcurrent_buffer ());
    CHECK_VECTOR_OR_CHAR_TABLE (vector);
    describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
!                  Qnil, Qnil, (int *)0, 0, 0, 0);
  
    return unbind_to (count, Qnil);
  }
***************
*** 3303,3309 ****
  static void
  describe_vector (vector, prefix, args, elt_describer,
                 partial, shadow, entire_map,
!                indices, char_table_depth, keymap_p)
       register Lisp_Object vector;
       Lisp_Object prefix, args;
       void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
--- 3326,3333 ----
  static void
  describe_vector (vector, prefix, args, elt_describer,
                 partial, shadow, entire_map,
!                indices, char_table_depth, keymap_p,
!                mention_shadow)
       register Lisp_Object vector;
       Lisp_Object prefix, args;
       void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
***************
*** 3313,3318 ****
--- 3337,3343 ----
       int *indices;
       int char_table_depth;
       int keymap_p;
+      int mention_shadow;
  {
    Lisp_Object definition;
    Lisp_Object tem2;
***************
*** 3396,3401 ****
--- 3421,3427 ----
  
    for (i = from; i < to; i++)
      {
+       int this_shadowed = 0;
        QUIT;
  
        if (CHAR_TABLE_P (vector))
***************
*** 3455,3461 ****
  
          tem = shadow_lookup (shadow, kludge, Qt);
  
!         if (!NILP (tem)) continue;
        }
  
        /* Ignore this definition if it is shadowed by an earlier
--- 3481,3493 ----
  
          tem = shadow_lookup (shadow, kludge, Qt);
  
!         if (!NILP (tem))
!           {
!             if (mention_shadow)
!               this_shadowed = 1;
!             else
!               continue;
!           }
        }
  
        /* Ignore this definition if it is shadowed by an earlier
***************
*** 3531,3537 ****
          insert ("\n", 1);
          describe_vector (definition, prefix, args, elt_describer,
                           partial, shadow, entire_map,
!                          indices, char_table_depth + 1, keymap_p);
          continue;
        }
  
--- 3563,3570 ----
          insert ("\n", 1);
          describe_vector (definition, prefix, args, elt_describer,
                           partial, shadow, entire_map,
!                          indices, char_table_depth + 1, keymap_p,
!                          mention_shadow);
          continue;
        }
  
***************
*** 3605,3610 ****
--- 3638,3650 ----
         elt_describer will take care of spacing out far enough
         for alignment purposes.  */
        (*elt_describer) (definition, args);
+ 
+       if (this_shadowed)
+       {
+         SET_PT (PT - 1);
+         insert_string ("  (binding currently shadowed)");
+         SET_PT (PT + 1);
+       }
      }
  
    /* For (sub) char-table, print `defalt' slot at last.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]