aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c62
1 files changed, 45 insertions, 17 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 76ab430386c..7e65b91fd13 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -701,6 +701,10 @@ Lisp_Object Vresize_mini_windows;
701 701
702struct buffer *displayed_buffer; 702struct buffer *displayed_buffer;
703 703
704/* Space between overline and text. */
705
706EMACS_INT overline_margin;
707
704/* Value returned from text property handlers (see below). */ 708/* Value returned from text property handlers (see below). */
705 709
706enum prop_handled 710enum prop_handled
@@ -887,7 +891,7 @@ static void redisplay_window P_ ((Lisp_Object, int));
887static Lisp_Object redisplay_window_error (); 891static Lisp_Object redisplay_window_error ();
888static Lisp_Object redisplay_window_0 P_ ((Lisp_Object)); 892static Lisp_Object redisplay_window_0 P_ ((Lisp_Object));
889static Lisp_Object redisplay_window_1 P_ ((Lisp_Object)); 893static Lisp_Object redisplay_window_1 P_ ((Lisp_Object));
890static void update_menu_bar P_ ((struct frame *, int)); 894static int update_menu_bar P_ ((struct frame *, int, int));
891static int try_window_reusing_current_matrix P_ ((struct window *)); 895static int try_window_reusing_current_matrix P_ ((struct window *));
892static int try_window_id P_ ((struct window *)); 896static int try_window_id P_ ((struct window *));
893static int display_line P_ ((struct it *)); 897static int display_line P_ ((struct it *));
@@ -9038,6 +9042,9 @@ prepare_menu_bars ()
9038 { 9042 {
9039 Lisp_Object tail, frame; 9043 Lisp_Object tail, frame;
9040 int count = SPECPDL_INDEX (); 9044 int count = SPECPDL_INDEX ();
9045 /* 1 means that update_menu_bar has run its hooks
9046 so any further calls to update_menu_bar shouldn't do so again. */
9047 int menu_bar_hooks_run = 0;
9041 9048
9042 record_unwind_save_match_data (); 9049 record_unwind_save_match_data ();
9043 9050
@@ -9069,7 +9076,7 @@ prepare_menu_bars ()
9069 } 9076 }
9070 9077
9071 GCPRO1 (tail); 9078 GCPRO1 (tail);
9072 update_menu_bar (f, 0); 9079 menu_bar_hooks_run = update_menu_bar (f, 0, menu_bar_hooks_run);
9073#ifdef HAVE_WINDOW_SYSTEM 9080#ifdef HAVE_WINDOW_SYSTEM
9074 update_tool_bar (f, 0); 9081 update_tool_bar (f, 0);
9075#ifdef MAC_OS 9082#ifdef MAC_OS
@@ -9084,7 +9091,7 @@ prepare_menu_bars ()
9084 else 9091 else
9085 { 9092 {
9086 struct frame *sf = SELECTED_FRAME (); 9093 struct frame *sf = SELECTED_FRAME ();
9087 update_menu_bar (sf, 1); 9094 update_menu_bar (sf, 1, 0);
9088#ifdef HAVE_WINDOW_SYSTEM 9095#ifdef HAVE_WINDOW_SYSTEM
9089 update_tool_bar (sf, 1); 9096 update_tool_bar (sf, 1);
9090#ifdef MAC_OS 9097#ifdef MAC_OS
@@ -9105,12 +9112,18 @@ prepare_menu_bars ()
9105 before we start to fill in any display lines, because it can call 9112 before we start to fill in any display lines, because it can call
9106 eval. 9113 eval.
9107 9114
9108 If SAVE_MATCH_DATA is non-zero, we must save and restore it here. */ 9115 If SAVE_MATCH_DATA is non-zero, we must save and restore it here.
9109 9116
9110static void 9117 If HOOKS_RUN is 1, that means a previous call to update_menu_bar
9111update_menu_bar (f, save_match_data) 9118 already ran the menu bar hooks for this redisplay, so there
9119 is no need to run them again. The return value is the
9120 updated value of this flag, to pass to the next call. */
9121
9122static int
9123update_menu_bar (f, save_match_data, hooks_run)
9112 struct frame *f; 9124 struct frame *f;
9113 int save_match_data; 9125 int save_match_data;
9126 int hooks_run;
9114{ 9127{
9115 Lisp_Object window; 9128 Lisp_Object window;
9116 register struct window *w; 9129 register struct window *w;
@@ -9175,15 +9188,21 @@ update_menu_bar (f, save_match_data)
9175 specbind (Qoverriding_local_map, Qnil); 9188 specbind (Qoverriding_local_map, Qnil);
9176 } 9189 }
9177 9190
9178 /* Run the Lucid hook. */ 9191 if (!hooks_run)
9179 safe_run_hooks (Qactivate_menubar_hook); 9192 {
9193 /* Run the Lucid hook. */
9194 safe_run_hooks (Qactivate_menubar_hook);
9180 9195
9181 /* If it has changed current-menubar from previous value, 9196 /* If it has changed current-menubar from previous value,
9182 really recompute the menu-bar from the value. */ 9197 really recompute the menu-bar from the value. */
9183 if (! NILP (Vlucid_menu_bar_dirty_flag)) 9198 if (! NILP (Vlucid_menu_bar_dirty_flag))
9184 call0 (Qrecompute_lucid_menubar); 9199 call0 (Qrecompute_lucid_menubar);
9200
9201 safe_run_hooks (Qmenu_bar_update_hook);
9202
9203 hooks_run = 1;
9204 }
9185 9205
9186 safe_run_hooks (Qmenu_bar_update_hook);
9187 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); 9206 FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
9188 9207
9189 /* Redisplay the menu bar in case we changed it. */ 9208 /* Redisplay the menu bar in case we changed it. */
@@ -9212,6 +9231,8 @@ update_menu_bar (f, save_match_data)
9212 set_buffer_internal_1 (prev); 9231 set_buffer_internal_1 (prev);
9213 } 9232 }
9214 } 9233 }
9234
9235 return hooks_run;
9215} 9236}
9216 9237
9217 9238
@@ -9376,7 +9397,8 @@ update_tool_bar (f, save_match_data)
9376 &new_n_tool_bar); 9397 &new_n_tool_bar);
9377 9398
9378 /* Redisplay the tool-bar if we changed it. */ 9399 /* Redisplay the tool-bar if we changed it. */
9379 if (NILP (Fequal (new_tool_bar, f->tool_bar_items))) 9400 if (new_n_tool_bar != f->n_tool_bar_items
9401 || NILP (Fequal (new_tool_bar, f->tool_bar_items)))
9380 { 9402 {
9381 /* Redisplay that happens asynchronously due to an expose event 9403 /* Redisplay that happens asynchronously due to an expose event
9382 may access f->tool_bar_items. Make sure we update both 9404 may access f->tool_bar_items. Make sure we update both
@@ -20354,7 +20376,7 @@ x_produce_glyphs (it)
20354 /* If face has an overline, add the height of the overline 20376 /* If face has an overline, add the height of the overline
20355 (1 pixel) and a 1 pixel margin to the character height. */ 20377 (1 pixel) and a 1 pixel margin to the character height. */
20356 if (face->overline_p) 20378 if (face->overline_p)
20357 it->ascent += 2; 20379 it->ascent += overline_margin;
20358 20380
20359 if (it->constrain_row_ascent_descent_p) 20381 if (it->constrain_row_ascent_descent_p)
20360 { 20382 {
@@ -20556,7 +20578,7 @@ x_produce_glyphs (it)
20556 /* If face has an overline, add the height of the overline 20578 /* If face has an overline, add the height of the overline
20557 (1 pixel) and a 1 pixel margin to the character height. */ 20579 (1 pixel) and a 1 pixel margin to the character height. */
20558 if (face->overline_p) 20580 if (face->overline_p)
20559 it->ascent += 2; 20581 it->ascent += overline_margin;
20560 20582
20561 take_vertical_position_into_account (it); 20583 take_vertical_position_into_account (it);
20562 20584
@@ -20831,7 +20853,7 @@ x_produce_glyphs (it)
20831 /* If face has an overline, add the height of the overline 20853 /* If face has an overline, add the height of the overline
20832 (1 pixel) and a 1 pixel margin to the character height. */ 20854 (1 pixel) and a 1 pixel margin to the character height. */
20833 if (face->overline_p) 20855 if (face->overline_p)
20834 it->ascent += 2; 20856 it->ascent += overline_margin;
20835 20857
20836 take_vertical_position_into_account (it); 20858 take_vertical_position_into_account (it);
20837 20859
@@ -24108,6 +24130,12 @@ whose contents depend on various data. */);
24108 doc: /* Inhibit try_cursor_movement display optimization. */); 24130 doc: /* Inhibit try_cursor_movement display optimization. */);
24109 inhibit_try_cursor_movement = 0; 24131 inhibit_try_cursor_movement = 0;
24110#endif /* GLYPH_DEBUG */ 24132#endif /* GLYPH_DEBUG */
24133
24134 DEFVAR_INT ("overline-margin", &overline_margin,
24135 doc: /* *Space between overline and text, in pixels.
24136The default value is 2: the height of the overline (1 pixel) plus 1 pixel
24137margin to the caracter height. */);
24138 overline_margin = 2;
24111} 24139}
24112 24140
24113 24141