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

Diff of /emacs/src/keyboard.c

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

revision 1.656 by pj, Sat Feb 16 09:51:31 2002 UTC revision 1.657 by kfstorm, Wed Feb 20 14:51:46 2002 UTC
# Line 6496  menu_bar_items (old) Line 6496  menu_bar_items (old)
6496        }        }
6497      else      else
6498        {        {
6499          /* No, so use major and minor mode keymaps and keymap property.  */          /* No, so use major and minor mode keymaps.
6500          int extra_maps = 2;             Don't include local-map or keymap properties, as menu-bar
6501          Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap);             bindings are not supported in those maps (that would require
6502          if (!NILP (map))             checking for menu-bar updates after every command).  */
           extra_maps = 3;  
6503          nmaps = current_minor_maps (NULL, &tmaps);          nmaps = current_minor_maps (NULL, &tmaps);
6504          maps = (Lisp_Object *) alloca ((nmaps + extra_maps)          maps = (Lisp_Object *) alloca ((nmaps + 2) * sizeof (maps[0]));
                                        * sizeof (maps[0]));  
6505          bcopy (tmaps, maps, nmaps * sizeof (maps[0]));          bcopy (tmaps, maps, nmaps * sizeof (maps[0]));
6506          if (!NILP (map))          maps[nmaps++] = current_buffer->keymap;
           maps[nmaps++] = map;  
         maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);  
6507        }        }
6508      maps[nmaps++] = current_global_map;      maps[nmaps++] = current_global_map;
6509    }    }
# Line 7148  tool_bar_items (reuse, nitems) Line 7144  tool_bar_items (reuse, nitems)
7144      }      }
7145    else    else
7146      {      {
7147        /* No, so use major and minor mode keymaps and keymap property.  */        /* No, so use major and minor mode keymaps.
7148        int extra_maps = 2;           Don't include local-map or keymap properties, as tool-bar
7149        Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap);           bindings are not supported in those maps (that would require
7150        if (!NILP (map))           checking for tool-bar updates after every command).  */
         extra_maps = 3;  
7151        nmaps = current_minor_maps (NULL, &tmaps);        nmaps = current_minor_maps (NULL, &tmaps);
7152        maps = (Lisp_Object *) alloca ((nmaps + extra_maps)        maps = (Lisp_Object *) alloca ((nmaps + 2) * sizeof (maps[0]));
                                      * sizeof (maps[0]));  
7153        bcopy (tmaps, maps, nmaps * sizeof (maps[0]));        bcopy (tmaps, maps, nmaps * sizeof (maps[0]));
7154        if (!NILP (map))        maps[nmaps++] = current_buffer->keymap;
         maps[nmaps++] = map;  
       maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);  
7155      }      }
7156    
7157    /* Add global keymap at the end.  */    /* Add global keymap at the end.  */
# Line 9479  DEFUN ("execute-extended-command", Fexec Line 9471  DEFUN ("execute-extended-command", Fexec
9471    RETURN_UNGCPRO (value);    RETURN_UNGCPRO (value);
9472  }  }
9473    
 /* Find the set of keymaps now active.  
    Store into *MAPS_P a vector holding the various maps  
    and return the number of them.  The vector was malloc'd  
    and the caller should free it.  */  
   
 int  
 current_active_maps (maps_p)  
      Lisp_Object **maps_p;  
 {  
   Lisp_Object *tmaps, *maps;  
   int nmaps;  
   
   /* Should overriding-terminal-local-map and overriding-local-map apply?  */  
   if (!NILP (Voverriding_local_map_menu_flag))  
     {  
       /* Yes, use them (if non-nil) as well as the global map.  */  
       maps = (Lisp_Object *) xmalloc (3 * sizeof (maps[0]));  
       nmaps = 0;  
       if (!NILP (current_kboard->Voverriding_terminal_local_map))  
         maps[nmaps++] = current_kboard->Voverriding_terminal_local_map;  
       if (!NILP (Voverriding_local_map))  
         maps[nmaps++] = Voverriding_local_map;  
     }  
   else  
     {  
       /* No, so use major and minor mode keymaps and keymap property.  */  
       int extra_maps = 2;  
       Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap);  
       if (!NILP (map))  
         extra_maps = 3;  
       nmaps = current_minor_maps (NULL, &tmaps);  
       maps = (Lisp_Object *) alloca ((nmaps + extra_maps)  
                                       * sizeof (maps[0]));  
       bcopy (tmaps, maps, nmaps * sizeof (maps[0]));  
       if (!NILP (map))  
         maps[nmaps++] = map;  
       maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);  
     }  
   maps[nmaps++] = current_global_map;  
   
   *maps_p = maps;  
   return nmaps;  
 }  
9474    
9475  /* Return nonzero if input events are pending.  */  /* Return nonzero if input events are pending.  */
9476    

Legend:
Removed from v.1.656  
changed lines
  Added in v.1.657

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