On 9/21/2020 4:31 PM, Wolfgang Schuster wrote:
Taco Hoekwater schrieb am 21.09.2020 um 14:44:
Hi Hans,

On 15 Sep 2020, at 18:44, Hans Hagen <[email protected]> wrote:

(2) Another change is in the \startdocument mechanism. This (already old and rusted) wrapper runs on top of variables but we think no one knows (or uses) that. So, it now is a real wrapper with inheritance and such. It is dedicated to Tomas Hala who had to struggle with the old one but still gave a presentation using it. Here's an example:

\definedocument[thesis]

\setupdocument[a=b,e=f]
\setupdocument[thesis][a=x,c=d]

\startsetups[document:start]
    START
\stopsetups

\startsetups[thesis:stop]
    STOP
\stopsetups

\startthesis

    (\currentdocument/a): \documentvariable{a}\par
    (\currentdocument/c): \documentvariable{c}\par
    (\currentdocument/e): \documentvariable{e}\par

\stopthesis
The auto-inheritance of the setups does not work yet, because the \definedocument[thesis] does not
set up local version of the before= and after= keys of \startthesis.

\definedocument (re)defines the value of the actual setup “thesis:start” correctly to inherit the parent’s \directsetuo, but because the actual before and after keys are inherited from the (document) parent as well, the effect on \startthesis still remains equivalent to this:

    \setupdocument
      [thesis]
      [before=\directsetup{document:start},
       after=\directsetup{document:stop}]

So we need something like this:

\appendtoks
\setexpandeddocumentparameter\c!before{\noexpand\directsetup{\currentdocument:\v!start}}%   \setexpandeddocumentparameter\c!after {\noexpand\directsetup{\currentdocument:\v!stop }}%
\to \everydefinedocument
the reason i didn't make setups inheritable was mostly that I can't oversee the intensions (i played a bit with it; like defining setups as part of define so that we can have inherited setups) ... for instance what when we have a third level (say document -> thesis -> mythesis .. and we want to use the thesis setups)

i don't care what solution si chose as long as it doesn't break anything at my end

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
_______________________________________________
dev-context mailing list
[email protected]
https://mailman.ntg.nl/mailman/listinfo/dev-context

Reply via email to