visible_p = 1;
if (visible_p)
{
- if (it_method == GET_FROM_BUFFER)
- {
- Lisp_Object window, prop;
-
- XSETWINDOW (window, w);
- prop = Fget_char_property (make_number (charpos),
- Qinvisible, window);
-
- /* If charpos coincides with invisible text covered with an
- ellipsis, use the first glyph of the ellipsis to compute
- the pixel positions. */
- if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2)
- {
- struct glyph_row *row = it.glyph_row;
- struct glyph *glyph = row->glyphs[TEXT_AREA];
- struct glyph *end = glyph + row->used[TEXT_AREA];
- int x = row->x;
-
- for (; glyph < end
- && (!BUFFERP (glyph->object)
- || glyph->charpos < charpos);
- glyph++)
- x += glyph->pixel_width;
- top_x = x;
- }
- }
- else if (it_method == GET_FROM_DISPLAY_VECTOR)
+ if (it_method == GET_FROM_DISPLAY_VECTOR)
{
/* We stopped on the last glyph of a display vector.
Try and recompute. Hack alert! */
it->stop_charpos = charpos;
if (s == NULL && it->multibyte_p)
- composition_compute_stop_pos (&it->cmp_it, charpos, -1, it->end_charpos,
- it->string);
+ {
+ EMACS_INT endpos = SCHARS (it->string);
+ if (endpos > it->end_charpos)
+ endpos = it->end_charpos;
+ composition_compute_stop_pos (&it->cmp_it, charpos, -1, endpos,
+ it->string);
+ }
CHECK_IT (it);
}
struct it *it;
{
it->what = IT_IMAGE;
+ it->ignore_overlay_strings_at_pos_p = 0;
return 1;
}
if (! STRINGP (f->name)
|| SBYTES (f->name) != len
|| bcmp (title, SDATA (f->name), len) != 0)
- {
-#ifdef HAVE_NS
- if (FRAME_NS_P (f))
- {
- if (!MINI_WINDOW_P(XWINDOW(f->selected_window)))
- {
- if (EQ (fmt, Qt))
- ns_set_name_as_filename (f);
- else
- x_implicitly_set_name (f, make_string(title, len),
- Qnil);
- }
- }
- else
-#endif
- x_implicitly_set_name (f, make_string (title, len), Qnil);
- }
-#ifdef HAVE_NS
- if (FRAME_NS_P (f))
- {
- /* do this also for frames with explicit names */
- ns_implicitly_set_icon_type(f);
- ns_set_doc_edited(f, Fbuffer_modified_p
- (XWINDOW (f->selected_window)->buffer), Qnil);
- }
-#endif
+ x_implicitly_set_name (f, make_string (title, len), Qnil);
}
}
menu_bar_hooks_run = update_menu_bar (f, 0, menu_bar_hooks_run);
#ifdef HAVE_WINDOW_SYSTEM
update_tool_bar (f, 0);
+#endif
+#ifdef HAVE_NS
+ if (windows_or_buffers_changed
+ && FRAME_NS_P (f))
+ ns_set_doc_edited (f, Fbuffer_modified_p
+ (XWINDOW (f->selected_window)->buffer));
#endif
UNGCPRO;
}
(*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w);
}
- /* Restore current_buffer and value of point in it. */
- TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
+ /* Restore current_buffer and value of point in it. The window
+ update may have changed the buffer, so first make sure `opoint'
+ is still valid (Bug#6177). */
+ if (CHARPOS (opoint) < BEGV)
+ TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
+ else if (CHARPOS (opoint) > ZV)
+ TEMP_SET_PT_BOTH (Z, Z_BYTE);
+ else
+ TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
+
set_buffer_internal_1 (old);
/* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
shorter. This can be caused by log truncation in *Messages*. */
j = i;
BUILD_GLYPH_STRINGS (j, start, h, t,
overlap_hl, dummy_x, last_x);
+ start = i;
compute_overhangs_and_x (t, head->x, 1);
prepend_glyph_string_lists (&head, &tail, h, t);
clip_head = head;
BUILD_GLYPH_STRINGS (end, i, h, t,
overlap_hl, x, last_x);
+ /* Because BUILD_GLYPH_STRINGS updates the first argument,
+ we don't have `end = i;' here. */
compute_overhangs_and_x (h, tail->x + tail->width, 0);
append_glyph_string_lists (&head, &tail, h, t);
clip_tail = tail;
/* Switch the display of W's cursor on or off, according to the value
of ON. */
-#ifndef HAVE_NS
-static
-#endif
void
update_window_cursor (w, on)
struct window *w;
#endif
if (NILP (Vmouse_highlight)
- || !f->glyphs_initialized_p)
+ || !f->glyphs_initialized_p
+ || f->pointer_invisible)
return;
dpyinfo->mouse_face_mouse_x = x;