aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-14 21:10:37 +0300
committerEli Zaretskii2014-10-14 21:10:37 +0300
commite3060a0c4d2f418ac786775109d71e5843ccf42e (patch)
tree347b37fc39d0db9cd23b3e9f79ee81b4bbc40f08 /src/syntax.c
parent1a3eca0656bdb764200e10a4f264138e94b1f3ce (diff)
parent980d78b3587560c13a46aef352ed8d5ed744acf6 (diff)
downloademacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.tar.gz
emacs-e3060a0c4d2f418ac786775109d71e5843ccf42e.zip
Merge from trunk and resolve conflicts.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 4166ee211c7..9f5ef754e2a 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1231,7 +1231,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
1231 syntax_code = XINT (first) & INT_MAX; 1231 syntax_code = XINT (first) & INT_MAX;
1232 code = syntax_code & 0377; 1232 code = syntax_code & 0377;
1233 start1 = SYNTAX_FLAGS_COMSTART_FIRST (syntax_code); 1233 start1 = SYNTAX_FLAGS_COMSTART_FIRST (syntax_code);
1234 start2 = SYNTAX_FLAGS_COMSTART_SECOND (syntax_code);; 1234 start2 = SYNTAX_FLAGS_COMSTART_SECOND (syntax_code);
1235 end1 = SYNTAX_FLAGS_COMEND_FIRST (syntax_code); 1235 end1 = SYNTAX_FLAGS_COMEND_FIRST (syntax_code);
1236 end2 = SYNTAX_FLAGS_COMEND_SECOND (syntax_code); 1236 end2 = SYNTAX_FLAGS_COMEND_SECOND (syntax_code);
1237 prefix = SYNTAX_FLAGS_PREFIX (syntax_code); 1237 prefix = SYNTAX_FLAGS_PREFIX (syntax_code);
@@ -1567,6 +1567,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
1567 const unsigned char *str; 1567 const unsigned char *str;
1568 int len; 1568 int len;
1569 Lisp_Object iso_classes; 1569 Lisp_Object iso_classes;
1570 USE_SAFE_ALLOCA;
1570 1571
1571 CHECK_STRING (string); 1572 CHECK_STRING (string);
1572 iso_classes = Qnil; 1573 iso_classes = Qnil;
@@ -1699,7 +1700,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
1699 memcpy (himap, fastmap + 0200, 0200); 1700 memcpy (himap, fastmap + 0200, 0200);
1700 himap[0200] = 0; 1701 himap[0200] = 0;
1701 memset (fastmap + 0200, 0, 0200); 1702 memset (fastmap + 0200, 0, 0200);
1702 char_ranges = alloca (sizeof *char_ranges * 128 * 2); 1703 SAFE_NALLOCA (char_ranges, 2, 128);
1703 i = 0; 1704 i = 0;
1704 1705
1705 while ((p1 = memchr (himap + i, 1, 0200 - i))) 1706 while ((p1 = memchr (himap + i, 1, 0200 - i)))
@@ -1723,7 +1724,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
1723 } 1724 }
1724 else /* STRING is multibyte */ 1725 else /* STRING is multibyte */
1725 { 1726 {
1726 char_ranges = alloca (sizeof *char_ranges * SCHARS (string) * 2); 1727 SAFE_NALLOCA (char_ranges, 2, SCHARS (string));
1727 1728
1728 while (i_byte < size_byte) 1729 while (i_byte < size_byte)
1729 { 1730 {
@@ -2032,6 +2033,7 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
2032 SET_PT_BOTH (pos, pos_byte); 2033 SET_PT_BOTH (pos, pos_byte);
2033 immediate_quit = 0; 2034 immediate_quit = 0;
2034 2035
2036 SAFE_FREE ();
2035 return make_number (PT - start_point); 2037 return make_number (PT - start_point);
2036 } 2038 }
2037} 2039}
@@ -2857,10 +2859,13 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
2857 case Smath: 2859 case Smath:
2858 if (!sexpflag) 2860 if (!sexpflag)
2859 break; 2861 break;
2860 temp_pos = dec_bytepos (from_byte); 2862 if (from > BEGV)
2861 UPDATE_SYNTAX_TABLE_BACKWARD (from - 1); 2863 {
2862 if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos)) 2864 temp_pos = dec_bytepos (from_byte);
2863 DEC_BOTH (from, from_byte); 2865 UPDATE_SYNTAX_TABLE_BACKWARD (from - 1);
2866 if (from != stop && c == FETCH_CHAR_AS_MULTIBYTE (temp_pos))
2867 DEC_BOTH (from, from_byte);
2868 }
2864 if (mathexit) 2869 if (mathexit)
2865 { 2870 {
2866 mathexit = 0; 2871 mathexit = 0;