diff src/syntax.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
line wrap: on
line diff
--- a/src/syntax.c	Mon Aug 13 11:33:40 2007 +0200
+++ b/src/syntax.c	Mon Aug 13 11:35:02 2007 +0200
@@ -74,6 +74,9 @@
    and the like. */
 struct buffer *regex_emacs_buffer;
 
+/* Tell the regex routines whether buffer is used or not. */
+int regex_emacs_buffer_p;
+
 Lisp_Object Vstandard_syntax_table;
 
 Lisp_Object Vsyntax_designator_chars_string;
@@ -224,7 +227,7 @@
    into the code it signifies.
    This is used by modify-syntax-entry, and other things. */
 
-CONST unsigned char syntax_spec_code[0400] =
+const unsigned char syntax_spec_code[0400] =
 { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
@@ -246,7 +249,7 @@
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377
 };
 
-CONST unsigned char syntax_code_spec[] =  " .w_()'\"$\\/<>@";
+const unsigned char syntax_code_spec[] =  " .w_()'\"$\\/<>@";
 
 DEFUN ("syntax-designator-chars", Fsyntax_designator_chars, 0, 0, 0, /*
 Return a string of the recognized syntax designator chars.
@@ -295,14 +298,13 @@
 Lisp_Object
 syntax_match (Lisp_Object table, Emchar ch)
 {
-  Lisp_Object code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (table), ch);
+  Lisp_Object code = XCHAR_TABLE_VALUE_UNSAFE (table, ch);
   Lisp_Object code2 = code;
 
   if (CONSP (code))
     code2 = XCAR (code);
   if (SYNTAX_FROM_CODE (XINT (code2)) == Sinherit)
-    code = CHAR_TABLE_VALUE_UNSAFE (XCHAR_TABLE (Vstandard_syntax_table),
-				    ch);
+    code = XCHAR_TABLE_VALUE_UNSAFE (Vstandard_syntax_table, ch);
 
   return CONSP (code) ? XCDR (code) : Qnil;
 }
@@ -365,13 +367,12 @@
 	  ch0 = BUF_FETCH_CHAR (buf, from);
 	  code = SYNTAX_UNSAFE (mirrortab, ch0);
 
+	  from++;
 	  if (words_include_escapes
 	      && (code == Sescape || code == Scharquote))
 	    break;
 	  if (code == Sword)
 	    break;
-
-	  from++;
 	}
 
       QUIT;
@@ -407,13 +408,13 @@
 
 	  ch1 = BUF_FETCH_CHAR (buf, from - 1);
 	  code = SYNTAX_UNSAFE (mirrortab, ch1);
+
+	  from--;
 	  if (words_include_escapes
 	      && (code == Sescape || code == Scharquote))
 	    break;
 	  if (code == Sword)
 	    break;
-
-	  from--;
 	}
 
       QUIT;
@@ -1692,7 +1693,7 @@
 }
 
 static void
-define_standard_syntax (CONST char *p, enum syntaxcode syn)
+define_standard_syntax (const char *p, enum syntaxcode syn)
 {
   for (; *p; p++)
     Fput_char_table (make_char (*p), make_int (syn), Vstandard_syntax_table);
@@ -1702,7 +1703,7 @@
 complex_vars_of_syntax (void)
 {
   Emchar i;
-  CONST char *p;
+  const char *p;
   /* Set this now, so first buffer creation can refer to it. */
   /* Make it nil before calling copy-syntax-table
      so that copy-syntax-table will know not to try to copy from garbage */