From: Eli Zaretskii Date: Sun, 4 Nov 2018 14:01:09 +0000 (+0200) Subject: A further fix for locally remapped fringe face X-Git-Tag: emacs-27.0.90~4217 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19d2ba00596b8ee31cff046b2387580b016fa4c5;p=emacs.git A further fix for locally remapped fringe face * src/xdisp.c (expose_window): Temporarily switch to the window's buffer, in case the fringe face was remapped locally in that buffer. (Bug#33244) --- diff --git a/src/xdisp.c b/src/xdisp.c index 7b0ca477220..fa7691cdd0f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -32252,6 +32252,18 @@ expose_window (struct window *w, XRectangle *fr) y0 or y1 is negative (can happen for tall images). */ int r_bottom = r.y + r.height; + /* We must temporarily switch to the window's buffer, in case + the fringe face has been remapped in that buffer's + face-remapping-alist, so that draw_row_fringe_bitmaps, + called from expose_line, will use the right face. */ + bool buffer_changed = false; + struct buffer *oldbuf = current_buffer; + if (!w->pseudo_window_p) + { + set_buffer_internal_1 (XBUFFER (w->contents)); + buffer_changed = true; + } + /* Update lines intersecting rectangle R. */ first_overlapping_row = last_overlapping_row = NULL; for (row = w->current_matrix->rows; @@ -32297,6 +32309,9 @@ expose_window (struct window *w, XRectangle *fr) break; } + if (buffer_changed) + set_buffer_internal_1 (oldbuf); + /* Display the mode line if there is one. */ if (window_wants_mode_line (w) && (row = MATRIX_MODE_LINE_ROW (w->current_matrix),