Fix bugs #13623 and 13626 caused by changes in 2013-02-01T07:23:18Z!dmantipov@yandex.ru.

src/xdisp.c (window_buffer_changed): region_showing can be negative,
 which still means region is being displayed.
 (redisplay_internal): Resurrect code that forced redisplay of the
 whole window when showing region and the mark has changed.  Record
 the new mark position to allow redisplay optimizations.
 (display_line): If it->region_beg_charpos is non-zero, set the
 window's region_showing member to -1.
 src/window.h (struct window) <region_showing>: Declare ptrdiff_t,
 not bitfield of 1 bit.
This commit is contained in:
Eli Zaretskii 2013-02-04 17:39:55 +02:00
parent 6e5c1569e9
commit 86f7c0fe60
3 changed files with 33 additions and 5 deletions

View file

@ -1,3 +1,16 @@
2013-02-04 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (window_buffer_changed): region_showing can be negative,
which still means region is being displayed.
(redisplay_internal): Resurrect code that forced redisplay of the
whole window when showing region and the mark has changed. Record
the new mark position to allow redisplay optimizations.
(display_line): If it->region_beg_charpos is non-zero, set the
window's region_showing member to -1. (Bug#13623) (Bug#13626)
* window.h (struct window) <region_showing>: Declare ptrdiff_t,
not bitfield of 1 bit.
2013-02-03 Daniel Colascione <dancol@dancol.org>
* emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that

View file

@ -333,13 +333,15 @@ struct window
the frame image that window_end_pos did not get onto the frame. */
unsigned window_end_valid : 1;
/* Nonzero if we have highlighted the region (or any part of it). */
unsigned region_showing : 1;
/* Amount by which lines of this window are scrolled in
y-direction (smooth scrolling). */
int vscroll;
/* If we have highlighted the region (or any part of it), the mark
position or -1 (the latter is used by the iterator for internal
purposes); otherwise zero. */
ptrdiff_t region_showing;
/* Z_BYTE - buffer position of the last glyph in the current matrix of W.
Should be nonnegative, and only valid if window_end_valid is nonzero. */
ptrdiff_t window_end_bytepos;

View file

@ -10753,7 +10753,7 @@ window_buffer_changed (struct window *w)
return (((BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w->last_had_star)
|| ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (b, mark_active)))
!= w->region_showing));
!= (w->region_showing != 0)));
}
/* Nonzero if W has %c in its mode line and mode line should be updated. */
@ -13016,6 +13016,17 @@ redisplay_internal (void)
clear_garbaged_frames ();
}
/* If showing the region, and mark has changed, we must redisplay
the whole window. The assignment to this_line_start_pos prevents
the optimization directly below this if-statement. */
if (((!NILP (Vtransient_mark_mode)
&& !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
!= (w->region_showing > 0))
|| (w->region_showing
&& w->region_showing
!= XINT (Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
CHARPOS (this_line_start_pos) = 0;
/* Optimize the case that only the line containing the cursor in the
selected window has changed. Variables starting with this_ are
set in display_line and record information about the line
@ -13228,6 +13239,8 @@ redisplay_internal (void)
++clear_image_cache_count;
#endif
w->region_showing = XINT (Fmarker_position (BVAR (XBUFFER (w->buffer), mark)));
/* Build desired matrices, and update the display. If
consider_all_windows_p is non-zero, do it for all windows on all
frames. Otherwise do it for selected_window, only. */
@ -19120,7 +19133,7 @@ display_line (struct it *it)
}
/* Is IT->w showing the region? */
it->w->region_showing = it->region_beg_charpos > 0;
it->w->region_showing = it->region_beg_charpos > 0 ? -1 : 0;
/* Clear the result glyph row and enable it. */
prepare_desired_row (row);