bugGNU nano - Bugs: bug #65334, [Wish] recognize also the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #65334: [Wish] recognize also the ".mjs" extension, and add a `magic` command

Submitter:  Matt Whitlock <mwhitlock>
Submitted:  Tue 20 Feb 2024 05:29:58 AM UTC
   
 
Severity:  1 - Wish Status:  Fixed
Assigned to:  bens Open/Closed:  Open

Tue 20 Feb 2024 04:09:33 PM UTC, comment #1: 

Okay.  Fixed in git, commit f1a04f78.

My version of `file` (5.41) still describes JavaScript files as "ASCII text".  But I see that the latest version contains the string "JavaScript source".  So I've added that.

(By the way, when the `extendsyntax` command cannot do what you want, you can always completely redefine a syntax.  Not economical, but it works.)

Benno Schulenberg <bens>
Group administrator
Tue 20 Feb 2024 05:29:58 AM UTC, original submission:  

Please add the ".mjs" filename extension to the javascript.nanorc syntax config.  The V8 project recommends this extension for JavaScript modules and adds:

> “Additionally, you may want to configure your editor to treat .mjs files as .js files to get syntax highlighting. Most modern editors already do this by default.”
> https://v8.dev/features/modules#mjs


Nano doesn't "already do this by default," but it should. ;)


Also, javascript.nanorc currently lacks a suitable magic command, so while you're at it, please add:

magic "JavaScript source"


Incidentally, I wouldn't be making this enhancement request if the extendsyntax command were capable of adding new filename regexes to an existing syntax definition.  Something to consider.

Matt Whitlock <mwhitlock>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by mwhitlock (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-20 bens Summaryjavascript.nanorc should recognize &quot;.mjs&quot; extension and also support libmagic [Wish] recognize also the ".mjs" extension, and add a `magic` command
    2024-02-20 bens Severity3 - Normal 1 - Wish
        StatusNone Fixed
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code