help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT: emacs-style variables (etc) in the headers?


From: Mike
Subject: Re: OT: emacs-style variables (etc) in the headers?
Date: Mon, 03 Jan 2005 20:44:31 GMT
User-agent: slrn/0.9.7.4 (Linux)

In article <jwv652eb8cv.fsf-monnier+gnu.emacs.help@gnu.org>, Stefan Monnier 
wrote:
>> I'm starting on a project where I want to include script
>> snippets in the headers of files (perl, shell, etc.) actually
>> inside comments where these snippets will not bother the real
>> script. Is there an algorithm somewhere to detect the script
>> is really a script and not a binary file, what the comment
>> character is, and some standard way to include these variables
>> and such in files?
> 
> I do not fully understand your question.
> 
> Could you give a concrete example?
> Does interpreter-mode-alist answer the question?
> 
> 
>         Stefan "who doesn't read comp.emacs religiously"

I've looked at cfengine and though I like several things it does,
there are a few things I don't like, so I'm writing my own (just
like every other programmer). What I've come up with is something
like rpm spec files where I'm looking for a beginning tag (in this
case the tag is /^%uconfig file configuration/) and an ending tag
(/^%done/). Between these tags can fall five other tags: %pre,
%post, %inst, %doc, %always. The %pre is done before anything else,
the %post is done after the file is copied, the %always is always
done, the %doc is for documentation, and the %inst is a custom way
to copy the file (like /etc/syslog.conf) instead of using the default
(which copies /etc/syslog.conf :). I have a few other bits of
syntactic sugar in different places to make it all work.

I'm nearing the end of testing and will soon roll it to my server
farm.

What do you think?

 /------------------------
 |# $Id
 |# $Log
 |
 |!loghost:*.info      @loghost
 |loghost:*.info       /var/log/syslog.log
 |
 |%uconfig file configuration
 |%post
 |ps -ef | grep syslogd | grep -v grep | awk '{print $2}' | xargs kill -1
 |%done
 |
 \------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]