diff options
| author | Karl Heuer | 1994-03-02 05:31:15 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-03-02 05:31:15 +0000 |
| commit | 048822963e17ee237955b42ca4597775dba4374e (patch) | |
| tree | 602670e852c5d0515f160e3f92c6e853be107168 /src/syntax.c | |
| parent | 19479ae2d64859f67f84c245b1b98b4b2e1b43ee (diff) | |
| download | emacs-048822963e17ee237955b42ca4597775dba4374e.tar.gz emacs-048822963e17ee237955b42ca4597775dba4374e.zip | |
(Fforward_comment): Do the right thing at eob.
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/syntax.c b/src/syntax.c index e4912bab65d..c06cb4bd6e5 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -599,8 +599,13 @@ between them, return t; otherwise return nil.") | |||
| 599 | while (count1 > 0) | 599 | while (count1 > 0) |
| 600 | { | 600 | { |
| 601 | stop = ZV; | 601 | stop = ZV; |
| 602 | while (from < stop) | 602 | do |
| 603 | { | 603 | { |
| 604 | if (from == stop) | ||
| 605 | { | ||
| 606 | SET_PT (from); | ||
| 607 | return Qnil; | ||
| 608 | } | ||
| 604 | c = FETCH_CHAR (from); | 609 | c = FETCH_CHAR (from); |
| 605 | code = SYNTAX (c); | 610 | code = SYNTAX (c); |
| 606 | from++; | 611 | from++; |
| @@ -617,45 +622,40 @@ between them, return t; otherwise return nil.") | |||
| 617 | comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); | 622 | comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); |
| 618 | from++; | 623 | from++; |
| 619 | } | 624 | } |
| 620 | 625 | } | |
| 621 | if (code == Scomment) | 626 | while (code == Swhitespace || code == Sendcomment); |
| 622 | { | 627 | if (code != Scomment) |
| 623 | while (1) | 628 | { |
| 624 | { | 629 | immediate_quit = 0; |
| 625 | if (from == stop) | 630 | SET_PT (from - 1); |
| 626 | { | 631 | return Qnil; |
| 627 | immediate_quit = 0; | 632 | } |
| 628 | SET_PT (from); | 633 | /* We're at the start of a comment. */ |
| 629 | return Qnil; | 634 | while (1) |
| 630 | } | 635 | { |
| 631 | c = FETCH_CHAR (from); | 636 | if (from == stop) |
| 632 | if (SYNTAX (c) == Sendcomment | ||
| 633 | && SYNTAX_COMMENT_STYLE (c) == comstyle) | ||
| 634 | /* we have encountered a comment end of the same style | ||
| 635 | as the comment sequence which began this comment | ||
| 636 | section */ | ||
| 637 | break; | ||
| 638 | from++; | ||
| 639 | if (from < stop && SYNTAX_COMEND_FIRST (c) | ||
| 640 | && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) | ||
| 641 | && SYNTAX_COMMENT_STYLE (c) == comstyle) | ||
| 642 | /* we have encountered a comment end of the same style | ||
| 643 | as the comment sequence which began this comment | ||
| 644 | section */ | ||
| 645 | { from++; break; } | ||
| 646 | } | ||
| 647 | /* We have skipped one comment. */ | ||
| 648 | break; | ||
| 649 | } | ||
| 650 | else if (code != Swhitespace && code != Sendcomment) | ||
| 651 | { | 637 | { |
| 652 | immediate_quit = 0; | 638 | immediate_quit = 0; |
| 653 | SET_PT (from - 1); | 639 | SET_PT (from); |
| 654 | return Qnil; | 640 | return Qnil; |
| 655 | } | 641 | } |
| 642 | c = FETCH_CHAR (from); | ||
| 643 | if (SYNTAX (c) == Sendcomment | ||
| 644 | && SYNTAX_COMMENT_STYLE (c) == comstyle) | ||
| 645 | /* we have encountered a comment end of the same style | ||
| 646 | as the comment sequence which began this comment | ||
| 647 | section */ | ||
| 648 | break; | ||
| 649 | from++; | ||
| 650 | if (from < stop && SYNTAX_COMEND_FIRST (c) | ||
| 651 | && SYNTAX_COMEND_SECOND (FETCH_CHAR (from)) | ||
| 652 | && SYNTAX_COMMENT_STYLE (c) == comstyle) | ||
| 653 | /* we have encountered a comment end of the same style | ||
| 654 | as the comment sequence which began this comment | ||
| 655 | section */ | ||
| 656 | { from++; break; } | ||
| 656 | } | 657 | } |
| 657 | 658 | /* We have skipped one comment. */ | |
| 658 | /* End of comment reached */ | ||
| 659 | count1--; | 659 | count1--; |
| 660 | } | 660 | } |
| 661 | 661 | ||