diff options
| -rw-r--r-- | src/dispnew.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 62ec3cd9669..c94119fe9c9 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5933,7 +5933,7 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) | |||
| 5933 | int *width, *height; | 5933 | int *width, *height; |
| 5934 | { | 5934 | { |
| 5935 | struct it it; | 5935 | struct it it; |
| 5936 | struct buffer *old_current_buffer = current_buffer; | 5936 | Lisp_Object old_current_buffer = Fcurrent_buffer (); |
| 5937 | struct text_pos startp; | 5937 | struct text_pos startp; |
| 5938 | Lisp_Object string; | 5938 | Lisp_Object string; |
| 5939 | struct glyph_row *row; | 5939 | struct glyph_row *row; |
| @@ -5942,7 +5942,9 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) | |||
| 5942 | #endif | 5942 | #endif |
| 5943 | int x0, x1; | 5943 | int x0, x1; |
| 5944 | 5944 | ||
| 5945 | current_buffer = XBUFFER (w->buffer); | 5945 | /* We used to set current_buffer directly here, but that does the |
| 5946 | wrong thing with `face-remapping-alist' (bug#2044). */ | ||
| 5947 | Fset_buffer (w->buffer); | ||
| 5946 | SET_TEXT_POS_FROM_MARKER (startp, w->start); | 5948 | SET_TEXT_POS_FROM_MARKER (startp, w->start); |
| 5947 | CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); | 5949 | CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); |
| 5948 | BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); | 5950 | BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); |
| @@ -5952,7 +5954,7 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) | |||
| 5952 | move_it_to (&it, -1, x0 + it.first_visible_x, *y, -1, | 5954 | move_it_to (&it, -1, x0 + it.first_visible_x, *y, -1, |
| 5953 | MOVE_TO_X | MOVE_TO_Y); | 5955 | MOVE_TO_X | MOVE_TO_Y); |
| 5954 | 5956 | ||
| 5955 | current_buffer = old_current_buffer; | 5957 | Fset_buffer (old_current_buffer); |
| 5956 | 5958 | ||
| 5957 | *dx = x0 + it.first_visible_x - it.current_x; | 5959 | *dx = x0 + it.first_visible_x - it.current_x; |
| 5958 | *dy = *y - it.current_y; | 5960 | *dy = *y - it.current_y; |