1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00

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.
This commit is contained in:
Eli Zaretskii 2013-06-30 17:49:33 +03:00
parent 0865d506b5
commit 0ba54312c9
4 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,9 @@
2013-06-30 Eli Zaretskii <eliz@gnu.org>
* bindings.el (right-char, left-char): Don't call sit-for, this is
no longer needed. Use arithmetic comparison only for numerical
arguments.
* international/mule-cmds.el (select-safe-coding-system): Handle
the case of FROM being a string correctly. (Bug#14755)

View File

@ -725,8 +725,7 @@ see."
(interactive "^p")
(if visual-order-cursor-movement
(dotimes (i (if (numberp n) (abs n) 1))
(move-point-visually (if (< n 0) -1 1))
(sit-for 0))
(move-point-visually (if (and (numberp n) (< n 0)) -1 1)))
(if (eq (current-bidi-paragraph-direction) 'left-to-right)
(forward-char n)
(backward-char n))))
@ -744,8 +743,7 @@ see."
(interactive "^p")
(if visual-order-cursor-movement
(dotimes (i (if (numberp n) (abs n) 1))
(move-point-visually (if (< n 0) 1 -1))
(sit-for 0))
(move-point-visually (if (and (numberp n) (< n 0)) 1 -1)))
(if (eq (current-bidi-paragraph-direction) 'left-to-right)
(backward-char n)
(forward-char n))))

View File

@ -1,3 +1,10 @@
2013-06-30 Eli Zaretskii <eliz@gnu.org>
* 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.
2013-06-29 Paul Eggert <eggert@cs.ucla.edu>
Fix minor problems found by static checking.

View File

@ -20107,6 +20107,7 @@ Value is the new character position of point. */)
if (BUFFERP (g->object) && g->charpos != PT)
{
SET_PT (g->charpos);
w->cursor.vpos = -1;
return make_number (PT);
}
else if (!INTEGERP (g->object) && g->object != gpt->object)
@ -20126,6 +20127,7 @@ Value is the new character position of point. */)
else
break;
SET_PT (new_pos);
w->cursor.vpos = -1;
return make_number (PT);
}
else if (ROW_GLYPH_NEWLINE_P (row, g))
@ -20141,6 +20143,7 @@ Value is the new character position of point. */)
SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1);
else
break;
w->cursor.vpos = -1;
return make_number (PT);
}
}
@ -20161,6 +20164,7 @@ Value is the new character position of point. */)
if (row->reversed_p && !row->continued_p)
{
SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1);
w->cursor.vpos = -1;
return make_number (PT);
}
g = row->glyphs[TEXT_AREA];
@ -20188,6 +20192,7 @@ Value is the new character position of point. */)
SET_PT (ZV);
else
continue;
w->cursor.vpos = -1;
return make_number (PT);
}
}
@ -20197,6 +20202,7 @@ Value is the new character position of point. */)
if (!row->reversed_p && !row->continued_p)
{
SET_PT (MATRIX_ROW_END_CHARPOS (row) - 1);
w->cursor.vpos = -1;
return make_number (PT);
}
e = row->glyphs[TEXT_AREA];
@ -20224,6 +20230,7 @@ Value is the new character position of point. */)
SET_PT (ZV);
else
continue;
w->cursor.vpos = -1;
return make_number (PT);
}
}