diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-04-25 22:16:08 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-04-25 22:16:08 +0000 |
commit | 5972e958532f8ac91f10bc92ad2886ffad5ad3e4 (patch) | |
tree | 5b851d001bc888483b7750a302fcfd85b5c2816b /src/xdisp.c | |
parent | ebed21471a0a843ce9f0e67e6b860cf15fd0b4d1 (diff) | |
download | emacs-5972e958532f8ac91f10bc92ad2886ffad5ad3e4.tar.gz |
(syms_of_xdisp): Set up Qmenu_bar_update_hook.
(update_menu_bar): Run that hook.
Fix failure to update menu bar when w->update_mode_line was nil.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 8cb80ad69d8..108d2fe047c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -94,6 +94,8 @@ Lisp_Object Voverlay_arrow_string; /* Values of those variables at last redisplay. */ static Lisp_Object last_arrow_position, last_arrow_string; +Lisp_Object Qmenu_bar_update_hook; + /* Nonzero if overlay arrow has been displayed once in this window. */ static int overlay_arrow_seen; @@ -927,12 +929,11 @@ update_menu_bar (f) if (update_mode_lines) w->update_mode_line = Qt; - /* When we reach a frame's selected window, redo the frame's menu bar. */ - if (!NILP (w->update_mode_line) + if ( #ifdef USE_X_TOOLKIT - && FRAME_EXTERNAL_MENU_BAR (f) + FRAME_EXTERNAL_MENU_BAR (f) #else - && FRAME_MENU_BAR_LINES (f) > 0 + FRAME_MENU_BAR_LINES (f) > 0 #endif ) { @@ -944,12 +945,13 @@ update_menu_bar (f) the rest of the redisplay algorithm is about the same as windows_or_buffers_changed anyway. */ if (windows_or_buffers_changed - || update_mode_lines + || !NILP (w->update_mode_line) || (XFASTINT (w->last_modified) < MODIFF && (XFASTINT (w->last_modified) <= XBUFFER (w->buffer)->save_modified))) { struct buffer *prev = current_buffer; + call1 (Vrun_hooks, Qmenu_bar_update_hook); current_buffer = XBUFFER (w->buffer); FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); current_buffer = prev; @@ -3271,6 +3273,9 @@ display_string (w, vpos, string, length, hpos, truncate, void syms_of_xdisp () { + staticpro (&Qmenu_bar_update_hook); + Qmenu_bar_update_hook = intern ("menu-bar-update-hook"); + staticpro (&last_arrow_position); staticpro (&last_arrow_string); last_arrow_position = Qnil; |