comparison src/keyboard.c @ 44078:92101c2bc6bf

(menu_bar_items): Mostly undo 2002-02-20 patch, so menu-bar bindings in keymap and local-map properties _are_ used. But try keymap property first in accordance with 2002-01-03 patch. Added comment describing why this is not always reliable. (tool_bar_items): Ditto for tool-bar.
author Kim F. Storm <storm@cua.dk>
date Thu, 21 Mar 2002 21:32:50 +0000
parents 8090818ccd53
children 8f0053476105
comparison
equal deleted inserted replaced
44077:514cc212d612 44078:92101c2bc6bf
6508 if (!NILP (Voverriding_local_map)) 6508 if (!NILP (Voverriding_local_map))
6509 maps[nmaps++] = Voverriding_local_map; 6509 maps[nmaps++] = Voverriding_local_map;
6510 } 6510 }
6511 else 6511 else
6512 { 6512 {
6513 /* No, so use major and minor mode keymaps. 6513 /* No, so use major and minor mode keymaps and keymap property.
6514 Don't include local-map or keymap properties, as menu-bar 6514 Note that menu-bar bindings in the local-map and keymap
6515 bindings are not supported in those maps (that would require 6515 properties may not work reliable, as they are only
6516 checking for menu-bar updates after every command). */ 6516 recognized when the menu-bar (or mode-line) is updated,
6517 nmaps = current_minor_maps (NULL, &tmaps); 6517 which does not normally happen after every command. */
6518 maps = (Lisp_Object *) alloca ((nmaps + 2) * sizeof (maps[0])); 6518 Lisp_Object tem;
6519 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); 6519 int nminor;
6520 maps[nmaps++] = current_buffer->keymap; 6520 nminor = current_minor_maps (NULL, &tmaps);
6521 maps = (Lisp_Object *) alloca ((nminor + 3) * sizeof (maps[0]));
6522 nmaps = 0;
6523 if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem))
6524 maps[nmaps++] = tem;
6525 bcopy (tmaps, (void *) (maps + nmaps), nminor * sizeof (maps[0]));
6526 nmaps += nminor;
6527 maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);
6521 } 6528 }
6522 maps[nmaps++] = current_global_map; 6529 maps[nmaps++] = current_global_map;
6523 } 6530 }
6524 6531
6525 /* Look up in each map the dummy prefix key `menu-bar'. */ 6532 /* Look up in each map the dummy prefix key `menu-bar'. */
7156 if (!NILP (Voverriding_local_map)) 7163 if (!NILP (Voverriding_local_map))
7157 maps[nmaps++] = Voverriding_local_map; 7164 maps[nmaps++] = Voverriding_local_map;
7158 } 7165 }
7159 else 7166 else
7160 { 7167 {
7161 /* No, so use major and minor mode keymaps. 7168 /* No, so use major and minor mode keymaps and keymap property.
7162 Don't include local-map or keymap properties, as tool-bar 7169 Note that tool-bar bindings in the local-map and keymap
7163 bindings are not supported in those maps (that would require 7170 properties may not work reliable, as they are only
7164 checking for tool-bar updates after every command). */ 7171 recognized when the tool-bar (or mode-line) is updated,
7165 nmaps = current_minor_maps (NULL, &tmaps); 7172 which does not normally happen after every command. */
7166 maps = (Lisp_Object *) alloca ((nmaps + 2) * sizeof (maps[0])); 7173 Lisp_Object tem;
7167 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); 7174 int nminor;
7168 maps[nmaps++] = current_buffer->keymap; 7175 nminor = current_minor_maps (NULL, &tmaps);
7176 maps = (Lisp_Object *) alloca ((nminor + 3) * sizeof (maps[0]));
7177 nmaps = 0;
7178 if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem))
7179 maps[nmaps++] = tem;
7180 bcopy (tmaps, (void *) (maps + nmaps), nminor * sizeof (maps[0]));
7181 nmaps += nminor;
7182 maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);
7169 } 7183 }
7170 7184
7171 /* Add global keymap at the end. */ 7185 /* Add global keymap at the end. */
7172 maps[nmaps++] = current_global_map; 7186 maps[nmaps++] = current_global_map;
7173 7187