diff options
| author | Richard M. Stallman | 2006-09-08 12:17:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-09-08 12:17:32 +0000 |
| commit | 8aa769f1b6c2ec23940f717e9c1f4c1fd7e999f6 (patch) | |
| tree | 7866cf0442526b9196445767517bc88b4b503adf /src | |
| parent | 9e69bfa484748b259060fed2ac8426b849e49769 (diff) | |
| download | emacs-8aa769f1b6c2ec23940f717e9c1f4c1fd7e999f6.tar.gz emacs-8aa769f1b6c2ec23940f717e9c1f4c1fd7e999f6.zip | |
(Vmenu_updating_frame): Define here.
(syms_of_xdisp): DEFVAR it here.
(update_menu_bar): Always return hooks_run.
Set Vmenu_updating_frame.
(redisplay_internal): Test Vinhibit_redisplay
before calculating SELECTED_FRAME.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 4e47f4957d2..16dbc533557 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -615,6 +615,11 @@ int message_buf_print; | |||
| 615 | Lisp_Object Qinhibit_menubar_update; | 615 | Lisp_Object Qinhibit_menubar_update; |
| 616 | int inhibit_menubar_update; | 616 | int inhibit_menubar_update; |
| 617 | 617 | ||
| 618 | /* When evaluating expressions from menu bar items (enable conditions, | ||
| 619 | for instance), this is the frame they are being processed for. */ | ||
| 620 | |||
| 621 | Lisp_Object Vmenu_updating_frame; | ||
| 622 | |||
| 618 | /* Maximum height for resizing mini-windows. Either a float | 623 | /* Maximum height for resizing mini-windows. Either a float |
| 619 | specifying a fraction of the available height, or an integer | 624 | specifying a fraction of the available height, or an integer |
| 620 | specifying a number of lines. */ | 625 | specifying a number of lines. */ |
| @@ -9143,7 +9148,7 @@ update_menu_bar (f, save_match_data, hooks_run) | |||
| 9143 | happen when, for instance, an activate-menubar-hook causes a | 9148 | happen when, for instance, an activate-menubar-hook causes a |
| 9144 | redisplay. */ | 9149 | redisplay. */ |
| 9145 | if (inhibit_menubar_update) | 9150 | if (inhibit_menubar_update) |
| 9146 | return; | 9151 | return hooks_run; |
| 9147 | 9152 | ||
| 9148 | window = FRAME_SELECTED_WINDOW (f); | 9153 | window = FRAME_SELECTED_WINDOW (f); |
| 9149 | w = XWINDOW (window); | 9154 | w = XWINDOW (window); |
| @@ -9214,6 +9219,7 @@ update_menu_bar (f, save_match_data, hooks_run) | |||
| 9214 | hooks_run = 1; | 9219 | hooks_run = 1; |
| 9215 | } | 9220 | } |
| 9216 | 9221 | ||
| 9222 | XSETFRAME (Vmenu_updating_frame, f); | ||
| 9217 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); | 9223 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); |
| 9218 | 9224 | ||
| 9219 | /* Redisplay the menu bar in case we changed it. */ | 9225 | /* Redisplay the menu bar in case we changed it. */ |
| @@ -10795,13 +10801,13 @@ redisplay_internal (preserve_echo_area) | |||
| 10795 | int preserve_echo_area; | 10801 | int preserve_echo_area; |
| 10796 | { | 10802 | { |
| 10797 | struct window *w = XWINDOW (selected_window); | 10803 | struct window *w = XWINDOW (selected_window); |
| 10798 | struct frame *f = XFRAME (w->frame); | 10804 | struct frame *f; |
| 10799 | int pause; | 10805 | int pause; |
| 10800 | int must_finish = 0; | 10806 | int must_finish = 0; |
| 10801 | struct text_pos tlbufpos, tlendpos; | 10807 | struct text_pos tlbufpos, tlendpos; |
| 10802 | int number_of_visible_frames; | 10808 | int number_of_visible_frames; |
| 10803 | int count; | 10809 | int count; |
| 10804 | struct frame *sf = SELECTED_FRAME (); | 10810 | struct frame *sf; |
| 10805 | int polling_stopped_here = 0; | 10811 | int polling_stopped_here = 0; |
| 10806 | 10812 | ||
| 10807 | /* Non-zero means redisplay has to consider all windows on all | 10813 | /* Non-zero means redisplay has to consider all windows on all |
| @@ -10814,8 +10820,16 @@ redisplay_internal (preserve_echo_area) | |||
| 10814 | initialized, or redisplay is explicitly turned off by setting | 10820 | initialized, or redisplay is explicitly turned off by setting |
| 10815 | Vinhibit_redisplay. */ | 10821 | Vinhibit_redisplay. */ |
| 10816 | if (noninteractive | 10822 | if (noninteractive |
| 10817 | || !NILP (Vinhibit_redisplay) | 10823 | || !NILP (Vinhibit_redisplay)) |
| 10818 | || !f->glyphs_initialized_p) | 10824 | return; |
| 10825 | |||
| 10826 | /* Don't examine these until after testing Vinhibit_redisplay. | ||
| 10827 | When Emacs is shutting down, perhaps because its connection to | ||
| 10828 | X has dropped, we should not look at them at all. */ | ||
| 10829 | f = XFRAME (w->frame); | ||
| 10830 | sf = SELECTED_FRAME (); | ||
| 10831 | |||
| 10832 | if (!f->glyphs_initialized_p) | ||
| 10819 | return; | 10833 | return; |
| 10820 | 10834 | ||
| 10821 | /* The flag redisplay_performed_directly_p is set by | 10835 | /* The flag redisplay_performed_directly_p is set by |
| @@ -24127,6 +24141,11 @@ This is used to update submenus such as Buffers, | |||
| 24127 | whose contents depend on various data. */); | 24141 | whose contents depend on various data. */); |
| 24128 | Vmenu_bar_update_hook = Qnil; | 24142 | Vmenu_bar_update_hook = Qnil; |
| 24129 | 24143 | ||
| 24144 | DEFVAR_LISP ("menu-updating-frame", &Vmenu_updating_frame, | ||
| 24145 | doc: /* Frame for which we are updating a menu. | ||
| 24146 | The enable predicate for a menu binding should check this variable. */); | ||
| 24147 | Vmenu_updating_frame = Qnil; | ||
| 24148 | |||
| 24130 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, | 24149 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, |
| 24131 | doc: /* Non-nil means don't update menu bars. Internal use only. */); | 24150 | doc: /* Non-nil means don't update menu bars. Internal use only. */); |
| 24132 | inhibit_menubar_update = 0; | 24151 | inhibit_menubar_update = 0; |