aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/composite.c b/src/composite.c
index 0b0602bf283..bc5644a4612 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1115,7 +1115,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
1115 if (! NILP (val)) 1115 if (! NILP (val))
1116 { 1116 {
1117 Lisp_Object elt; 1117 Lisp_Object elt;
1118 int ridx, back, len; 1118 int ridx, back, blen;
1119 1119
1120 for (ridx = 0; CONSP (val); val = XCDR (val), ridx++) 1120 for (ridx = 0; CONSP (val); val = XCDR (val), ridx++)
1121 { 1121 {
@@ -1132,17 +1132,17 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
1132 bpos = (NILP (string) ? CHAR_TO_BYTE (cpos) 1132 bpos = (NILP (string) ? CHAR_TO_BYTE (cpos)
1133 : string_char_to_byte (string, cpos)); 1133 : string_char_to_byte (string, cpos));
1134 if (STRINGP (AREF (elt, 0))) 1134 if (STRINGP (AREF (elt, 0)))
1135 len = fast_looking_at (AREF (elt, 0), cpos, bpos, 1135 blen = fast_looking_at (AREF (elt, 0), cpos, bpos,
1136 start + 1, limit, string); 1136 start + 1, limit, string);
1137 else 1137 else
1138 len = 1; 1138 blen = 1;
1139 if (len > 0) 1139 if (blen > 0)
1140 { 1140 {
1141 /* Make CPOS point to the last character of 1141 /* Make CPOS point to the last character of
1142 match. Note that LEN is byte-length. */ 1142 match. Note that BLEN is byte-length. */
1143 if (len > 1) 1143 if (blen > 1)
1144 { 1144 {
1145 bpos += len; 1145 bpos += blen;
1146 if (NILP (string)) 1146 if (NILP (string))
1147 cpos = BYTE_TO_CHAR (bpos) - 1; 1147 cpos = BYTE_TO_CHAR (bpos) - 1;
1148 else 1148 else
@@ -1248,8 +1248,8 @@ composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I
1248 else if (w) 1248 else if (w)
1249 { 1249 {
1250 Lisp_Object lgstring = Qnil; 1250 Lisp_Object lgstring = Qnil;
1251 Lisp_Object val, elt, re; 1251 Lisp_Object val, elt;
1252 int len, i; 1252 int i;
1253 1253
1254 val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch); 1254 val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
1255 for (i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val)); 1255 for (i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val));
@@ -1364,7 +1364,7 @@ composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I
1364int 1364int
1365composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, Lisp_Object string) 1365composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, Lisp_Object string)
1366{ 1366{
1367 int i, c; 1367 int i, c IF_LINT (= 0);
1368 1368
1369 if (cmp_it->ch < 0) 1369 if (cmp_it->ch < 0)
1370 { 1370 {
@@ -1489,9 +1489,14 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
1489 EMACS_INT head, tail, stop; 1489 EMACS_INT head, tail, stop;
1490 /* Limit to check a composition after POS. */ 1490 /* Limit to check a composition after POS. */
1491 EMACS_INT fore_check_limit; 1491 EMACS_INT fore_check_limit;
1492 struct position_record orig, cur, check, prev; 1492 struct position_record orig, cur;
1493
1494 /* FIXME: It's not obvious whether these two variables need initialization.
1495 If they do, please supply initial values.
1496 If not, please remove this comment. */
1497 struct position_record check IF_LINT (= {0}), prev IF_LINT (= {0});
1498
1493 Lisp_Object check_val, val, elt; 1499 Lisp_Object check_val, val, elt;
1494 int check_lookback;
1495 int c; 1500 int c;
1496 Lisp_Object window; 1501 Lisp_Object window;
1497 struct window *w; 1502 struct window *w;
@@ -1657,7 +1662,7 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
1657EMACS_INT 1662EMACS_INT
1658composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) 1663composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
1659{ 1664{
1660 EMACS_INT charpos, bytepos, startpos, beg, end, pos; 1665 EMACS_INT beg, end;
1661 Lisp_Object val; 1666 Lisp_Object val;
1662 int i; 1667 int i;
1663 1668
@@ -2032,4 +2037,3 @@ See also the documentation of `auto-composition-mode'. */);
2032 defsubr (&Sfind_composition_internal); 2037 defsubr (&Sfind_composition_internal);
2033 defsubr (&Scomposition_get_gstring); 2038 defsubr (&Scomposition_get_gstring);
2034} 2039}
2035