diff options
| author | Kim F. Storm | 2002-02-20 14:52:54 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-02-20 14:52:54 +0000 |
| commit | 9de461813d6b15d03b3e0b00e50815a7f44453af (patch) | |
| tree | 965383deb34583091b468e6cdb6566c0756784f4 /src | |
| parent | c7f07c4c3524e3d03fda9272d106a525c6a361f8 (diff) | |
| download | emacs-9de461813d6b15d03b3e0b00e50815a7f44453af.tar.gz emacs-9de461813d6b15d03b3e0b00e50815a7f44453af.zip | |
(menu_bar_items): Don't include keymap or local-map
bindings at PT when building menu (the menu is not updated often
enough for this to work reliable).
(tool_bar_items): Likewise.
(current_active_maps): Removed unused (and faulty) function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/keyboard.c | 75 |
2 files changed, 20 insertions, 63 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0c900eacff8..c3ba2dedef7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2002-02-20 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * keyboard.c (menu_bar_items): Don't include keymap or local-map | ||
| 4 | bindings at PT when building menu (the menu is not updated often | ||
| 5 | enough for this to work reliable). | ||
| 6 | (tool_bar_items): Likewise. | ||
| 7 | (current_active_maps): Removed unused (and buggy) function. | ||
| 8 | |||
| 1 | 2002-02-20 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 9 | 2002-02-20 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 2 | 10 | ||
| 3 | * xfns.c (gif_load): Use correct width and height for GIF images. | 11 | * xfns.c (gif_load): Use correct width and height for GIF images. |
diff --git a/src/keyboard.c b/src/keyboard.c index d2ef250c965..1ea807618d2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6496,18 +6496,14 @@ menu_bar_items (old) | |||
| 6496 | } | 6496 | } |
| 6497 | else | 6497 | else |
| 6498 | { | 6498 | { |
| 6499 | /* No, so use major and minor mode keymaps and keymap property. */ | 6499 | /* No, so use major and minor mode keymaps. |
| 6500 | int extra_maps = 2; | 6500 | Don't include local-map or keymap properties, as menu-bar |
| 6501 | Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap); | 6501 | bindings are not supported in those maps (that would require |
| 6502 | if (!NILP (map)) | 6502 | checking for menu-bar updates after every command). */ |
| 6503 | extra_maps = 3; | ||
| 6504 | nmaps = current_minor_maps (NULL, &tmaps); | 6503 | nmaps = current_minor_maps (NULL, &tmaps); |
| 6505 | maps = (Lisp_Object *) alloca ((nmaps + extra_maps) | 6504 | maps = (Lisp_Object *) alloca ((nmaps + 2) * sizeof (maps[0])); |
| 6506 | * sizeof (maps[0])); | ||
| 6507 | bcopy (tmaps, maps, nmaps * sizeof (maps[0])); | 6505 | bcopy (tmaps, maps, nmaps * sizeof (maps[0])); |
| 6508 | if (!NILP (map)) | 6506 | maps[nmaps++] = current_buffer->keymap; |
| 6509 | maps[nmaps++] = map; | ||
| 6510 | maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); | ||
| 6511 | } | 6507 | } |
| 6512 | maps[nmaps++] = current_global_map; | 6508 | maps[nmaps++] = current_global_map; |
| 6513 | } | 6509 | } |
| @@ -7148,18 +7144,14 @@ tool_bar_items (reuse, nitems) | |||
| 7148 | } | 7144 | } |
| 7149 | else | 7145 | else |
| 7150 | { | 7146 | { |
| 7151 | /* No, so use major and minor mode keymaps and keymap property. */ | 7147 | /* No, so use major and minor mode keymaps. |
| 7152 | int extra_maps = 2; | 7148 | Don't include local-map or keymap properties, as tool-bar |
| 7153 | Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap); | 7149 | bindings are not supported in those maps (that would require |
| 7154 | if (!NILP (map)) | 7150 | checking for tool-bar updates after every command). */ |
| 7155 | extra_maps = 3; | ||
| 7156 | nmaps = current_minor_maps (NULL, &tmaps); | 7151 | nmaps = current_minor_maps (NULL, &tmaps); |
| 7157 | maps = (Lisp_Object *) alloca ((nmaps + extra_maps) | 7152 | maps = (Lisp_Object *) alloca ((nmaps + 2) * sizeof (maps[0])); |
| 7158 | * sizeof (maps[0])); | ||
| 7159 | bcopy (tmaps, maps, nmaps * sizeof (maps[0])); | 7153 | bcopy (tmaps, maps, nmaps * sizeof (maps[0])); |
| 7160 | if (!NILP (map)) | 7154 | maps[nmaps++] = current_buffer->keymap; |
| 7161 | maps[nmaps++] = map; | ||
| 7162 | maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); | ||
| 7163 | } | 7155 | } |
| 7164 | 7156 | ||
| 7165 | /* Add global keymap at the end. */ | 7157 | /* Add global keymap at the end. */ |
| @@ -9479,49 +9471,6 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 9479 | RETURN_UNGCPRO (value); | 9471 | RETURN_UNGCPRO (value); |
| 9480 | } | 9472 | } |
| 9481 | 9473 | ||
| 9482 | /* Find the set of keymaps now active. | ||
| 9483 | Store into *MAPS_P a vector holding the various maps | ||
| 9484 | and return the number of them. The vector was malloc'd | ||
| 9485 | and the caller should free it. */ | ||
| 9486 | |||
| 9487 | int | ||
| 9488 | current_active_maps (maps_p) | ||
| 9489 | Lisp_Object **maps_p; | ||
| 9490 | { | ||
| 9491 | Lisp_Object *tmaps, *maps; | ||
| 9492 | int nmaps; | ||
| 9493 | |||
| 9494 | /* Should overriding-terminal-local-map and overriding-local-map apply? */ | ||
| 9495 | if (!NILP (Voverriding_local_map_menu_flag)) | ||
| 9496 | { | ||
| 9497 | /* Yes, use them (if non-nil) as well as the global map. */ | ||
| 9498 | maps = (Lisp_Object *) xmalloc (3 * sizeof (maps[0])); | ||
| 9499 | nmaps = 0; | ||
| 9500 | if (!NILP (current_kboard->Voverriding_terminal_local_map)) | ||
| 9501 | maps[nmaps++] = current_kboard->Voverriding_terminal_local_map; | ||
| 9502 | if (!NILP (Voverriding_local_map)) | ||
| 9503 | maps[nmaps++] = Voverriding_local_map; | ||
| 9504 | } | ||
| 9505 | else | ||
| 9506 | { | ||
| 9507 | /* No, so use major and minor mode keymaps and keymap property. */ | ||
| 9508 | int extra_maps = 2; | ||
| 9509 | Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap); | ||
| 9510 | if (!NILP (map)) | ||
| 9511 | extra_maps = 3; | ||
| 9512 | nmaps = current_minor_maps (NULL, &tmaps); | ||
| 9513 | maps = (Lisp_Object *) alloca ((nmaps + extra_maps) | ||
| 9514 | * sizeof (maps[0])); | ||
| 9515 | bcopy (tmaps, maps, nmaps * sizeof (maps[0])); | ||
| 9516 | if (!NILP (map)) | ||
| 9517 | maps[nmaps++] = map; | ||
| 9518 | maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); | ||
| 9519 | } | ||
| 9520 | maps[nmaps++] = current_global_map; | ||
| 9521 | |||
| 9522 | *maps_p = maps; | ||
| 9523 | return nmaps; | ||
| 9524 | } | ||
| 9525 | 9474 | ||
| 9526 | /* Return nonzero if input events are pending. */ | 9475 | /* Return nonzero if input events are pending. */ |
| 9527 | 9476 | ||