diff options
| author | Eli Zaretskii | 2014-04-17 11:58:59 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-04-17 11:58:59 +0300 |
| commit | 8915b84286466c88ff1da95148d73e53464a5a89 (patch) | |
| tree | 0ac9b0f947d50f03a267d312632cf45e2e085eb0 /src | |
| parent | f76da67d4040ec3c766b7f4977341e142348cf60 (diff) | |
| download | emacs-8915b84286466c88ff1da95148d73e53464a5a89.tar.gz emacs-8915b84286466c88ff1da95148d73e53464a5a89.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d0aa2e59e01..122b093f2a0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2014-04-17 Eli Zaretskii <eliz@gnu.org> | 1 | 2014-04-17 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (Fline_pixel_height): Don't assume that the current | ||
| 4 | buffer and the selected window's buffer are one and the same. | ||
| 5 | (Bug#17281) | ||
| 6 | |||
| 3 | * insdel.c (invalidate_buffer_caches): Invalidate the bidi | 7 | * insdel.c (invalidate_buffer_caches): Invalidate the bidi |
| 4 | paragraph-start cache before the newline cache. (Bug#17269) | 8 | paragraph-start cache before the newline cache. (Bug#17269) |
| 5 | 9 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index eb3a6df1fc5..ad5f6a6bf83 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1262,12 +1262,23 @@ Value is the height in pixels of the line at point. */) | |||
| 1262 | struct it it; | 1262 | struct it it; |
| 1263 | struct text_pos pt; | 1263 | struct text_pos pt; |
| 1264 | struct window *w = XWINDOW (selected_window); | 1264 | struct window *w = XWINDOW (selected_window); |
| 1265 | struct buffer *old_buffer = NULL; | ||
| 1266 | Lisp_Object result; | ||
| 1265 | 1267 | ||
| 1268 | if (XBUFFER (w->contents) != current_buffer) | ||
| 1269 | { | ||
| 1270 | old_buffer = current_buffer; | ||
| 1271 | set_buffer_internal_1 (XBUFFER (w->contents)); | ||
| 1272 | } | ||
| 1266 | SET_TEXT_POS (pt, PT, PT_BYTE); | 1273 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| 1267 | start_display (&it, w, pt); | 1274 | start_display (&it, w, pt); |
| 1268 | it.vpos = it.current_y = 0; | 1275 | it.vpos = it.current_y = 0; |
| 1269 | last_height = 0; | 1276 | last_height = 0; |
| 1270 | return make_number (line_bottom_y (&it)); | 1277 | result = make_number (line_bottom_y (&it)); |
| 1278 | if (old_buffer) | ||
| 1279 | set_buffer_internal_1 (old_buffer); | ||
| 1280 | |||
| 1281 | return result; | ||
| 1271 | } | 1282 | } |
| 1272 | 1283 | ||
| 1273 | /* Return the default pixel height of text lines in window W. The | 1284 | /* Return the default pixel height of text lines in window W. The |