aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-10-12 08:24:47 +0000
committerRichard M. Stallman1994-10-12 08:24:47 +0000
commit5a28e48c70926c89c29ca76a1f2df733096f1cb5 (patch)
treed788ca2d1aca6e2639b35a29bab7ffc179606da9 /src/syntax.c
parent4481ae96a9f39363334856f4d73a3c3ed8b8331e (diff)
downloademacs-5a28e48c70926c89c29ca76a1f2df733096f1cb5.tar.gz
emacs-5a28e48c70926c89c29ca76a1f2df733096f1cb5.zip
(scan_sexps_forward): At startincomment,
do notice a 2-char comment ender that straddles FROM.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 41a236eb5bd..8d7f908865f 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1511,9 +1511,20 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
1511 curlevel->prev = curlevel->last; 1511 curlevel->prev = curlevel->last;
1512 break; 1512 break;
1513 1513
1514 startincomment:
1515 if (commentstop)
1516 goto done;
1517 if (from != BEGV)
1518 {
1519 /* Enter the loop in the middle so that we find
1520 a 2-char comment ender if we start in the middle of it. */
1521 prev = FETCH_CHAR (from - 1);
1522 goto startincomment_1;
1523 }
1524 /* At beginning of buffer, enter the loop the ordinary way. */
1525
1514 case Scomment: 1526 case Scomment:
1515 state.incomment = 1; 1527 state.incomment = 1;
1516 startincomment:
1517 if (commentstop) 1528 if (commentstop)
1518 goto done; 1529 goto done;
1519 while (1) 1530 while (1)
@@ -1527,6 +1538,7 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
1527 encountered. */ 1538 encountered. */
1528 break; 1539 break;
1529 from++; 1540 from++;
1541 startincomment_1:
1530 if (from < end && SYNTAX_COMEND_FIRST (prev) 1542 if (from < end && SYNTAX_COMEND_FIRST (prev)
1531 && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) 1543 && SYNTAX_COMEND_SECOND (FETCH_CHAR (from))
1532 && SYNTAX_COMMENT_STYLE (prev) == state.comstyle) 1544 && SYNTAX_COMMENT_STYLE (prev) == state.comstyle)