diff options
| author | Eli Zaretskii | 2013-06-30 17:49:33 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-06-30 17:49:33 +0300 |
| commit | 0ba54312c98bdcc8ab3ffc872cb9581710a0eea8 (patch) | |
| tree | 7b2710e9d2c61b8e2ac0a2243667174c3eb33f1c /src | |
| parent | 0865d506b58bd49932ec8eed0c6e486d2dfd8bb1 (diff) | |
| download | emacs-0ba54312c98bdcc8ab3ffc872cb9581710a0eea8.tar.gz emacs-0ba54312c98bdcc8ab3ffc872cb9581710a0eea8.zip | |
Don't call sit-for in right-char and left-char for visual cursor motion.
src/xdisp.c (Fmove_point_visually): Invalidate the cursor position
when moving point by using the current glyph matrix. This avoids
the need to force redisplay when this function is called in a
loop.
lisp/bindings.el (right-char, left-char): Don't call sit-for, this is
no longer needed. Use arithmetic comparison only for numerical
arguments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2f1c553576f..f10e1070fa3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-06-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (Fmove_point_visually): Invalidate the cursor position | ||
| 4 | when moving point by using the current glyph matrix. This avoids | ||
| 5 | the need to force redisplay when this function is called in a | ||
| 6 | loop. | ||
| 7 | |||
| 1 | 2013-06-29 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2013-06-29 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | Fix minor problems found by static checking. | 10 | Fix minor problems found by static checking. |
diff --git a/src/xdisp.c b/src/xdisp.c index 963553e10cc..660c6b9130f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20107,6 +20107,7 @@ Value is the new character position of point. */) | |||
| 20107 | if (BUFFERP (g->object) && g->charpos != PT) | 20107 | if (BUFFERP (g->object) && g->charpos != PT) |
| 20108 | { | 20108 | { |
| 20109 | SET_PT (g->charpos); | 20109 | SET_PT (g->charpos); |
| 20110 | w->cursor.vpos = -1; | ||
| 20110 | return make_number (PT); | 20111 | return make_number (PT); |
| 20111 | } | 20112 | } |
| 20112 | else if (!INTEGERP (g->object) && g->object != gpt->object) | 20113 | else if (!INTEGERP (g->object) && g->object != gpt->object) |
| @@ -20126,6 +20127,7 @@ Value is the new character position of point. */) | |||
| 20126 | else | 20127 | else |
| 20127 | break; | 20128 | break; |
| 20128 | SET_PT (new_pos); | 20129 | SET_PT (new_pos); |
| 20130 | w->cursor.vpos = -1; | ||
| 20129 | return make_number (PT); | 20131 | return make_number (PT); |
| 20130 | } | 20132 | } |
| 20131 | else if (ROW_GLYPH_NEWLINE_P (row, g)) | 20133 | else if (ROW_GLYPH_NEWLINE_P (row, g)) |
| @@ -20141,6 +20143,7 @@ Value is the new character position of point. */) | |||
| 20141 | SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1); | 20143 | SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1); |
| 20142 | else | 20144 | else |
| 20143 | break; | 20145 | break; |
| 20146 | w->cursor.vpos = -1; | ||
| 20144 | return make_number (PT); | 20147 | return make_number (PT); |
| 20145 | } | 20148 | } |
| 20146 | } | 20149 | } |
| @@ -20161,6 +20164,7 @@ Value is the new character position of point. */) | |||
| 20161 | if (row->reversed_p && !row->continued_p) | 20164 | if (row->reversed_p && !row->continued_p) |
| 20162 | { | 20165 | { |
| 20163 | SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1); | 20166 | SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1); |
| 20167 | w->cursor.vpos = -1; | ||
| 20164 | return make_number (PT); | 20168 | return make_number (PT); |
| 20165 | } | 20169 | } |
| 20166 | g = row->glyphs[TEXT_AREA]; | 20170 | g = row->glyphs[TEXT_AREA]; |
| @@ -20188,6 +20192,7 @@ Value is the new character position of point. */) | |||
| 20188 | SET_PT (ZV); | 20192 | SET_PT (ZV); |
| 20189 | else | 20193 | else |
| 20190 | continue; | 20194 | continue; |
| 20195 | w->cursor.vpos = -1; | ||
| 20191 | return make_number (PT); | 20196 | return make_number (PT); |
| 20192 | } | 20197 | } |
| 20193 | } | 20198 | } |
| @@ -20197,6 +20202,7 @@ Value is the new character position of point. */) | |||
| 20197 | if (!row->reversed_p && !row->continued_p) | 20202 | if (!row->reversed_p && !row->continued_p) |
| 20198 | { | 20203 | { |
| 20199 | SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1); | 20204 | SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1); |
| 20205 | w->cursor.vpos = -1; | ||
| 20200 | return make_number (PT); | 20206 | return make_number (PT); |
| 20201 | } | 20207 | } |
| 20202 | e = row->glyphs[TEXT_AREA]; | 20208 | e = row->glyphs[TEXT_AREA]; |
| @@ -20224,6 +20230,7 @@ Value is the new character position of point. */) | |||
| 20224 | SET_PT (ZV); | 20230 | SET_PT (ZV); |
| 20225 | else | 20231 | else |
| 20226 | continue; | 20232 | continue; |
| 20233 | w->cursor.vpos = -1; | ||
| 20227 | return make_number (PT); | 20234 | return make_number (PT); |
| 20228 | } | 20235 | } |
| 20229 | } | 20236 | } |