unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Mike <mikee@mikee.ath.cx>
Subject: Re: OT: emacs-style variables (etc) in the headers?
Date: Mon, 03 Jan 2005 20:44:31 GMT	[thread overview]
Message-ID: <P8iCd.13365$th4.5162@fe07.lga> (raw)
In-Reply-To: jwv652eb8cv.fsf-monnier+gnu.emacs.help@gnu.org

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	other threads:[~2005-01-03 20:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-27 16:59 OT: emacs-style variables (etc) in the headers? Mike
2004-12-27 17:40 ` Peter Dyballa
     [not found] ` <mailman.9151.1104169993.27204.help-gnu-emacs@gnu.org>
2004-12-27 18:17   ` Mike
2005-01-03 19:57 ` Stefan Monnier
2005-01-03 20:44   ` Mike [this message]
2005-01-03 22:21     ` Stefan Monnier
2005-01-03 23:00       ` Mike
2005-01-03 23:03         ` Stefan Monnier

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='P8iCd.13365$th4.5162@fe07.lga' \
    --to=mikee@mikee.ath.cx \
    /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.
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).