diff options
| author | Gerd Moellmann | 2001-02-19 13:48:28 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-02-19 13:48:28 +0000 |
| commit | e1477f43fd021cada21728535744cbd232640caa (patch) | |
| tree | 291ad1962d6509cfff455c460c362dca40759926 /src | |
| parent | 65048e973339594bfdbdf354076af4b0071dbb22 (diff) | |
| download | emacs-e1477f43fd021cada21728535744cbd232640caa.tar.gz emacs-e1477f43fd021cada21728535744cbd232640caa.zip | |
(Qinhibit_menubar_update, inhibit_menubar_update):
New variables.
(syms_of_xdisp): Initialize new variables.
(update_menu_bar): Do nothing if inhibit_menubar_update is set.
Specbind `inhibit-menubar-update' when updating the menu bar.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index e573069dcb1..b1270776eaf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -488,6 +488,11 @@ static int display_last_displayed_message_p; | |||
| 488 | 488 | ||
| 489 | int message_buf_print; | 489 | int message_buf_print; |
| 490 | 490 | ||
| 491 | /* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable. */ | ||
| 492 | |||
| 493 | Lisp_Object Qinhibit_menubar_update; | ||
| 494 | int inhibit_menubar_update; | ||
| 495 | |||
| 491 | /* Maximum height for resizing mini-windows. Either a float | 496 | /* Maximum height for resizing mini-windows. Either a float |
| 492 | specifying a fraction of the available height, or an integer | 497 | specifying a fraction of the available height, or an integer |
| 493 | specifying a number of lines. */ | 498 | specifying a number of lines. */ |
| @@ -6989,6 +6994,12 @@ update_menu_bar (f, save_match_data) | |||
| 6989 | Lisp_Object window; | 6994 | Lisp_Object window; |
| 6990 | register struct window *w; | 6995 | register struct window *w; |
| 6991 | 6996 | ||
| 6997 | /* If called recursively during a menu update, do nothing. This can | ||
| 6998 | happen when, for instance, an activate-menubar-hook causes a | ||
| 6999 | redisplay. */ | ||
| 7000 | if (inhibit_menubar_update) | ||
| 7001 | return; | ||
| 7002 | |||
| 6992 | window = FRAME_SELECTED_WINDOW (f); | 7003 | window = FRAME_SELECTED_WINDOW (f); |
| 6993 | w = XWINDOW (window); | 7004 | w = XWINDOW (window); |
| 6994 | 7005 | ||
| @@ -7023,6 +7034,8 @@ update_menu_bar (f, save_match_data) | |||
| 7023 | struct buffer *prev = current_buffer; | 7034 | struct buffer *prev = current_buffer; |
| 7024 | int count = BINDING_STACK_SIZE (); | 7035 | int count = BINDING_STACK_SIZE (); |
| 7025 | 7036 | ||
| 7037 | specbind (Qinhibit_menubar_update, Qt); | ||
| 7038 | |||
| 7026 | set_buffer_internal_1 (XBUFFER (w->buffer)); | 7039 | set_buffer_internal_1 (XBUFFER (w->buffer)); |
| 7027 | if (save_match_data) | 7040 | if (save_match_data) |
| 7028 | record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); | 7041 | record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); |
| @@ -14045,6 +14058,8 @@ syms_of_xdisp () | |||
| 14045 | staticpro (&Qmessage_truncate_lines); | 14058 | staticpro (&Qmessage_truncate_lines); |
| 14046 | Qgrow_only = intern ("grow-only"); | 14059 | Qgrow_only = intern ("grow-only"); |
| 14047 | staticpro (&Qgrow_only); | 14060 | staticpro (&Qgrow_only); |
| 14061 | Qinhibit_menubar_update = intern ("inhibit-menubar-update"); | ||
| 14062 | staticpro (&Qinhibit_menubar_update); | ||
| 14048 | 14063 | ||
| 14049 | last_arrow_position = Qnil; | 14064 | last_arrow_position = Qnil; |
| 14050 | last_arrow_string = Qnil; | 14065 | last_arrow_string = Qnil; |
| @@ -14269,6 +14284,10 @@ Bind this around calls to `message' to let it take effect."); | |||
| 14269 | "Normal hook run for clicks on menu bar, before displaying a submenu.\n\ | 14284 | "Normal hook run for clicks on menu bar, before displaying a submenu.\n\ |
| 14270 | Can be used to update submenus whose contents should vary."); | 14285 | Can be used to update submenus whose contents should vary."); |
| 14271 | Vmenu_bar_update_hook = Qnil; | 14286 | Vmenu_bar_update_hook = Qnil; |
| 14287 | |||
| 14288 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, | ||
| 14289 | "Non-nil means don't update menu bars. Internal use only."); | ||
| 14290 | inhibit_menubar_update = 0; | ||
| 14272 | } | 14291 | } |
| 14273 | 14292 | ||
| 14274 | 14293 | ||