]> git.eshelyaron.com Git - emacs.git/commitdiff
(forward-comment -n): escaped newline is sometimes NOT end of comment
authorAlan Mackenzie <acm@muc.de>
Thu, 16 Apr 2020 17:01:14 +0000 (17:01 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 16 Apr 2020 17:01:14 +0000 (17:01 +0000)
* src/syntax.c (Fforward_comment) When comment-end-can-be-escaped is non-nil,
don't attempt back_comment when point is just after an escaped newline, etc.

src/syntax.c

index e24b98da32a6575a33445598f8287e3f4c2c0a4c..ff125b137cfa2ec2c01144c2ef195c5706ed810d 100644 (file)
@@ -2572,8 +2572,9 @@ between them, return t; otherwise return nil.  */)
            }
          else if (code == Sendcomment)
            {
-             found = back_comment (from, from_byte, stop, comnested, comstyle,
-                                   &out_charpos, &out_bytepos);
+              found = (!quoted || !Vcomment_end_can_be_escaped)
+                && back_comment (from, from_byte, stop, comnested, comstyle,
+                                 &out_charpos, &out_bytepos);
              if (!found)
                {
                  if (c == '\n')