[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#64792: js-mode doesn't recognize LS and PS line endings, leading to
From: |
Eli Zaretskii |
Subject: |
bug#64792: js-mode doesn't recognize LS and PS line endings, leading to incorrect syntax highlighting |
Date: |
Sat, 22 Jul 2023 19:52:40 +0300 |
> Date: Sat, 22 Jul 2023 18:41:42 +0200
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>
> Is there an easy way to make Emacs treat LS and PS as newlines in js-mode?
> Ideally it would display the calls to console.debug on their own separate
> lines, like this:
>
> //[LS]
> console.debug("Hello,");
> //[PS]
> console.debug("world!");
This can be accomplished via the display-table, but I doubt that it
would satisfy you.
> … but it would already be nice to fix the syntax highlighting to not use the
> comment font. For that these characters could be marked as comment enders.
> There may be additional work to do to check uses of \n of "^" and "$" in
> regular expressions, too.
AFAIU, this requires either changes to the font-lock regexps or
low-level change to regex-emacs.c such that it considers these two
separator characters as equivalents of a newline.
(If you ask me, Unicode made a heck of a mess by introducing these
characters, witness the problems editors out there have to this day
with handling them.)