diff options
| author | Richard M. Stallman | 1994-10-19 09:00:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-19 09:00:37 +0000 |
| commit | d0a497168636bfd0928c990a7eddde3b489dfc66 (patch) | |
| tree | 0bb38e37de8c0548b8641c521f45a1e84952ffce /src | |
| parent | 5d7d1333aca83d841c8099722bdbe2333c787e8c (diff) | |
| download | emacs-d0a497168636bfd0928c990a7eddde3b489dfc66.tar.gz emacs-d0a497168636bfd0928c990a7eddde3b489dfc66.zip | |
(Voverriding_local_map_menu_flag): New variable.
(syms_of_keyboard): Set up Lisp var.
(menu_bar_items): Obey Voverriding_local_map_menu_flag.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index a8a983c3dae..f64f8d43808 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -172,6 +172,9 @@ extern int minibuf_level; | |||
| 172 | /* If non-nil, this is a map that overrides all other local maps. */ | 172 | /* If non-nil, this is a map that overrides all other local maps. */ |
| 173 | Lisp_Object Voverriding_local_map; | 173 | Lisp_Object Voverriding_local_map; |
| 174 | 174 | ||
| 175 | /* If non-nil, Voverriding_local_map applies to the menu bar. */ | ||
| 176 | Lisp_Object Voverriding_local_map_menu_flag; | ||
| 177 | |||
| 175 | /* Current depth in recursive edits. */ | 178 | /* Current depth in recursive edits. */ |
| 176 | int command_loop_level; | 179 | int command_loop_level; |
| 177 | 180 | ||
| @@ -3773,14 +3776,26 @@ menu_bar_items (old) | |||
| 3773 | { | 3776 | { |
| 3774 | Lisp_Object *tmaps; | 3777 | Lisp_Object *tmaps; |
| 3775 | 3778 | ||
| 3776 | if (!NILP (Voverriding_local_map)) | 3779 | /* Should overriding-local-map apply, here? */ |
| 3780 | if (!NILP (Voverriding_local_map_menu_flag)) | ||
| 3777 | { | 3781 | { |
| 3778 | nmaps = 2; | 3782 | if (NILP (Voverriding_local_map)) |
| 3779 | maps = (Lisp_Object *) alloca (nmaps * sizeof (maps[0])); | 3783 | { |
| 3780 | maps[0] = Voverriding_local_map; | 3784 | /* Yes, and it is nil. Use just global map. */ |
| 3785 | nmaps = 1; | ||
| 3786 | maps = (Lisp_Object *) alloca (nmaps * sizeof (maps[0])); | ||
| 3787 | } | ||
| 3788 | else | ||
| 3789 | { | ||
| 3790 | /* Yes, and it is non-nil. Use it and the global map. */ | ||
| 3791 | nmaps = 2; | ||
| 3792 | maps = (Lisp_Object *) alloca (nmaps * sizeof (maps[0])); | ||
| 3793 | maps[0] = Voverriding_local_map; | ||
| 3794 | } | ||
| 3781 | } | 3795 | } |
| 3782 | else | 3796 | else |
| 3783 | { | 3797 | { |
| 3798 | /* No, so use major and minor mode keymaps. */ | ||
| 3784 | nmaps = current_minor_maps (0, &tmaps) + 2; | 3799 | nmaps = current_minor_maps (0, &tmaps) + 2; |
| 3785 | maps = (Lisp_Object *) alloca (nmaps * sizeof (maps[0])); | 3800 | maps = (Lisp_Object *) alloca (nmaps * sizeof (maps[0])); |
| 3786 | bcopy (tmaps, maps, (nmaps - 2) * sizeof (maps[0])); | 3801 | bcopy (tmaps, maps, (nmaps - 2) * sizeof (maps[0])); |
| @@ -6278,6 +6293,12 @@ If this variable is non-nil, it is used as a keymap instead of the\n\ | |||
| 6278 | buffer's local map, and the minor mode keymaps and text property keymaps."); | 6293 | buffer's local map, and the minor mode keymaps and text property keymaps."); |
| 6279 | Voverriding_local_map = Qnil; | 6294 | Voverriding_local_map = Qnil; |
| 6280 | 6295 | ||
| 6296 | DEFVAR_LISP ("overriding-local-map-menu-flag", &Voverriding_local_map_menu_flag, | ||
| 6297 | "Non-nil means `overriding-local-map' applies to the menu bar.\n\ | ||
| 6298 | Otherwise, the menu bar continues to reflect the buffer's local map\n\ | ||
| 6299 | and the minor mode maps regardless of `overriding-local-map'."); | ||
| 6300 | Voverriding_local_map_menu_flag = Qnil; | ||
| 6301 | |||
| 6281 | DEFVAR_BOOL ("track-mouse", &do_mouse_tracking, | 6302 | DEFVAR_BOOL ("track-mouse", &do_mouse_tracking, |
| 6282 | "*Non-nil means generate motion events for mouse motion."); | 6303 | "*Non-nil means generate motion events for mouse motion."); |
| 6283 | 6304 | ||