unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Trent W. Buck" <trentbuck@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 36759@debbugs.gnu.org
Subject: bug#36759: 26.1; nftables major mode
Date: Mon, 12 Aug 2019 11:16:34 +1000	[thread overview]
Message-ID: <20190812011632.GA935@goll.lan> (raw)
In-Reply-To: <834l2pa1fz.fsf@gnu.org>

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.





  reply	other threads:[~2019-08-12  1:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  7:45 bug#36759: 26.1; nftables major mode Trent W. Buck
2019-08-10  8:07 ` Eli Zaretskii
2019-08-12  1:16   ` Trent W. Buck [this message]
2020-09-05  1:13     ` Stefan Kangas
2020-09-05  4:34       ` Trent W. Buck
2021-09-22 21:16 ` Lars Ingebrigtsen
2021-09-23  2:22   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-24  2:49     ` Trent W. Buck
2022-05-02  8:40     ` Lars Ingebrigtsen
2022-05-02 12:55       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-23  0:38         ` Trent W. Buck
2022-05-23 12:21           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190812011632.GA935@goll.lan \
    --to=trentbuck@gmail.com \
    --cc=36759@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).