From: Dmitry Antipov Date: Mon, 26 Aug 2013 09:33:37 +0000 (+0400) Subject: * window.h (struct window): Replace last_cursor with last_cursor_vpos X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1686^2~120 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c80016b3c123a76970d8f9dbbff61aeb5319c919;p=emacs.git * window.h (struct window): Replace last_cursor with last_cursor_vpos because this is the only last cursor data we need to keep and consult. * window.c (replace_window, set_window_buffer, Fsplit_window_internal): * xdisp.c (mark_window_display_accurate_1, try_cursor_movement): Adjust users. --- diff --git a/src/ChangeLog b/src/ChangeLog index e4dcfffa02f..6408397c13e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2013-08-26 Dmitry Antipov + + * window.h (struct window): Replace last_cursor with last_cursor_vpos + because this is the only last cursor data we need to keep and consult. + * window.c (replace_window, set_window_buffer, Fsplit_window_internal): + * xdisp.c (mark_window_display_accurate_1, try_cursor_movement): + Adjust users. + 2013-08-26 Dmitry Antipov Fix recovering from possible decompression error. Since diff --git a/src/window.c b/src/window.c index 023dc485d7f..6ef32608a56 100644 --- a/src/window.c +++ b/src/window.c @@ -2027,8 +2027,8 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag) n->desired_matrix = n->current_matrix = 0; n->vscroll = 0; memset (&n->cursor, 0, sizeof (n->cursor)); - memset (&n->last_cursor, 0, sizeof (n->last_cursor)); memset (&n->phys_cursor, 0, sizeof (n->phys_cursor)); + n->last_cursor_vpos = 0; n->phys_cursor_type = -1; n->phys_cursor_width = -1; n->must_be_updated_p = 0; @@ -3172,7 +3172,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, w->window_end_pos = 0; w->window_end_vpos = 0; - memset (&w->last_cursor, 0, sizeof w->last_cursor); + w->last_cursor_vpos = 0; if (!(keep_margins_p && samebuf)) { /* If we're not actually changing the buffer, don't reset hscroll and @@ -3911,7 +3911,7 @@ set correctly. See the code of `split-window' for how this is done. */) } n->window_end_valid = 0; - memset (&n->last_cursor, 0, sizeof n->last_cursor); + n->last_cursor_vpos = 0; /* Get special geometry settings from reference window. */ n->left_margin_cols = r->left_margin_cols; diff --git a/src/window.h b/src/window.h index c64641825e3..de77dcabc85 100644 --- a/src/window.h +++ b/src/window.h @@ -229,10 +229,6 @@ struct window as the normal may yield a matrix which is too small. */ int nrows_scale_factor, ncols_scale_factor; - /* Cursor position as of last update that completed without - pause. This is the position of last_point. */ - struct cursor_pos last_cursor; - /* Intended cursor position. This is a position within the glyph matrix. */ struct cursor_pos cursor; @@ -240,6 +236,10 @@ struct window /* Where the cursor actually is. */ struct cursor_pos phys_cursor; + /* Vertical cursor position as of last update that completed + without pause. This is the position of last_point. */ + int last_cursor_vpos; + /* Cursor type and width of last cursor drawn on the window. Used for X and w32 frames; -1 initially. */ int phys_cursor_type, phys_cursor_width; diff --git a/src/xdisp.c b/src/xdisp.c index 6257add2f4e..cbb70a22bfb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13743,7 +13743,7 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p) w->current_matrix->begv = BUF_BEGV (b); w->current_matrix->zv = BUF_ZV (b); - w->last_cursor = w->cursor; + w->last_cursor_vpos = w->cursor.vpos; w->last_cursor_off_p = w->cursor_off_p; if (w == XWINDOW (selected_window)) @@ -15087,12 +15087,12 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste /* Start with the row the cursor was displayed during the last not paused redisplay. Give up if that row is not valid. */ - if (w->last_cursor.vpos < 0 - || w->last_cursor.vpos >= w->current_matrix->nrows) + if (w->last_cursor_vpos < 0 + || w->last_cursor_vpos >= w->current_matrix->nrows) rc = CURSOR_MOVEMENT_MUST_SCROLL; else { - row = MATRIX_ROW (w->current_matrix, w->last_cursor.vpos); + row = MATRIX_ROW (w->current_matrix, w->last_cursor_vpos); if (row->mode_line_p) ++row; if (!row->enabled_p)