diff options
| author | Richard M. Stallman | 1994-04-25 22:16:08 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-25 22:16:08 +0000 |
| commit | cf074754341dbf139b908608012132c3fd020a8a (patch) | |
| tree | 9ea2ade3bb31cc4c93284bdc8fd2d3c5e5705894 /src | |
| parent | c8b8e7e336ad1b06d9b9e97a447b79e763516d06 (diff) | |
| download | emacs-cf074754341dbf139b908608012132c3fd020a8a.tar.gz emacs-cf074754341dbf139b908608012132c3fd020a8a.zip | |
(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')
| -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; | |||
| 94 | /* Values of those variables at last redisplay. */ | 94 | /* Values of those variables at last redisplay. */ |
| 95 | static Lisp_Object last_arrow_position, last_arrow_string; | 95 | static Lisp_Object last_arrow_position, last_arrow_string; |
| 96 | 96 | ||
| 97 | Lisp_Object Qmenu_bar_update_hook; | ||
| 98 | |||
| 97 | /* Nonzero if overlay arrow has been displayed once in this window. */ | 99 | /* Nonzero if overlay arrow has been displayed once in this window. */ |
| 98 | static int overlay_arrow_seen; | 100 | static int overlay_arrow_seen; |
| 99 | 101 | ||
| @@ -927,12 +929,11 @@ update_menu_bar (f) | |||
| 927 | if (update_mode_lines) | 929 | if (update_mode_lines) |
| 928 | w->update_mode_line = Qt; | 930 | w->update_mode_line = Qt; |
| 929 | 931 | ||
| 930 | /* When we reach a frame's selected window, redo the frame's menu bar. */ | 932 | if ( |
| 931 | if (!NILP (w->update_mode_line) | ||
| 932 | #ifdef USE_X_TOOLKIT | 933 | #ifdef USE_X_TOOLKIT |
| 933 | && FRAME_EXTERNAL_MENU_BAR (f) | 934 | FRAME_EXTERNAL_MENU_BAR (f) |
| 934 | #else | 935 | #else |
| 935 | && FRAME_MENU_BAR_LINES (f) > 0 | 936 | FRAME_MENU_BAR_LINES (f) > 0 |
| 936 | #endif | 937 | #endif |
| 937 | ) | 938 | ) |
| 938 | { | 939 | { |
| @@ -944,12 +945,13 @@ update_menu_bar (f) | |||
| 944 | the rest of the redisplay algorithm is about the same as | 945 | the rest of the redisplay algorithm is about the same as |
| 945 | windows_or_buffers_changed anyway. */ | 946 | windows_or_buffers_changed anyway. */ |
| 946 | if (windows_or_buffers_changed | 947 | if (windows_or_buffers_changed |
| 947 | || update_mode_lines | 948 | || !NILP (w->update_mode_line) |
| 948 | || (XFASTINT (w->last_modified) < MODIFF | 949 | || (XFASTINT (w->last_modified) < MODIFF |
| 949 | && (XFASTINT (w->last_modified) | 950 | && (XFASTINT (w->last_modified) |
| 950 | <= XBUFFER (w->buffer)->save_modified))) | 951 | <= XBUFFER (w->buffer)->save_modified))) |
| 951 | { | 952 | { |
| 952 | struct buffer *prev = current_buffer; | 953 | struct buffer *prev = current_buffer; |
| 954 | call1 (Vrun_hooks, Qmenu_bar_update_hook); | ||
| 953 | current_buffer = XBUFFER (w->buffer); | 955 | current_buffer = XBUFFER (w->buffer); |
| 954 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); | 956 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); |
| 955 | current_buffer = prev; | 957 | current_buffer = prev; |
| @@ -3271,6 +3273,9 @@ display_string (w, vpos, string, length, hpos, truncate, | |||
| 3271 | void | 3273 | void |
| 3272 | syms_of_xdisp () | 3274 | syms_of_xdisp () |
| 3273 | { | 3275 | { |
| 3276 | staticpro (&Qmenu_bar_update_hook); | ||
| 3277 | Qmenu_bar_update_hook = intern ("menu-bar-update-hook"); | ||
| 3278 | |||
| 3274 | staticpro (&last_arrow_position); | 3279 | staticpro (&last_arrow_position); |
| 3275 | staticpro (&last_arrow_string); | 3280 | staticpro (&last_arrow_string); |
| 3276 | last_arrow_position = Qnil; | 3281 | last_arrow_position = Qnil; |