aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
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/syntax.c
parentcc1ba238bdce8bb352ce077f510017cb61cb1e07 (diff)
downloademacs-839966f33341183feaa61d5d644de7e750db76e7.tar.gz
emacs-839966f33341183feaa61d5d644de7e750db76e7.zip
Sync to HEAD.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c41
1 files changed, 24 insertions, 17 deletions
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) */