[PD-dev] pd 0.37 and help patches
Hans-Christoph Steiner
hans at eds.org
Wed Sep 17 02:59:36 CEST 2003
On Tuesday, Sep 16, 2003, at 17:43 America/New_York, Frank Barknecht
wrote:
> Hallo,
> Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
>
>> So... Frank... feel like writing some fearsome regex for this? Let's
>> see what cases I can come up with:
>
> Well, as those are from different packages using different idioms,
> several regexps would be the easiest. In Pd itself everything is done
> the same way.
>
I was hoping to see a super-human regex with lots crazy chars! ;) I am
sure it makes more sense to do them individually. But I just thought
of something: the regex would ideally put in an "#if PD_MINOR_VERSION
<37" and maintain a working version for both >=0.37 and <0.37. But
this could be a real pain. So how tied are we to supporting old
versions?
>> This is my format:
>>
>> PACKAGE:
>> HELP FILE NAME
>> SETHELPSYMBOL
>>
>> ext13:
>> *.pd
>> class_sethelpsymbol(*_class, gensym("*"));
>
> replace 'class_sethelpsymbol(*_class, gensym("' with for example
> 'class_sethelpsymbol(*_class, gensym("help-' to add "help-" It's not
> really hard.
>
>> ggee:
>> *.pd
>> (no class_sethelpsymbol)
>
> Uses the default, so nothing to do.
The files have to be renamed to *-help.pd though.
>
>> maxlib:
>> help-*.pd
>> #ifndef MAXLIB
>> class_sethelpsymbol(*_class, gensym("help-*.pd"));
>> #else
>> class_sethelpsymbol(*_class, gensym("maxlib/help-*.pd"));
>> #endif
>
> This is tricky at a first look. But basically it also just is:
> s/(class_sethelpsymbol.*?)help-\*\.pd/$1\*\.pd/
> or similar.
>
> To append "-help" to the end of the file use:
>
> $ perl -pi.bak -e
> 's/(class_sethelpsymbol.*?)help-\*\.pd/$1\*-help\.pd/' maxlib/*.c
>
>
> This is a bit naive in that it assumes that the help-symbol definition
> is on one line. It's too late here to think about how to do multiline
> regexps. You probably just have to search for a closing brace.
Based on my informal poll, I think every class_sethelpsymbol I saw was
on one line. But it would be best if the regex was multi-line aware...
I haven't done much with multi-line regexs so I don't think I could
offer much help.
>
>> unauthorized:
>> help-*.pd
>> class_sethelpsymbol(*_class, gensym("help-*.pd"));
>
> See maxlib.
>
>> zexy:
>> *.pd
>> class_sethelpsymbol(*_class, gensym("zexy/*"));
>
> See maxlib.
>
>> There are other cases, but that's just what I came up with quickly.
>
> I think, external packages should be fixed by the maintainers. If
> there is a consensus, things should be rather easy to adapt.
This, in combination with Marc's perl script for renaming the files
themselves, and looks like we have a solution. Marc: does your script
rename help-*.pd files to *-help.pd also?
I think it would probably be easiest once we have the regexs and the
perl script if someone just did all of the help files in CVS, unless
anyone objects. I am willing (I think...) to do this with perl script
and regex in hand. I am very eager to have a fully functional version
of my new MacOS X distro. Then I can settle in and start some Pd
projects that I have for October.
.hc
More information about the Pd-dev
mailing list