2002-08-19 Kenichi Handa <handa@etl.go.jp>
+ * syntax.c (scan_words): Don't treat characters belonging to
+ different scripts constituting a work.
+
+ * editfns.c (Fformat): Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.
+
* fontset.c (Fset_fontset_font): Treate `ascii' as charset, not
script.
from_byte = CHAR_TO_BYTE (from);
}
else
- while (1)
- {
- if (from == end) break;
- UPDATE_SYNTAX_TABLE_FORWARD (from);
- ch1 = FETCH_CHAR (from_byte);
- code = SYNTAX (ch1);
- if (code != Sword
- && (! words_include_escapes
- || (code != Sescape && code != Scharquote)))
+ {
+ Lisp_Object script;
+
+ script = CHAR_TABLE_REF (Vchar_script_table, ch0);
+ while (1)
+ {
+ if (from == end) break;
+ UPDATE_SYNTAX_TABLE_FORWARD (from);
+ ch1 = FETCH_CHAR (from_byte);
+ code = SYNTAX (ch1);
+ if ((code != Sword
+ && (! words_include_escapes
+ || (code != Sescape && code != Scharquote)))
+ || ! EQ (CHAR_TABLE_REF (Vchar_script_table, ch1), script))
break;
- INC_BOTH (from, from_byte);
- ch0 = ch1;
- }
+ INC_BOTH (from, from_byte);
+ ch0 = ch1;
+ }
+ }
count--;
}
from_byte = CHAR_TO_BYTE (from);
}
else
- while (1)
- {
- int temp_byte;
+ {
+ Lisp_Object script;
- if (from == beg)
- break;
- temp_byte = dec_bytepos (from_byte);
- UPDATE_SYNTAX_TABLE_BACKWARD (from);
- ch0 = FETCH_CHAR (temp_byte);
- code = SYNTAX (ch0);
- if (code != Sword
- && (! words_include_escapes
- || (code != Sescape && code != Scharquote)))
- break;
- DEC_BOTH (from, from_byte);
- ch1 = ch0;
- }
+ script = CHAR_TABLE_REF (Vchar_script_table, ch1);
+ while (1)
+ {
+ int temp_byte;
+
+ if (from == beg)
+ break;
+ temp_byte = dec_bytepos (from_byte);
+ UPDATE_SYNTAX_TABLE_BACKWARD (from);
+ ch0 = FETCH_CHAR (temp_byte);
+ code = SYNTAX (ch0);
+ if ((code != Sword
+ && (! words_include_escapes
+ || (code != Sescape && code != Scharquote)))
+ || ! EQ (CHAR_TABLE_REF (Vchar_script_table, ch0), script))
+ break;
+ DEC_BOTH (from, from_byte);
+ ch1 = ch0;
+ }
+ }
count++;
}