emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src dispnew.c


From: Chong Yidong
Subject: [Emacs-diffs] emacs/src dispnew.c
Date: Sun, 25 Jan 2009 17:00:56 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/01/25 17:00:56

Modified files:
        src            : dispnew.c 

Log message:
        (buffer_posn_from_coords): Use Fset_buffer instead of setting
        current_buffer directly.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/dispnew.c?cvsroot=emacs&r1=1.425&r2=1.426

Patches:
Index: dispnew.c
===================================================================
RCS file: /sources/emacs/emacs/src/dispnew.c,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -b -r1.425 -r1.426
--- dispnew.c   8 Jan 2009 03:15:31 -0000       1.425
+++ dispnew.c   25 Jan 2009 17:00:55 -0000      1.426
@@ -5933,7 +5933,7 @@
      int *width, *height;
 {
   struct it it;
-  struct buffer *old_current_buffer = current_buffer;
+  Lisp_Object old_current_buffer = Fcurrent_buffer ();
   struct text_pos startp;
   Lisp_Object string;
   struct glyph_row *row;
@@ -5942,7 +5942,9 @@
 #endif
   int x0, x1;
 
-  current_buffer = XBUFFER (w->buffer);
+  /* We used to set current_buffer directly here, but that does the
+     wrong thing with `face-remapping-alist' (bug#2044).  */
+  Fset_buffer (w->buffer);
   SET_TEXT_POS_FROM_MARKER (startp, w->start);
   CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
   BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp)));
@@ -5952,7 +5954,7 @@
   move_it_to (&it, -1, x0 + it.first_visible_x, *y, -1,
              MOVE_TO_X | MOVE_TO_Y);
 
-  current_buffer = old_current_buffer;
+  Fset_buffer (old_current_buffer);
 
   *dx = x0 + it.first_visible_x - it.current_x;
   *dy = *y - it.current_y;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]