aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2004-04-08 11:39:14 +0000
committerKenichi Handa2004-04-08 11:39:14 +0000
commit839966f33341183feaa61d5d644de7e750db76e7 (patch)
treebdc2779743052a1001d5400e088ee74d8e5a710c /src
parentcc1ba238bdce8bb352ce077f510017cb61cb1e07 (diff)
downloademacs-839966f33341183feaa61d5d644de7e750db76e7.tar.gz
emacs-839966f33341183feaa61d5d644de7e750db76e7.zip
Sync to HEAD.
Diffstat (limited to 'src')
-rw-r--r--src/category.c25
-rw-r--r--src/category.h3
-rw-r--r--src/regex.c24
-rw-r--r--src/regex.h3
-rw-r--r--src/syntax.c41
-rw-r--r--src/syntax.h3
6 files changed, 63 insertions, 36 deletions
diff --git a/src/category.c b/src/category.c
index 89e4d907378..3c49858bc68 100644
--- a/src/category.c
+++ b/src/category.c
@@ -91,11 +91,11 @@ those categories. */)
91Lisp_Object check_category_table (); 91Lisp_Object check_category_table ();
92 92
93DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0, 93DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0,
94 doc: /* Define CHAR as a category which is described by DOCSTRING. 94 doc: /* Define CATEGORY as a category which is described by DOCSTRING.
95CHAR should be an ASCII printing character in the range ` ' to `~'. 95CATEGORY should be an ASCII printing character in the range ` ' to `~'.
96DOCSTRING is a documentation string of the category. 96DOCSTRING is the documentation string of the category.
97The category is defined only in category table TABLE, which defaults to 97The category is defined only in category table TABLE, which defaults to
98 the current buffer's category table. */) 98the current buffer's category table. */)
99 (category, docstring, table) 99 (category, docstring, table)
100 Lisp_Object category, docstring, table; 100 Lisp_Object category, docstring, table;
101{ 101{
@@ -111,7 +111,9 @@ The category is defined only in category table TABLE, which defaults to
111} 111}
112 112
113DEFUN ("category-docstring", Fcategory_docstring, Scategory_docstring, 1, 2, 0, 113DEFUN ("category-docstring", Fcategory_docstring, Scategory_docstring, 1, 2, 0,
114 doc: /* Return the documentation string of CATEGORY, as defined in CATEGORY-TABLE. */) 114 doc: /* Return the documentation string of CATEGORY, as defined in TABLE.
115TABLE should be a category table and defaults to the current buffer's
116category table. */)
115 (category, table) 117 (category, table)
116 Lisp_Object category, table; 118 Lisp_Object category, table;
117{ 119{
@@ -123,10 +125,9 @@ DEFUN ("category-docstring", Fcategory_docstring, Scategory_docstring, 1, 2, 0,
123 125
124DEFUN ("get-unused-category", Fget_unused_category, Sget_unused_category, 126DEFUN ("get-unused-category", Fget_unused_category, Sget_unused_category,
125 0, 1, 0, 127 0, 1, 0,
126 doc: /* Return a category which is not yet defined in CATEGORY-TABLE. 128 doc: /* Return a category which is not yet defined in TABLE.
127If no category remains available, return nil. 129If no category remains available, return nil.
128The optional argument CATEGORY-TABLE 130The optional argument TABLE specifies which category table to modify;
129specifies which category table to modify;
130it defaults to the current buffer's category table. */) 131it defaults to the current buffer's category table. */)
131 (table) 132 (table)
132 Lisp_Object table; 133 Lisp_Object table;
@@ -256,7 +257,8 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
256} 257}
257 258
258DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0, 259DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0,
259 doc: /* Specify TABLE as the category table for the current buffer. */) 260 doc: /* Specify TABLE as the category table for the current buffer.
261Return TABLE. */)
260 (table) 262 (table)
261 Lisp_Object table; 263 Lisp_Object table;
262{ 264{
@@ -290,7 +292,7 @@ DEFUN ("category-set-mnemonics", Fcategory_set_mnemonics,
290 Scategory_set_mnemonics, 1, 1, 0, 292 Scategory_set_mnemonics, 1, 1, 0,
291 doc: /* Return a string containing mnemonics of the categories in CATEGORY-SET. 293 doc: /* Return a string containing mnemonics of the categories in CATEGORY-SET.
292CATEGORY-SET is a bool-vector, and the categories \"in\" it are those 294CATEGORY-SET is a bool-vector, and the categories \"in\" it are those
293that are indexes where t occurs the bool-vector. 295that are indexes where t occurs in the bool-vector.
294The return value is a string containing those same categories. */) 296The return value is a string containing those same categories. */)
295 (category_set) 297 (category_set)
296 Lisp_Object category_set; 298 Lisp_Object category_set;
@@ -519,3 +521,6 @@ See the documentation of the variable `word-combining-categories'. */);
519 521
520 category_table_version = 0; 522 category_table_version = 0;
521} 523}
524
525/* arch-tag: 74ebf524-121b-4d9c-bd68-07f8d708b211
526 (do not change this comment) */
diff --git a/src/category.h b/src/category.h
index f2335664acf..adad3d713f8 100644
--- a/src/category.h
+++ b/src/category.h
@@ -118,3 +118,6 @@ extern Lisp_Object _temp_category_set;
118 && word_boundary_p (c1, c2)) 118 && word_boundary_p (c1, c2))
119 119
120extern int word_boundary_p P_ ((int, int)); 120extern int word_boundary_p P_ ((int, int));
121
122/* arch-tag: 309dfe83-c3e2-4d22-8e81-faae5aece0ff
123 (do not change this comment) */
diff --git a/src/regex.c b/src/regex.c
index 453ca3d85d5..e1479e64c9f 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1000,9 +1000,10 @@ print_partial_compiled_pattern (start, end)
1000 int has_range_table = CHARSET_RANGE_TABLE_EXISTS_P (p - 1); 1000 int has_range_table = CHARSET_RANGE_TABLE_EXISTS_P (p - 1);
1001 1001
1002 fprintf (stderr, "/charset [%s", 1002 fprintf (stderr, "/charset [%s",
1003 (re_opcode_t) *(p - 1) == charset_not ? "^" : ""); 1003 (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
1004 1004
1005 assert (p + *p < pend); 1005 if (p + *p >= pend)
1006 fprintf (stderr, " !extends past end of pattern! ");
1006 1007
1007 for (c = 0; c < 256; c++) 1008 for (c = 0; c < 256; c++)
1008 if (c / 8 < length 1009 if (c / 8 < length
@@ -1761,8 +1762,11 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
1761 1762
1762 1763
1763/* This is not an arbitrary limit: the arguments which represent offsets 1764/* This is not an arbitrary limit: the arguments which represent offsets
1764 into the pattern are two bytes long. So if 2^16 bytes turns out to 1765 into the pattern are two bytes long. So if 2^15 bytes turns out to
1765 be too small, many things would have to change. */ 1766 be too small, many things would have to change. */
1767# define MAX_BUF_SIZE (1L << 15)
1768
1769#if 0 /* This is when we thought it could be 2^16 bytes. */
1766/* Any other compiler which, like MSC, has allocation limit below 2^16 1770/* Any other compiler which, like MSC, has allocation limit below 2^16
1767 bytes will have to use approach similar to what was done below for 1771 bytes will have to use approach similar to what was done below for
1768 MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up 1772 MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
@@ -1774,6 +1778,7 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
1774#else 1778#else
1775# define MAX_BUF_SIZE (1L << 16) 1779# define MAX_BUF_SIZE (1L << 16)
1776#endif 1780#endif
1781#endif /* 0 */
1777 1782
1778/* Extend the buffer by twice its current size via realloc and 1783/* Extend the buffer by twice its current size via realloc and
1779 reset the pointers that pointed into the old block to point to the 1784 reset the pointers that pointed into the old block to point to the
@@ -3588,8 +3593,6 @@ regex_compile (pattern, size, syntax, bufp)
3588 if (syntax & RE_NO_POSIX_BACKTRACKING) 3593 if (syntax & RE_NO_POSIX_BACKTRACKING)
3589 BUF_PUSH (succeed); 3594 BUF_PUSH (succeed);
3590 3595
3591 free (compile_stack.stack);
3592
3593 /* We have succeeded; set the length of the buffer. */ 3596 /* We have succeeded; set the length of the buffer. */
3594 bufp->used = b - bufp->buffer; 3597 bufp->used = b - bufp->buffer;
3595 3598
@@ -3634,7 +3637,7 @@ regex_compile (pattern, size, syntax, bufp)
3634 } 3637 }
3635#endif /* not MATCH_MAY_ALLOCATE */ 3638#endif /* not MATCH_MAY_ALLOCATE */
3636 3639
3637 return REG_NOERROR; 3640 FREE_STACK_RETURN (REG_NOERROR);
3638} /* regex_compile */ 3641} /* regex_compile */
3639 3642
3640/* Subroutines for `regex_compile'. */ 3643/* Subroutines for `regex_compile'. */
@@ -4571,9 +4574,9 @@ skip_one_char (p)
4571 4574
4572 4575
4573/* Jump over non-matching operations. */ 4576/* Jump over non-matching operations. */
4574static unsigned char * 4577static re_char *
4575skip_noops (p, pend) 4578skip_noops (p, pend)
4576 unsigned char *p, *pend; 4579 re_char *p, *pend;
4577{ 4580{
4578 int mcnt; 4581 int mcnt;
4579 while (p < pend) 4582 while (p < pend)
@@ -4602,7 +4605,7 @@ skip_noops (p, pend)
4602static int 4605static int
4603mutually_exclusive_p (bufp, p1, p2) 4606mutually_exclusive_p (bufp, p1, p2)
4604 struct re_pattern_buffer *bufp; 4607 struct re_pattern_buffer *bufp;
4605 unsigned char *p1, *p2; 4608 re_char *p1, *p2;
4606{ 4609{
4607 re_opcode_t op2; 4610 re_opcode_t op2;
4608 const boolean multibyte = RE_MULTIBYTE_P (bufp); 4611 const boolean multibyte = RE_MULTIBYTE_P (bufp);
@@ -6474,3 +6477,6 @@ regfree (preg)
6474WEAK_ALIAS (__regfree, regfree) 6477WEAK_ALIAS (__regfree, regfree)
6475 6478
6476#endif /* not emacs */ 6479#endif /* not emacs */
6480
6481/* arch-tag: 4ffd68ba-2a9e-435b-a21a-018990f9eeb2
6482 (do not change this comment) */
diff --git a/src/regex.h b/src/regex.h
index b23c8855eff..be7634bb8de 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -577,3 +577,6 @@ version-control: t
577trim-versions-without-asking: nil 577trim-versions-without-asking: nil
578End: 578End:
579*/ 579*/
580
581/* arch-tag: bda6e3ec-3c02-4237-a55a-01ad2e120083
582 (do not change this comment) */
diff --git a/src/syntax.c b/src/syntax.c
index 57c7e4d69f2..680a4bcaf87 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,5 +1,5 @@
1/* GNU Emacs routines to deal with syntax tables; also word and list parsing. 1/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
2 Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999, 2004 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -1302,21 +1302,25 @@ scan_words (from, count)
1302 return from; 1302 return from;
1303} 1303}
1304 1304
1305DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p", 1305DEFUN ("forward-word", Fforward_word, Sforward_word, 0, 1, "p",
1306 doc: /* Move point forward ARG words (backward if ARG is negative). 1306 doc: /* Move point forward ARG words (backward if ARG is negative).
1307Normally returns t. 1307Normally returns t.
1308If an edge of the buffer or a field boundary is reached, point is left there 1308If an edge of the buffer or a field boundary is reached, point is left there
1309and the function returns nil. Field boundaries are not noticed if 1309and the function returns nil. Field boundaries are not noticed if
1310`inhibit-field-text-motion' is non-nil. */) 1310`inhibit-field-text-motion' is non-nil. */)
1311 (count) 1311 (arg)
1312 Lisp_Object count; 1312 Lisp_Object arg;
1313{ 1313{
1314 int orig_val, val; 1314 int orig_val, val;
1315 CHECK_NUMBER (count);
1316 1315
1317 val = orig_val = scan_words (PT, XINT (count)); 1316 if (NILP (arg))
1317 XSETFASTINT (arg, 1);
1318 else
1319 CHECK_NUMBER (arg);
1320
1321 val = orig_val = scan_words (PT, XINT (arg));
1318 if (! orig_val) 1322 if (! orig_val)
1319 val = XINT (count) > 0 ? ZV : BEGV; 1323 val = XINT (arg) > 0 ? ZV : BEGV;
1320 1324
1321 /* Avoid jumping out of an input field. */ 1325 /* Avoid jumping out of an input field. */
1322 val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), 1326 val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT),
@@ -1451,7 +1455,9 @@ skip_chars (forwardp, string, lim)
1451 1455
1452 c = str[i_byte++]; 1456 c = str[i_byte++];
1453 } 1457 }
1454 if (i_byte < size_byte 1458 /* Treat `-' as range character only if another character
1459 follows. */
1460 if (i_byte + 1 < size_byte
1455 && str[i_byte] == '-') 1461 && str[i_byte] == '-')
1456 { 1462 {
1457 unsigned int c2; 1463 unsigned int c2;
@@ -1459,9 +1465,6 @@ skip_chars (forwardp, string, lim)
1459 /* Skip over the dash. */ 1465 /* Skip over the dash. */
1460 i_byte++; 1466 i_byte++;
1461 1467
1462 if (i_byte == size_byte)
1463 break;
1464
1465 /* Get the end of the range. */ 1468 /* Get the end of the range. */
1466 c2 = str[i_byte++]; 1469 c2 = str[i_byte++];
1467 if (c2 == '\\' 1470 if (c2 == '\\'
@@ -1537,10 +1540,13 @@ skip_chars (forwardp, string, lim)
1537 break; 1540 break;
1538 1541
1539 leading_code = str[i_byte]; 1542 leading_code = str[i_byte];
1540 c = STRING_CHAR_AND_LENGTH (str+i_byte, size_byte-i_byte, len); 1543 c = STRING_CHAR_AND_LENGTH (str + i_byte,
1544 size_byte - i_byte, len);
1541 i_byte += len; 1545 i_byte += len;
1542 } 1546 }
1543 if (i_byte < size_byte 1547 /* Treat `-' as range character only if another character
1548 follows. */
1549 if (i_byte + 1 < size_byte
1544 && str[i_byte] == '-') 1550 && str[i_byte] == '-')
1545 { 1551 {
1546 unsigned int c2; 1552 unsigned int c2;
@@ -1549,12 +1555,10 @@ skip_chars (forwardp, string, lim)
1549 /* Skip over the dash. */ 1555 /* Skip over the dash. */
1550 i_byte++; 1556 i_byte++;
1551 1557
1552 if (i_byte == size_byte)
1553 break;
1554
1555 /* Get the end of the range. */ 1558 /* Get the end of the range. */
1556 leading_code2 = str[i_byte]; 1559 leading_code2 = str[i_byte];
1557 c2 =STRING_CHAR_AND_LENGTH (str + i_byte, size_byte-i_byte, len); 1560 c2 = STRING_CHAR_AND_LENGTH (str + i_byte,
1561 size_byte - i_byte, len);
1558 i_byte += len; 1562 i_byte += len;
1559 1563
1560 if (c2 == '\\' 1564 if (c2 == '\\'
@@ -3312,3 +3316,6 @@ In both cases, LIMIT bounds the search. */);
3312 defsubr (&Sbackward_prefix_chars); 3316 defsubr (&Sbackward_prefix_chars);
3313 defsubr (&Sparse_partial_sexp); 3317 defsubr (&Sparse_partial_sexp);
3314} 3318}
3319
3320/* arch-tag: 3e297b9f-088e-4b64-8f4c-fb0b3443e412
3321 (do not change this comment) */
diff --git a/src/syntax.h b/src/syntax.h
index bdf7ebb31bd..21f24dbd100 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -344,3 +344,6 @@ extern int parse_sexp_lookup_properties;
344extern INTERVAL interval_of P_ ((int, Lisp_Object)); 344extern INTERVAL interval_of P_ ((int, Lisp_Object));
345 345
346extern int scan_words P_ ((int, int)); 346extern int scan_words P_ ((int, int));
347
348/* arch-tag: 28833cca-cd73-4741-8c85-a3111166a0e0
349 (do not change this comment) */