Mercurial > emacs
comparison src/syntax.c @ 89010:0b75ae2e80b1
(scan_words): Don't treat characters belonging to
different scripts constituting a work.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 19 Aug 2002 11:00:27 +0000 |
parents | a65b3bd9379c |
children | 2054397a36be |
comparison
equal
deleted
inserted
replaced
89009:1260416c7819 | 89010:0b75ae2e80b1 |
---|---|
1214 pos = call2 (func, make_number (from - 1), make_number (end)); | 1214 pos = call2 (func, make_number (from - 1), make_number (end)); |
1215 from = XINT (pos); | 1215 from = XINT (pos); |
1216 from_byte = CHAR_TO_BYTE (from); | 1216 from_byte = CHAR_TO_BYTE (from); |
1217 } | 1217 } |
1218 else | 1218 else |
1219 while (1) | 1219 { |
1220 { | 1220 Lisp_Object script; |
1221 if (from == end) break; | 1221 |
1222 UPDATE_SYNTAX_TABLE_FORWARD (from); | 1222 script = CHAR_TABLE_REF (Vchar_script_table, ch0); |
1223 ch1 = FETCH_CHAR (from_byte); | 1223 while (1) |
1224 code = SYNTAX (ch1); | 1224 { |
1225 if (code != Sword | 1225 if (from == end) break; |
1226 && (! words_include_escapes | 1226 UPDATE_SYNTAX_TABLE_FORWARD (from); |
1227 || (code != Sescape && code != Scharquote))) | 1227 ch1 = FETCH_CHAR (from_byte); |
1228 code = SYNTAX (ch1); | |
1229 if ((code != Sword | |
1230 && (! words_include_escapes | |
1231 || (code != Sescape && code != Scharquote))) | |
1232 || ! EQ (CHAR_TABLE_REF (Vchar_script_table, ch1), script)) | |
1228 break; | 1233 break; |
1229 INC_BOTH (from, from_byte); | 1234 INC_BOTH (from, from_byte); |
1230 ch0 = ch1; | 1235 ch0 = ch1; |
1231 } | 1236 } |
1237 } | |
1232 | 1238 |
1233 count--; | 1239 count--; |
1234 } | 1240 } |
1235 while (count < 0) | 1241 while (count < 0) |
1236 { | 1242 { |
1263 pos = call2 (func, make_number (from), make_number (beg)); | 1269 pos = call2 (func, make_number (from), make_number (beg)); |
1264 from = XINT (pos); | 1270 from = XINT (pos); |
1265 from_byte = CHAR_TO_BYTE (from); | 1271 from_byte = CHAR_TO_BYTE (from); |
1266 } | 1272 } |
1267 else | 1273 else |
1268 while (1) | 1274 { |
1269 { | 1275 Lisp_Object script; |
1270 int temp_byte; | 1276 |
1271 | 1277 script = CHAR_TABLE_REF (Vchar_script_table, ch1); |
1272 if (from == beg) | 1278 while (1) |
1273 break; | 1279 { |
1274 temp_byte = dec_bytepos (from_byte); | 1280 int temp_byte; |
1275 UPDATE_SYNTAX_TABLE_BACKWARD (from); | 1281 |
1276 ch0 = FETCH_CHAR (temp_byte); | 1282 if (from == beg) |
1277 code = SYNTAX (ch0); | 1283 break; |
1278 if (code != Sword | 1284 temp_byte = dec_bytepos (from_byte); |
1279 && (! words_include_escapes | 1285 UPDATE_SYNTAX_TABLE_BACKWARD (from); |
1280 || (code != Sescape && code != Scharquote))) | 1286 ch0 = FETCH_CHAR (temp_byte); |
1281 break; | 1287 code = SYNTAX (ch0); |
1282 DEC_BOTH (from, from_byte); | 1288 if ((code != Sword |
1283 ch1 = ch0; | 1289 && (! words_include_escapes |
1284 } | 1290 || (code != Sescape && code != Scharquote))) |
1291 || ! EQ (CHAR_TABLE_REF (Vchar_script_table, ch0), script)) | |
1292 break; | |
1293 DEC_BOTH (from, from_byte); | |
1294 ch1 = ch0; | |
1295 } | |
1296 } | |
1285 count++; | 1297 count++; |
1286 } | 1298 } |
1287 | 1299 |
1288 immediate_quit = 0; | 1300 immediate_quit = 0; |
1289 | 1301 |