Re: preprocessing an included file with system command

2011-10-17 Thread David Raleigh Arnold
On Sat, 2011-10-01 at 14:13 -0400, Michael Ellis wrote: > For anyone who wants to make use of it, I've attached a short python > script I wrote this morning for general purpose monitoring of files > with given extensions in an arbitrary list of directories. Should be > self-explanatory to python h

Re: preprocessing an included file with system command

2011-10-01 Thread Michael Ellis
For anyone who wants to make use of it, I've attached a short python script I wrote this morning for general purpose monitoring of files with given extensions in an arbitrary list of directories. Should be self-explanatory to python hackers and adaptable to any application where you need to detect

Re: preprocessing an included file with system command

2011-09-25 Thread Michael Ellis
On Sun, Sep 25, 2011 at 1:08 PM, Karl Hammar wrote: > One does not really want macros nor preprocessors, since it munges > up error reporting. > Which one does not want them? :-) Seriously, I understand and, to a great extent, sympathize with that point of view -- especially when it involves

Re: preprocessing an included file with system command

2011-09-25 Thread Karl Hammar
Mike: 0173 140 57 > On Sun, Sep 25, 2011 at 6:34 AM, Dmytro O. Redchuk > wrote: > > On Sat 24 Sep 2011, 23:52 Michael Ellis wrote: > >> On Sat, Sep 24, 2011 at 4:28 PM, Graham Percival > >> > or m4 or python, I'd do this: > >> > # mylily.sh > >> > cp $1 /tmp > >> > sed '...' /tmp/$1 > /tmp/$1-proc

Re: preprocessing an included file with system command

2011-09-25 Thread Michael Ellis
On Sun, Sep 25, 2011 at 6:34 AM, Dmytro O. Redchuk wrote: > On Sat 24 Sep 2011, 23:52 Michael Ellis wrote: >> On Sat, Sep 24, 2011 at 4:28 PM, Graham Percival >> > or m4 or python, I'd do this: >> > # mylily.sh >> > cp $1 /tmp >> > sed '...' /tmp/$1 > /tmp/$1-processed.ly >> > lilypond /tmp/$1-pro

Re: preprocessing an included file with system command

2011-09-25 Thread Dmytro O. Redchuk
On Sat 24 Sep 2011, 23:52 Michael Ellis wrote: > On Sat, Sep 24, 2011 at 4:28 PM, Graham Percival > > or m4 or python, I'd do this: > > # mylily.sh > > cp $1 /tmp > > sed '...' /tmp/$1 > /tmp/$1-processed.ly > > lilypond /tmp/$1-processed.ly > > mv /tmp/$1-processed.ly . Often it can be done with s

Re: preprocessing an included file with system command

2011-09-24 Thread Michael Ellis
On Sat, Sep 24, 2011 at 4:28 PM, Graham Percival wrote: > On Sat, Sep 24, 2011 at 01:30:55PM -0400, Michael Ellis wrote: >> Note: what I'm actually trying to do with the preprocessing, as >> opposed to the trivial example above,  is something that cannot be >> done easily with a music function.  I

Re: preprocessing an included file with system command

2011-09-24 Thread Graham Percival
On Sat, Sep 24, 2011 at 01:30:55PM -0400, Michael Ellis wrote: > Note: what I'm actually trying to do with the preprocessing, as > opposed to the trivial example above, is something that cannot be > done easily with a music function. I know about the --evaluate > command line option but that's al

preprocessing an included file with system command

2011-09-24 Thread Michael Ellis
If I define a music function to apply an arbitrary system command to a file thusly, sysinc = #(define-music-function (p l cmd fname) (string? string?)    "Run system command, cmd, and redirect output to fname.     then include fname in input."     (system (string-concatenate (list cmd " > " fname)