From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63535@debbugs.gnu.org
Subject: bug#63535: Master branch: Error in forw_comment (syntax.c) handling of escaped LFs
Date: Tue, 16 May 2023 16:58:55 +0000 [thread overview]
Message-ID: <ZGO2T59Ev15cVDm4@ACM> (raw)
In-Reply-To: <83edngz1cp.fsf@gnu.org>
Hello, Eli.
On Tue, May 16, 2023 at 19:29:26 +0300, Eli Zaretskii wrote:
> > Date: Tue, 16 May 2023 16:15:24 +0000
> > Cc: 63535@debbugs.gnu.org
> > From: Alan Mackenzie <acm@muc.de>
> > > > && !(comment_end_can_be_escaped && char_quoted (from, from_byte))
> > > > .. Checking char_quoted is wrong. Instead the function should check the
> > > > current parse state.
> > > Why not both? IOW, please explain why char_quoted is not TRT here.
> > Because parse-partial-sexp is not scanning the backslash. The scan
> > starts one character after the backslash, and the syntactic effect of
> > that backslash is not in the OLDSTATE argument to parse-partial-sexp.
> Sorry, I still don't follow: char_quoted doesn't call
> parse-partial-sexp, AFAICT.
parse-partial-sexp calls forw_comment which (wrongly) calls char_quoted.
> So why does it matter what parse-partial-sexp does when we are
> discussing why char_quoted is not TRT?
parse-partial-sexp is the context in which the bug becomes evident. If,
in the C++ line comment with escaped NL, you start parse-partial-sexp at
the NL, it behaves as though the scan started at the backslash. This is
the bug.
The cause of the bug is the use of char_quoted at line 42 of
forw_comment.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2023-05-16 16:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 10:57 bug#63535: Master branch: Error in forw_comment (syntax.c) handling of escaped LFs Alan Mackenzie
2023-05-16 14:03 ` Alan Mackenzie
2023-05-17 22:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22 14:59 ` Alan Mackenzie
2023-05-22 15:16 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-22 16:16 ` Alan Mackenzie
2023-05-16 15:43 ` Eli Zaretskii
2023-05-16 16:15 ` Alan Mackenzie
2023-05-16 16:29 ` Eli Zaretskii
2023-05-16 16:58 ` Alan Mackenzie [this message]
2023-05-16 17:50 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZGO2T59Ev15cVDm4@ACM \
--to=acm@muc.de \
--cc=63535@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).