/* 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;
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
)
{
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;
p1start = p1;
charstart = desired_glyphs->charstarts[vpos] + hpos;
/* In case we don't ever write anything into it... */
- *charstart = -1;
+ desired_glyphs->charstarts[vpos][XFASTINT (w->left)] = -1;
end = ZV;
leftmargin = desired_glyphs->glyphs[vpos] + XFASTINT (w->left);
endp = leftmargin + width;
else if (c == '\n')
{
invis = 0;
- while (pos < end
+ while (pos + 1 < end
&& selective > 0
&& indented_beyond_p (pos + 1, selective))
{
And don't clobber anything to the left of that. */
if (p1prev < leftmargin)
{
- charstart[0] = pos;
- p2x = charstart;
+ p2x = charstart + (leftmargin - p1start);
+ *p2x = pos;
}
/* This loop skips over the char p2x initially points to. */
- while (++p2x != p2)
+ while (++p2x < p2)
*p2x = -1;
}
}
/* Add 1 in the endtest to compensate for the fact that ENDP was
made from WIDTH, which is 1 less than the window's actual
internal width. */
- for (i = p1 - p1start + 1; i < endp - p1start + 1; i++)
+ i = p1 - p1start + 1;
+ if (p1 < leftmargin)
+ i += leftmargin - p1;
+ for (; i < endp - p1start + 1; i++)
charstart[i] = 0;
/* Handle continuation in middle of a character */
case 't': /* indicate TEXT or BINARY */
#ifdef MSDOS
- decode_mode_spec_buf[0]
- = NILP (current_buffer->buffer_file_type) ? "T" : "B";
- decode_mode_spec_buf[1] = 0;
- return decode_mode_spec_buf;
+ return NILP (current_buffer->buffer_file_type) ? "T" : "B";
#else /* not MSDOS */
return "T";
#endif /* not MSDOS */
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;