aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2009-01-25 17:00:55 +0000
committerChong Yidong2009-01-25 17:00:55 +0000
commit707ea971f21dbe1d2fd2850c53d7a2987a5043ff (patch)
tree8f84ee0e5b1bed988255143cd9125375602f15a6 /src
parent6288ae552ad4da6b3da06a34ef662ca2603ba2ba (diff)
downloademacs-707ea971f21dbe1d2fd2850c53d7a2987a5043ff.tar.gz
emacs-707ea971f21dbe1d2fd2850c53d7a2987a5043ff.zip
(buffer_posn_from_coords): Use Fset_buffer instead of setting
current_buffer directly.
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c8
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;