GNU bug report logs -
#36759
26.1; nftables major mode
Previous Next
Reported by: trentbuck <at> gmail.com (Trent W. Buck)
Date: Mon, 22 Jul 2019 07:46:02 UTC
Severity: wishlist
Found in version 26.1
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 36759 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii wrote:
>> nftables is a Linux kernel firewall.
>> I couldn't find a major mode for this, so I wrote a basic one.
>> Could someone else adopt it into mainline Emacs?
>
> Would it be possible to rewrite this mode using define-generic-mode?
> See generic-x.el for some example of using that macro.
I didn't know about define-generic-mode!
(My elisp-fu is Giraffe Book vintage, and I've been using
e.g. conf-mode instead of ini-generic-mode, and third-party
apache-mode instead of apache-conf-generic-mode.)
I can have a go, but I don't know when I'll get around to it.
At a glance, I don't see how to handle code blocks (syntax-entry for ?{ and ?}) and continuation lines in there.
In fact, I don't see ANY indent function handling in generic.el or generic-x.el?
I'm also concerned that keyword-list there will do the Wrong Thing.
For example, in this standard example document,
the second and third "filter" are keywords, but
the first "filter" is a variable.
table inet filter {
chain input {
type filter hook input priority filter; default accept;
iiftype loopback counter accept
}
}
That can also be written like this (the "add" and "rule" are optional).
add table inet filter
add chain inet filter chain input { type filter hook input priority filter; default accept; }
add rule inet filter iiftype loopback counter accept
It's because of this reuse of keywords as variables that I wrote more
than just keyword highlighting -- I *need* the "filter"s to be colored
differently, or I can't cope.
PS: In the example above, "input" also a variable AND a keyword.
This bug report was last modified 95 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.