From 8cb8232a21ae09cec807c3ccf0a58def3414a595 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 19 Aug 2002 11:00:39 +0000 Subject: [PATCH] (scan_words): Don't treat characters belonging to different scripts constituting a work. --- src/ChangeLog | 5 ++++ src/syntax.c | 68 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b83271963a3..0e66f15a572 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-08-19 Kenichi Handa + * 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. diff --git a/src/syntax.c b/src/syntax.c index ba86b91fc03..716b3be6f6c 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1216,19 +1216,25 @@ scan_words (from, count) 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--; } @@ -1265,23 +1271,29 @@ scan_words (from, 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++; } -- 2.39.2