From 22ba04742072098be60ec223ed2e97fa9a09b045 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Thu, 16 Apr 2020 17:01:14 +0000 Subject: [PATCH] (forward-comment -n): escaped newline is sometimes NOT end of comment * 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/syntax.c b/src/syntax.c index e24b98da32a..ff125b137cf 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -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') -- 2.39.2