From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: asking for advice for changing the cfengine.el progmode to support CFEngine 3.x
Date: Thu, 23 Jun 2011 16:31:06 -0500 [thread overview]
Message-ID: <87sjr0z145.fsf@lifelogs.com> (raw)
In-Reply-To: 874o3hftlb.fsf@lifelogs.com
[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]
On Wed, 22 Jun 2011 16:24:00 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote:
TZ> Rather than try to explain the grammar, I'll write it out. That way the
TZ> terminology is clearer; I should have started there instead of giving
TZ> you ad-hoc examples. Sorry about that. I hope the explanation is
TZ> sufficient to clear things up.
I included this "grammar" of sorts in cfengine3.el as comments. The
SMIE stuff is commented out and not functional. See attached.
A good, fairly large test file is at
http://source.cfengine.com/svn/copbl/trunk/cfengine_stdlib.cf
This version does:
- much better font-lock (I only need to do in-string highlighting,
e.g. "this is $(interpolated)" but haven't figured that part out
yet). The right faces are applied everywhere otherwise.
- intelligent indentation: 1 indent to "category:"; 2 indents to
"class_selector::"; 3 indents to actual commands; appropriate
indentation to nested lists; and 0 indentation to continued strings.
The results look like this:
#+begin_src cfengine3
bundle edit_line syslog_init_append_oom
{
delete_lines:
"CFENGINE_ADD=1.*";
insert_lines:
debian::
"CFENGINE_ADD=1 echo -17 > /proc/$PID/oom_adj" location => after("^\h+start\s+\"\$JOB\"");
redhat::
"CFENGINE_ADD=1 echo -17 > /proc/`cat /var/run/syslogd.pid`/oom_adj"
location => after("^\h+\[ \$RETVAL -eq 0 \] && touch /var/lock/subsys/syslog");
}
#+end_src
- everything is based on defuns, which in CFEngine3 are syntax blocks
(older CFEngine versions didn't have them).
- the syntax table from cfengine.el is adjusted for the new version
As it is, except for highlighting string interpolation, it's great for
everyday work. So I want to know if there's any reason to pursue
SMIE--what more can it do for this mode--and if there are any other
comments on the code. If not, I'll remove the unnecessary parts, commit
it, and make a note in cfengine.el about the newer version.
Thanks
Ted
[-- Attachment #2: cfengine3.el --]
[-- Type: application/emacs-lisp, Size: 12135 bytes --]
next prev parent reply other threads:[~2011-06-23 21:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-17 18:11 asking for advice for changing the cfengine.el progmode to support CFEngine 3.x Ted Zlatanov
2011-06-17 22:02 ` Stefan Monnier
2011-06-20 20:42 ` Ted Zlatanov
2011-06-21 14:59 ` Stefan Monnier
2011-06-21 19:26 ` Ted Zlatanov
2011-06-22 17:44 ` Stefan Monnier
2011-06-22 21:24 ` Ted Zlatanov
2011-06-23 21:31 ` Ted Zlatanov [this message]
2011-06-27 15:44 ` Ted Zlatanov
2011-06-30 12:47 ` Ted Zlatanov
2011-06-30 16:03 ` Stefan Monnier
2011-06-30 18:25 ` Ted Zlatanov
2011-06-30 21:10 ` Stefan Monnier
2011-06-30 21:29 ` Ted Zlatanov
2011-07-01 8:19 ` Eli Zaretskii
2011-07-01 10:15 ` Ted Zlatanov
2011-07-01 11:22 ` Eli Zaretskii
2011-07-01 13:03 ` Ted Zlatanov
2011-06-30 16:11 ` Stefan Monnier
2011-06-30 18:28 ` Ted Zlatanov
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=87sjr0z145.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=emacs-devel@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).