aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-05-14 16:44:12 +0300
committerEli Zaretskii2010-05-14 16:44:12 +0300
commitd07f018c06e9666996af5813567ccf9540295c7b (patch)
tree26e5650e82e620bdada7097f238643c030de94c5 /src
parentc38762fdfb8d81e87f061abe528141f374300b92 (diff)
downloademacs-d07f018c06e9666996af5813567ccf9540295c7b.tar.gz
emacs-d07f018c06e9666996af5813567ccf9540295c7b.zip
Fix comments from 2010-05-14T04:14:23Z!handa@etlken.
Diffstat (limited to 'src')
-rw-r--r--src/composite.c10
-rw-r--r--src/xdisp.c29
2 files changed, 12 insertions, 27 deletions
diff --git a/src/composite.c b/src/composite.c
index cbfb4aa66d3..f392053bac9 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1150,13 +1150,13 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
1150 /* Search backward for a pattern that may be composed and the 1150 /* Search backward for a pattern that may be composed and the
1151 position of (possibly) the last character of the match is 1151 position of (possibly) the last character of the match is
1152 closest to (but not after) START. The reason for the last 1152 closest to (but not after) START. The reason for the last
1153 character is that set_iterator_to_next works in reverse order 1153 character is that set_iterator_to_next works in reverse order,
1154 and, thus we must stop at the last character for composition 1154 and thus we must stop at the last character for composition
1155 check. */ 1155 check. */
1156 unsigned char *p; 1156 unsigned char *p;
1157 int len; 1157 int len;
1158 /* limit byte position used in fast_looking_at. This is the 1158 /* Limit byte position used in fast_looking_at. This is the
1159 byte position of the next character of START. */ 1159 byte position of the character after START. */
1160 EMACS_INT limit; 1160 EMACS_INT limit;
1161 1161
1162 if (NILP (string)) 1162 if (NILP (string))
@@ -1191,7 +1191,7 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
1191 len = 1; 1191 len = 1;
1192 if (len > 0) 1192 if (len > 0)
1193 { 1193 {
1194 /* Make CPOS points the last character of match. 1194 /* Make CPOS point to the last character of match.
1195 Note that LEN is byte-length. */ 1195 Note that LEN is byte-length. */
1196 bpos += len; 1196 bpos += len;
1197 if (NILP (string)) 1197 if (NILP (string))
diff --git a/src/xdisp.c b/src/xdisp.c
index 16936b977fd..6375e03218a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6307,29 +6307,14 @@ set_iterator_to_next (it, reseat_p)
6307 else if (! it->cmp_it.reversed_p) 6307 else if (! it->cmp_it.reversed_p)
6308 { 6308 {
6309 /* Composition created while scanning forward. */ 6309 /* Composition created while scanning forward. */
6310 /* Update IT's char/byte positions to point the first 6310 /* Update IT's char/byte positions to point to the first
6311 character of the next grapheme cluster, or to the 6311 character of the next grapheme cluster, or to the
6312 character visually after the current composition. */ 6312 character visually after the current composition. */
6313#if 0
6314 /* Is it ok to do this directly? */
6315 IT_CHARPOS (*it) += it->cmp_it.nchars;
6316 IT_BYTEPOS (*it) += it->cmp_it.nbytes;
6317#else
6318 /* Or do we have to call bidi_get_next_char_visually
6319 repeatedly (perhaps not to confuse some internal
6320 state of bidi_it)? At least we must do this if we
6321 have consumed all grapheme clusters in the current
6322 composition because the next character will be in the
6323 different bidi level. */
6324 for (i = 0; i < it->cmp_it.nchars; i++) 6313 for (i = 0; i < it->cmp_it.nchars; i++)
6325 bidi_get_next_char_visually (&it->bidi_it); 6314 bidi_get_next_char_visually (&it->bidi_it);
6326 /* BTW, it seems that the name
6327 bidi_get_next_char_visually is confusing because
6328 it sounds like not advancing character position.
6329 How about bidi_set_iterator_to_next? */
6330 IT_BYTEPOS (*it) = it->bidi_it.bytepos; 6315 IT_BYTEPOS (*it) = it->bidi_it.bytepos;
6331 IT_CHARPOS (*it) = it->bidi_it.charpos; 6316 IT_CHARPOS (*it) = it->bidi_it.charpos;
6332#endif 6317
6333 if (it->cmp_it.to < it->cmp_it.nglyphs) 6318 if (it->cmp_it.to < it->cmp_it.nglyphs)
6334 { 6319 {
6335 /* Proceed to the next grapheme cluster. */ 6320 /* Proceed to the next grapheme cluster. */
@@ -6337,7 +6322,7 @@ set_iterator_to_next (it, reseat_p)
6337 } 6322 }
6338 else 6323 else
6339 { 6324 {
6340 /* No more grapheme cluster in this composition. 6325 /* No more grapheme clusters in this composition.
6341 Find the next stop position. */ 6326 Find the next stop position. */
6342 EMACS_INT stop = it->stop_charpos; 6327 EMACS_INT stop = it->stop_charpos;
6343 if (it->bidi_it.scan_dir < 0) 6328 if (it->bidi_it.scan_dir < 0)
@@ -6351,7 +6336,7 @@ set_iterator_to_next (it, reseat_p)
6351 else 6336 else
6352 { 6337 {
6353 /* Composition created while scanning backward. */ 6338 /* Composition created while scanning backward. */
6354 /* Update IT's char/byte positions to point the last 6339 /* Update IT's char/byte positions to point to the last
6355 character of the previous grapheme cluster, or the 6340 character of the previous grapheme cluster, or the
6356 character visually after the current composition. */ 6341 character visually after the current composition. */
6357 bidi_get_next_char_visually (&it->bidi_it); 6342 bidi_get_next_char_visually (&it->bidi_it);
@@ -6365,7 +6350,7 @@ set_iterator_to_next (it, reseat_p)
6365 } 6350 }
6366 else 6351 else
6367 { 6352 {
6368 /* No more grapheme cluster in this composition. 6353 /* No more grapheme clusters in this composition.
6369 Find the next stop position. */ 6354 Find the next stop position. */
6370 EMACS_INT stop = it->stop_charpos; 6355 EMACS_INT stop = it->stop_charpos;
6371 if (it->bidi_it.scan_dir < 0) 6356 if (it->bidi_it.scan_dir < 0)
@@ -6398,8 +6383,8 @@ set_iterator_to_next (it, reseat_p)
6398 IT_CHARPOS (*it) = it->bidi_it.charpos; 6383 IT_CHARPOS (*it) = it->bidi_it.charpos;
6399 if (prev_scan_dir != it->bidi_it.scan_dir) 6384 if (prev_scan_dir != it->bidi_it.scan_dir)
6400 { 6385 {
6401 /* As scan direction was changed, we must re-compute 6386 /* As the scan direction was changed, we must
6402 the stop position for composition. */ 6387 re-compute the stop position for composition. */
6403 EMACS_INT stop = it->stop_charpos; 6388 EMACS_INT stop = it->stop_charpos;
6404 if (it->bidi_it.scan_dir < 0) 6389 if (it->bidi_it.scan_dir < 0)
6405 stop = -1; 6390 stop = -1;