GNU bug report logs - #64792
js-mode doesn't recognize LS and PS line endings, leading to incorrect syntax highlighting

Previous Next

Package: emacs;

Reported by: Clément Pit-Claudel <cpitclaudel <at> gmail.com>

Date: Sat, 22 Jul 2023 16:43:01 UTC

Severity: normal

Full log


Message #8 received at 64792 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
Cc: 64792 <at> debbugs.gnu.org
Subject: Re: 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 <at> 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.)




This bug report was last modified 1 year and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.