changeset 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 1260416c7819
children 16822384f7ed
files src/syntax.c
diffstat 1 files changed, 40 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c	Mon Aug 19 10:59:04 2002 +0000
+++ b/src/syntax.c	Mon Aug 19 11:00:27 2002 +0000
@@ -1216,19 +1216,25 @@
 	  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 @@
 	  from_byte = CHAR_TO_BYTE (from);
 	}
       else
-	while (1)
-	  {
-	    int temp_byte;
+	{
+	  Lisp_Object script;
+
+	  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)))
-	      break;
-	    DEC_BOTH (from, from_byte);
-	    ch1 = ch0;
-	  }
+	      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++;
     }