]> code.delx.au - gnu-emacs/blobdiff - src/syntax.c
Merge from origin/emacs-25
[gnu-emacs] / src / syntax.c
index fc8c666cec4c227df6dd569d154c586178a59272..587335acef8f4e8e1258dd0c4964f432e3c1f559 100644 (file)
@@ -708,7 +708,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
   ptrdiff_t comment_end = from;
   ptrdiff_t comment_end_byte = from_byte;
   ptrdiff_t comstart_pos = 0;
-  ptrdiff_t comstart_byte IF_LINT (= 0);
+  ptrdiff_t comstart_byte;
   /* Place where the containing defun starts,
      or 0 if we didn't come across it yet.  */
   ptrdiff_t defun_start = 0;
@@ -1633,7 +1633,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
   int c;
   char fastmap[0400];
   /* Store the ranges of non-ASCII characters.  */
-  int *char_ranges IF_LINT (= NULL);
+  int *char_ranges UNINIT;
   int n_char_ranges = 0;
   bool negate = 0;
   ptrdiff_t i, i_byte;
@@ -2182,63 +2182,51 @@ skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim)
     ptrdiff_t start_point = PT;
     ptrdiff_t pos = PT;
     ptrdiff_t pos_byte = PT_BYTE;
-    unsigned char *p = PT_ADDR, *endp, *stop;
-
-    if (forwardp)
-      {
-       endp = (XINT (lim) == GPT) ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim));
-       stop = (pos < GPT && GPT < XINT (lim)) ? GPT_ADDR : endp;
-      }
-    else
-      {
-       endp = CHAR_POS_ADDR (XINT (lim));
-       stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp;
-      }
+    unsigned char *p, *endp, *stop;
 
     immediate_quit = 1;
     SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1);
+
     if (forwardp)
       {
-       if (multibyte)
+       while (true)
          {
-           while (1)
+           p = BYTE_POS_ADDR (pos_byte);
+           endp = XINT (lim) == GPT ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim));
+           stop = pos < GPT && GPT < XINT (lim) ? GPT_ADDR : endp;
+
+           do
              {
                int nbytes;
 
                if (p >= stop)
                  {
                    if (p >= endp)
-                     break;
+                     goto done;
                    p = GAP_END_ADDR;
                    stop = endp;
                  }
-               c = STRING_CHAR_AND_LENGTH (p, nbytes);
+               if (multibyte)
+                 c = STRING_CHAR_AND_LENGTH (p, nbytes);
+               else
+                 c = *p, nbytes = 1;
                if (! fastmap[SYNTAX (c)])
-                 break;
+                 goto done;
                p += nbytes, pos++, pos_byte += nbytes;
-               UPDATE_SYNTAX_TABLE_FORWARD (pos);
-             }
-         }
-       else
-         {
-           while (1)
-             {
-               if (p >= stop)
-                 {
-                   if (p >= endp)
-                     break;
-                   p = GAP_END_ADDR;
-                   stop = endp;
-                 }
-               if (! fastmap[SYNTAX (*p)])
-                 break;
-               p++, pos++, pos_byte++;
-               UPDATE_SYNTAX_TABLE_FORWARD (pos);
              }
+           while (!parse_sexp_lookup_properties
+                  || pos < gl_state.e_property);
+
+           update_syntax_table_forward (pos + gl_state.offset,
+                                        false, gl_state.object);
          }
       }
     else
       {
+       p = BYTE_POS_ADDR (pos_byte);
+       endp = CHAR_POS_ADDR (XINT (lim));
+       stop = pos >= GPT && GPT > XINT (lim) ? GAP_END_ADDR : endp;
+
        if (multibyte)
          {
            while (1)
@@ -2280,6 +2268,7 @@ skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim)
          }
       }
 
+  done:
     SET_PT_BOTH (pos, pos_byte);
     immediate_quit = 0;
 
@@ -3109,7 +3098,7 @@ but before count is used up, nil is returned.  */)
 DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars,
        0, 0, 0,
        doc: /* Move point backward over any number of chars with prefix syntax.
-This includes chars with expression prefix syntax class (') and those with
+This includes chars with expression prefix syntax class (\\=') and those with
 the prefix syntax flag (p).  */)
   (void)
 {
@@ -3782,7 +3771,7 @@ In both cases, LIMIT bounds the search. */);
   Vfind_word_boundary_function_table = Fmake_char_table (Qnil, Qnil);
 
   DEFVAR_BOOL ("comment-end-can-be-escaped", Vcomment_end_can_be_escaped,
-               doc: /* Non-nil means an escaped ender inside a comment doesn'tend the comment.  */);
+               doc: /* Non-nil means an escaped ender inside a comment doesn't end the comment.  */);
   Vcomment_end_can_be_escaped = 0;
   DEFSYM (Qcomment_end_can_be_escaped, "comment-end-can-be-escaped");
   Fmake_variable_buffer_local (Qcomment_end_can_be_escaped);