Subject: Re: bug#77138: [PATCH] Add major mode for highlighting .npmrc files

From: Eli Zaretskii <[email-masked]>
Date: Sat, 22 Mar 2025 13:48:25 +0200

> From: Konstantin Kharlamov <[email-masked]>
> Date: Thu, 20 Mar 2025 19:26:03 +0300
> 
> ".npmrc" are configuration files used by "npm", which in turn is a
> widely used package manager in web-development setting (javascript,
> typescript, etc).
> 
> I don't have much expertise in NPM field, but judging by the official
> documentation¹ it's basically ini-style `key = value`, but with two
> comment styles (semicolon and hash sign).
> 
> Easily implementable by deriving from conf-mode and adding the comment
> styles.
> 
> Patch is attached.

Thanks.

> +(define-derived-mode conf-npmrc-mode conf-mode "Conf[npmrc]"
> + "Conf Mode starter for .npmrc files.
> +Comments start with `#' and `;'. For details see `conf-mode'."
> + (conf-mode-initialize "#")
> + (modify-syntax-entry ?\; "<")
> + (modify-syntax-entry ?\# "<"))

Doesn't this affect the global syntax table, not just the syntax local
to the buffer under this mode?