From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mike Newsgroups: gmane.emacs.help Subject: Re: OT: emacs-style variables (etc) in the headers? Date: Mon, 03 Jan 2005 20:44:31 GMT Message-ID: References: <1cXzd.3978$Rb3.3396@fe07.lga> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1104785036 14407 80.91.229.6 (3 Jan 2005 20:43:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Jan 2005 20:43:56 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 03 21:43:48 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ClZ3M-0006Nv-00 for ; Mon, 03 Jan 2005 21:43:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ClZEV-00074d-Pb for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Jan 2005 15:55:19 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newsfeed2.telusplanet.net!newsfeed.telus.net!bigfeed.bellsouth.net!news.bellsouth.net!hwmnpeer01.lga!hwmedia!hw-poster!fe07.lga.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Followup-To: comp.emacs User-Agent: slrn/0.9.7.4 (Linux) Original-Lines: 49 Original-X-Trace: pikkdiabbdefphapelipengdcomedahipfejpdnfieaefdgfmpcikphidmjlhdnllmgobgdicjfaaahjnafhfilkilnaeogealipebkaoidkodlajibgkehcdkemollcbcfagklmibllijll Original-NNTP-Posting-Date: Mon, 03 Jan 2005 13:44:31 MST Original-Xref: shelby.stanford.edu gnu.emacs.help:127648 comp.emacs:87513 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23115 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23115 In article , 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 | \------------------------