From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Trent W. Buck" Newsgroups: gmane.emacs.bugs Subject: bug#36759: 26.1; nftables major mode Date: Mon, 12 Aug 2019 11:16:34 +1000 Message-ID: <20190812011632.GA935@goll.lan> References: <87d0i2ecma.fsf@goll.lan> <834l2pa1fz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="85057"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 36759@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 12 03:17:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hwyxS-000M0b-BN for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Aug 2019 03:17:10 +0200 Original-Received: from localhost ([::1]:42342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwyxQ-0007ra-NE for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Aug 2019 21:17:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52680) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwyxL-0007rG-U2 for bug-gnu-emacs@gnu.org; Sun, 11 Aug 2019 21:17:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hwyxK-0003cR-SJ for bug-gnu-emacs@gnu.org; Sun, 11 Aug 2019 21:17:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hwyxK-0003cM-OZ for bug-gnu-emacs@gnu.org; Sun, 11 Aug 2019 21:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hwyxK-000516-Hp for bug-gnu-emacs@gnu.org; Sun, 11 Aug 2019 21:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Trent W. Buck" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Aug 2019 01:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36759 X-GNU-PR-Package: emacs Original-Received: via spool by 36759-submit@debbugs.gnu.org id=B36759.156557260618524 (code B ref 36759); Mon, 12 Aug 2019 01:17:02 +0000 Original-Received: (at 36759) by debbugs.gnu.org; 12 Aug 2019 01:16:46 +0000 Original-Received: from localhost ([127.0.0.1]:45957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hwyx4-0004oM-1b for submit@debbugs.gnu.org; Sun, 11 Aug 2019 21:16:46 -0400 Original-Received: from mail-pl1-f196.google.com ([209.85.214.196]:44997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hwyx2-0004id-9c for 36759@debbugs.gnu.org; Sun, 11 Aug 2019 21:16:44 -0400 Original-Received: by mail-pl1-f196.google.com with SMTP id t14so47219130plr.11 for <36759@debbugs.gnu.org>; Sun, 11 Aug 2019 18:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mG510hkcgLtExY4/2BtJhVX48nTBm+qtvhmLeydRRVY=; b=XA7FhzHkN8n9VL5sbTLbbidBIyxU1iu2+ezI9E1Q20H0Kak5EK9We1VWLdnUYPjCWS aU2NzFOjw606DM9rZa3RSOPjmtW0VdHSbrD3ndSDXhevn/mIWmTIytBl0vQSpoGLy0Y2 UtG0xtOT8PbuK7IF37ebEdj4a5WrwHHFQRG+3WSnE+uXdDjzfJkDSPzfb0rawA9DY7B2 NLADLi1DnS0SByvncBMvuxixyp8FLTqSa/NE2hQIz/0B2GByBheAdUyX8M5QX+5jyoFp OuAUO0XXCUT9lBJaJ62mfRIR/n++CupCqOuJEOd5RE0V3Y/DEpYbu6FavAhSi+AZJT+s mf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mG510hkcgLtExY4/2BtJhVX48nTBm+qtvhmLeydRRVY=; b=KosX4gUt3MyIVUn73uQxGUhDiLz2sDJMuTi63CMKGYfTpf3ey8uWy4K19qr8i8qwzB uHw8UgNJCSQQJicpudq+wbJXSHF3CQ6mlH2K5bAYaJSNBxVHIOdy0PRCD/DUDRh0Dz/3 aasvVXfixzC58NA/L95Rhei8034HXFdm5kRqAg5LZ4Jnl1WxLmtUgfDydACAYtxIyJGL zPLtuoLe7gHP+yvQyFrwJY60OlPx51wxq4BrVNvE8r7oL8xiEY6KdmKSArNIlSRmG9MW mC7ORyg3AJMxp6vnd1797IwBMSbrvWdoQklNOCzW5H0A8h4IYhPc1adfBiu9SASCsaEq XZXw== X-Gm-Message-State: APjAAAUCMs3WAp+m1QNxtVfmKuK6piLOcVS1MphuWKXxYeDX0gctS9Uh 6AsuXqpN/JtMqpWsuQUXBOY= X-Google-Smtp-Source: APXvYqxRckaBVkxE7Xkv/t7r80eq2HZfKz+fh4SIsMQBM9t7YY9o+KMqyqM/yaq3aDa0IvpePNSfGA== X-Received: by 2002:a17:902:ba8e:: with SMTP id k14mr9751229pls.10.1565572598441; Sun, 11 Aug 2019 18:16:38 -0700 (PDT) Original-Received: from localhost ([203.7.155.117]) by smtp.gmail.com with ESMTPSA id v18sm105303827pgl.87.2019.08.11.18.16.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 18:16:37 -0700 (PDT) Content-Disposition: inline In-Reply-To: <834l2pa1fz.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164903 Archived-At: 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.