GNU bug report logs -
#77138
[PATCH] Add major mode for highlighting .npmrc files
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77138 in the body.
You can then email your comments to 77138 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Thu, 20 Mar 2025 16:27:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 20 Mar 2025 16:27:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
".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.
1: https://docs.npmjs.com/cli/v11/configuring-npm/npmrc
[1.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 11:49:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 77138 <at> debbugs.gnu.org (full text, mbox):
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> 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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 12:52:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 77138 <at> debbugs.gnu.org (full text, mbox):
On Sat, 2025-03-22 at 13:48 +0200, Eli Zaretskii wrote:
> > +(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?
Oooh, good catch! I counfounded "current buffer's syntax table" with
being buffer-local as opposed to mode local.
Thank you very much, will fix today!
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 14:01:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 77138 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, 2025-03-22 at 15:51 +0300, Konstantin Kharlamov wrote:
> On Sat, 2025-03-22 at 13:48 +0200, Eli Zaretskii wrote:
> > > +(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?
>
> Oooh, good catch! I counfounded "current buffer's syntax table" with
> being buffer-local as opposed to mode local.
>
> Thank you very much, will fix today!
Fixed! Patch is attached
[1.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 14:27:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 77138 <at> debbugs.gnu.org (full text, mbox):
Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> * New Modes and Packages in Emacs 31.1
>
> +** New major modes that don't depend on the tree-sitter library
Do we really need this explicit headline?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 14:30:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 77138 <at> debbugs.gnu.org (full text, mbox):
On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
>
> > * New Modes and Packages in Emacs 31.1
> >
> > +** New major modes that don't depend on the tree-sitter library
>
> Do we really need this explicit headline?
I don't have a preference, but I see that just a few lines below there'
s a headline about "tree-sitter based new modes", so if we don't add
the new headline it might look off.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 15:42:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 77138 <at> debbugs.gnu.org (full text, mbox):
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Cc: 77138 <at> debbugs.gnu.org
> Date: Sat, 22 Mar 2025 17:29:09 +0300
>
> On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> > Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> >
> > > * New Modes and Packages in Emacs 31.1
> > >
> > > +** New major modes that don't depend on the tree-sitter library
> >
> > Do we really need this explicit headline?
>
> I don't have a preference, but I see that just a few lines below there'
> s a headline about "tree-sitter based new modes", so if we don't add
> the new headline it might look off.
We mention that a mode is based on tree-sitter because those modes
will not be available in Emacs built without tree-sitter.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 17:37:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 77138 <at> debbugs.gnu.org (full text, mbox):
On Sat, 2025-03-22 at 17:41 +0200, Eli Zaretskii wrote:
> > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > Cc: 77138 <at> debbugs.gnu.org
> > Date: Sat, 22 Mar 2025 17:29:09 +0300
> >
> > On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> > > Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> > >
> > > > * New Modes and Packages in Emacs 31.1
> > > >
> > > > +** New major modes that don't depend on the tree-sitter
> > > > library
> > >
> > > Do we really need this explicit headline?
> >
> > I don't have a preference, but I see that just a few lines below
> > there'
> > s a headline about "tree-sitter based new modes", so if we don't
> > add
> > the new headline it might look off.
>
> We mention that a mode is based on tree-sitter because those modes
> will not be available in Emacs built without tree-sitter.
Yeah, I understand.
So, do you want me to change anything here?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 19:21:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 77138 <at> debbugs.gnu.org (full text, mbox):
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Cc: stefankangas <at> gmail.com, 77138 <at> debbugs.gnu.org
> Date: Sat, 22 Mar 2025 20:36:42 +0300
>
> On Sat, 2025-03-22 at 17:41 +0200, Eli Zaretskii wrote:
> > > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > > Cc: 77138 <at> debbugs.gnu.org
> > > Date: Sat, 22 Mar 2025 17:29:09 +0300
> > >
> > > On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> > > > Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> > > >
> > > > > * New Modes and Packages in Emacs 31.1
> > > > >
> > > > > +** New major modes that don't depend on the tree-sitter
> > > > > library
> > > >
> > > > Do we really need this explicit headline?
> > >
> > > I don't have a preference, but I see that just a few lines below
> > > there'
> > > s a headline about "tree-sitter based new modes", so if we don't
> > > add
> > > the new headline it might look off.
> >
> > We mention that a mode is based on tree-sitter because those modes
> > will not be available in Emacs built without tree-sitter.
>
> Yeah, I understand.
>
> So, do you want me to change anything here?
I think the "that don't depend on the tree-sitter library" part is
better removed.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 19:22:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 77138 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, 2025-03-22 at 21:19 +0200, Eli Zaretskii wrote:
> > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > Cc: stefankangas <at> gmail.com, 77138 <at> debbugs.gnu.org
> > Date: Sat, 22 Mar 2025 20:36:42 +0300
> >
> > On Sat, 2025-03-22 at 17:41 +0200, Eli Zaretskii wrote:
> > > > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > > > Cc: 77138 <at> debbugs.gnu.org
> > > > Date: Sat, 22 Mar 2025 17:29:09 +0300
> > > >
> > > > On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> > > > > Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> > > > >
> > > > > > * New Modes and Packages in Emacs 31.1
> > > > > >
> > > > > > +** New major modes that don't depend on the tree-sitter
> > > > > > library
> > > > >
> > > > > Do we really need this explicit headline?
> > > >
> > > > I don't have a preference, but I see that just a few lines
> > > > below
> > > > there'
> > > > s a headline about "tree-sitter based new modes", so if we
> > > > don't
> > > > add
> > > > the new headline it might look off.
> > >
> > > We mention that a mode is based on tree-sitter because those
> > > modes
> > > will not be available in Emacs built without tree-sitter.
> >
> > Yeah, I understand.
> >
> > So, do you want me to change anything here?
>
> I think the "that don't depend on the tree-sitter library" part is
> better removed.
Okay, done, patch is attached 😊
[1.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 19:25:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 77138 <at> debbugs.gnu.org (full text, mbox):
On Sat, 2025-03-22 at 22:21 +0300, Konstantin Kharlamov wrote:
> On Sat, 2025-03-22 at 21:19 +0200, Eli Zaretskii wrote:
> > > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > > Cc: stefankangas <at> gmail.com, 77138 <at> debbugs.gnu.org
> > > Date: Sat, 22 Mar 2025 20:36:42 +0300
> > >
> > > On Sat, 2025-03-22 at 17:41 +0200, Eli Zaretskii wrote:
> > > > > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > > > > Cc: 77138 <at> debbugs.gnu.org
> > > > > Date: Sat, 22 Mar 2025 17:29:09 +0300
> > > > >
> > > > > On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> > > > > > Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> > > > > >
> > > > > > > * New Modes and Packages in Emacs 31.1
> > > > > > >
> > > > > > > +** New major modes that don't depend on the tree-sitter
> > > > > > > library
> > > > > >
> > > > > > Do we really need this explicit headline?
> > > > >
> > > > > I don't have a preference, but I see that just a few lines
> > > > > below
> > > > > there'
> > > > > s a headline about "tree-sitter based new modes", so if we
> > > > > don't
> > > > > add
> > > > > the new headline it might look off.
> > > >
> > > > We mention that a mode is based on tree-sitter because those
> > > > modes
> > > > will not be available in Emacs built without tree-sitter.
> > >
> > > Yeah, I understand.
> > >
> > > So, do you want me to change anything here?
> >
> > I think the "that don't depend on the tree-sitter library" part is
> > better removed.
>
> Okay, done, patch is attached 😊
…I haven't reduced the heading there to `***` though. I am not
completely sure if it's needed or not. Because again, the "newly added
modes" below all have heading `***`…
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Sat, 22 Mar 2025 19:27:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 77138 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, 2025-03-22 at 22:23 +0300, Konstantin Kharlamov wrote:
> On Sat, 2025-03-22 at 22:21 +0300, Konstantin Kharlamov wrote:
> > On Sat, 2025-03-22 at 21:19 +0200, Eli Zaretskii wrote:
> > > > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > > > Cc: stefankangas <at> gmail.com, 77138 <at> debbugs.gnu.org
> > > > Date: Sat, 22 Mar 2025 20:36:42 +0300
> > > >
> > > > On Sat, 2025-03-22 at 17:41 +0200, Eli Zaretskii wrote:
> > > > > > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > > > > > Cc: 77138 <at> debbugs.gnu.org
> > > > > > Date: Sat, 22 Mar 2025 17:29:09 +0300
> > > > > >
> > > > > > On Sat, 2025-03-22 at 14:26 +0000, Stefan Kangas wrote:
> > > > > > > Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> > > > > > >
> > > > > > > > * New Modes and Packages in Emacs 31.1
> > > > > > > >
> > > > > > > > +** New major modes that don't depend on the tree-
> > > > > > > > sitter
> > > > > > > > library
> > > > > > >
> > > > > > > Do we really need this explicit headline?
> > > > > >
> > > > > > I don't have a preference, but I see that just a few lines
> > > > > > below
> > > > > > there'
> > > > > > s a headline about "tree-sitter based new modes", so if we
> > > > > > don't
> > > > > > add
> > > > > > the new headline it might look off.
> > > > >
> > > > > We mention that a mode is based on tree-sitter because those
> > > > > modes
> > > > > will not be available in Emacs built without tree-sitter.
> > > >
> > > > Yeah, I understand.
> > > >
> > > > So, do you want me to change anything here?
> > >
> > > I think the "that don't depend on the tree-sitter library" part
> > > is
> > > better removed.
> >
> > Okay, done, patch is attached 😊
>
> …I haven't reduced the heading there to `***` though. I am not
> completely sure if it's needed or not. Because again, the "newly
> added
> modes" below all have heading `***`…
Anyway, patch is attached if you want the version with heading reduced.
I also added the bug number to the commit title.
[1.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77138
; Package
emacs
.
(Mon, 24 Mar 2025 08:17:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 77138 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
v5 attached.
New change: the in files alist the dot excluded from npmrc naming, i.e.
"\\.npmrc\\'" is replaced to "npmrc\\'".
Reason: even though npmrc are typically starting with a dot, but the
official docs¹ mention there may be system-wide files without it, like
`/etc/npmrc`.
1: https://docs.npmjs.com/cli/v11/configuring-npm/npmrc
[1.patch (text/x-patch, attachment)]
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sat, 29 Mar 2025 10:24:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
:
bug acknowledged by developer.
(Sat, 29 Mar 2025 10:24:02 GMT)
Full text and
rfc822 format available.
Message #46 received at 77138-done <at> debbugs.gnu.org (full text, mbox):
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Cc: stefankangas <at> gmail.com, 77138 <at> debbugs.gnu.org
> Date: Mon, 24 Mar 2025 11:16:28 +0300
>
> v5 attached.
>
> New change: the in files alist the dot excluded from npmrc naming, i.e.
> "\\.npmrc\\'" is replaced to "npmrc\\'".
>
> Reason: even though npmrc are typically starting with a dot, but the
> official docs¹ mention there may be system-wide files without it, like
> `/etc/npmrc`.
>
> 1: https://docs.npmjs.com/cli/v11/configuring-npm/npmrc
Thanks, installed on the master branch, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 26 Apr 2025 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 54 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.