Commit 8915b842 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix bug #17281 with infloop in line-pixel-height.

 src/xdisp.c (Fline_pixel_height): Don't assume that the current
 buffer and the selected window's buffer are one and the same.
parent f76da67d
2014-04-17 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (Fline_pixel_height): Don't assume that the current
buffer and the selected window's buffer are one and the same.
(Bug#17281)
* insdel.c (invalidate_buffer_caches): Invalidate the bidi
paragraph-start cache before the newline cache. (Bug#17269)
......
......@@ -1262,12 +1262,23 @@ Value is the height in pixels of the line at point. */)
struct it it;
struct text_pos pt;
struct window *w = XWINDOW (selected_window);
struct buffer *old_buffer = NULL;
Lisp_Object result;
 
if (XBUFFER (w->contents) != current_buffer)
{
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (w->contents));
}
SET_TEXT_POS (pt, PT, PT_BYTE);
start_display (&it, w, pt);
it.vpos = it.current_y = 0;
last_height = 0;
return make_number (line_bottom_y (&it));
result = make_number (line_bottom_y (&it));
if (old_buffer)
set_buffer_internal_1 (old_buffer);
return result;
}
 
/* Return the default pixel height of text lines in window W. The
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment