aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-08-26 11:46:28 +0200
committerJoakim Verona2013-08-26 11:46:28 +0200
commitbc468f0f25e0a9c10a4c7023a37cfc9be369b69d (patch)
treeb7b5ed39cdfb57b96f05bb98b97c3bacc1686aff /src
parent40d74a503910168002cb1e170494d2f6d1adfeba (diff)
parentc80016b3c123a76970d8f9dbbff61aeb5319c919 (diff)
downloademacs-bc468f0f25e0a9c10a4c7023a37cfc9be369b69d.tar.gz
emacs-bc468f0f25e0a9c10a4c7023a37cfc9be369b69d.zip
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/window.c6
-rw-r--r--src/window.h8
-rw-r--r--src/xdisp.c8
4 files changed, 19 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e4dcfffa02f..6408397c13e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12013-08-26 Dmitry Antipov <dmantipov@yandex.ru> 12013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 * window.h (struct window): Replace last_cursor with last_cursor_vpos
4 because this is the only last cursor data we need to keep and consult.
5 * window.c (replace_window, set_window_buffer, Fsplit_window_internal):
6 * xdisp.c (mark_window_display_accurate_1, try_cursor_movement):
7 Adjust users.
8
92013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
10
3 Fix recovering from possible decompression error. Since 11 Fix recovering from possible decompression error. Since
4 insert_from_gap doesn't always move point, we can't use PT as 12 insert_from_gap doesn't always move point, we can't use PT as
5 the position where the partially decompressed data ends, and 13 the position where the partially decompressed data ends, and
diff --git a/src/window.c b/src/window.c
index cdda2b27a54..aa52efc1b4e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2030,8 +2030,8 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
2030 n->desired_matrix = n->current_matrix = 0; 2030 n->desired_matrix = n->current_matrix = 0;
2031 n->vscroll = 0; 2031 n->vscroll = 0;
2032 memset (&n->cursor, 0, sizeof (n->cursor)); 2032 memset (&n->cursor, 0, sizeof (n->cursor));
2033 memset (&n->last_cursor, 0, sizeof (n->last_cursor));
2034 memset (&n->phys_cursor, 0, sizeof (n->phys_cursor)); 2033 memset (&n->phys_cursor, 0, sizeof (n->phys_cursor));
2034 n->last_cursor_vpos = 0;
2035 n->phys_cursor_type = -1; 2035 n->phys_cursor_type = -1;
2036 n->phys_cursor_width = -1; 2036 n->phys_cursor_width = -1;
2037 n->must_be_updated_p = 0; 2037 n->must_be_updated_p = 0;
@@ -3175,7 +3175,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
3175 3175
3176 w->window_end_pos = 0; 3176 w->window_end_pos = 0;
3177 w->window_end_vpos = 0; 3177 w->window_end_vpos = 0;
3178 memset (&w->last_cursor, 0, sizeof w->last_cursor); 3178 w->last_cursor_vpos = 0;
3179 3179
3180 if (!(keep_margins_p && samebuf)) 3180 if (!(keep_margins_p && samebuf))
3181 { /* If we're not actually changing the buffer, don't reset hscroll and 3181 { /* If we're not actually changing the buffer, don't reset hscroll and
@@ -3914,7 +3914,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3914 } 3914 }
3915 3915
3916 n->window_end_valid = 0; 3916 n->window_end_valid = 0;
3917 memset (&n->last_cursor, 0, sizeof n->last_cursor); 3917 n->last_cursor_vpos = 0;
3918 3918
3919 /* Get special geometry settings from reference window. */ 3919 /* Get special geometry settings from reference window. */
3920 n->left_margin_cols = r->left_margin_cols; 3920 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
229 as the normal may yield a matrix which is too small. */ 229 as the normal may yield a matrix which is too small. */
230 int nrows_scale_factor, ncols_scale_factor; 230 int nrows_scale_factor, ncols_scale_factor;
231 231
232 /* Cursor position as of last update that completed without
233 pause. This is the position of last_point. */
234 struct cursor_pos last_cursor;
235
236 /* Intended cursor position. This is a position within the 232 /* Intended cursor position. This is a position within the
237 glyph matrix. */ 233 glyph matrix. */
238 struct cursor_pos cursor; 234 struct cursor_pos cursor;
@@ -240,6 +236,10 @@ struct window
240 /* Where the cursor actually is. */ 236 /* Where the cursor actually is. */
241 struct cursor_pos phys_cursor; 237 struct cursor_pos phys_cursor;
242 238
239 /* Vertical cursor position as of last update that completed
240 without pause. This is the position of last_point. */
241 int last_cursor_vpos;
242
243 /* Cursor type and width of last cursor drawn on the window. 243 /* Cursor type and width of last cursor drawn on the window.
244 Used for X and w32 frames; -1 initially. */ 244 Used for X and w32 frames; -1 initially. */
245 int phys_cursor_type, phys_cursor_width; 245 int phys_cursor_type, phys_cursor_width;
diff --git a/src/xdisp.c b/src/xdisp.c
index ee85c355b3e..e842a95fb62 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13806,7 +13806,7 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
13806 w->current_matrix->begv = BUF_BEGV (b); 13806 w->current_matrix->begv = BUF_BEGV (b);
13807 w->current_matrix->zv = BUF_ZV (b); 13807 w->current_matrix->zv = BUF_ZV (b);
13808 13808
13809 w->last_cursor = w->cursor; 13809 w->last_cursor_vpos = w->cursor.vpos;
13810 w->last_cursor_off_p = w->cursor_off_p; 13810 w->last_cursor_off_p = w->cursor_off_p;
13811 13811
13812 if (w == XWINDOW (selected_window)) 13812 if (w == XWINDOW (selected_window))
@@ -15150,12 +15150,12 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15150 15150
15151 /* Start with the row the cursor was displayed during the last 15151 /* Start with the row the cursor was displayed during the last
15152 not paused redisplay. Give up if that row is not valid. */ 15152 not paused redisplay. Give up if that row is not valid. */
15153 if (w->last_cursor.vpos < 0 15153 if (w->last_cursor_vpos < 0
15154 || w->last_cursor.vpos >= w->current_matrix->nrows) 15154 || w->last_cursor_vpos >= w->current_matrix->nrows)
15155 rc = CURSOR_MOVEMENT_MUST_SCROLL; 15155 rc = CURSOR_MOVEMENT_MUST_SCROLL;
15156 else 15156 else
15157 { 15157 {
15158 row = MATRIX_ROW (w->current_matrix, w->last_cursor.vpos); 15158 row = MATRIX_ROW (w->current_matrix, w->last_cursor_vpos);
15159 if (row->mode_line_p) 15159 if (row->mode_line_p)
15160 ++row; 15160 ++row;
15161 if (!row->enabled_p) 15161 if (!row->enabled_p)