Hi, (mostly for Thomas) In the next beta: When you include files in another file (using xmlinclude) we now register what gets included. There are two new commands: \xmlinclusion{#1} : the current inclusion \xmlinclusions{#1} : a list of inclusions the first one backtracks till it find a name and the second one will locate the root if needed. This option can be handy for tracing (i.e. seeing where input comes from). Another addition is that \definemode[something][keep] define an undefined mode; the keep makes sure that the already set value is kept (another option is 'yes'). Using defined modes (that is, set with: \enabledmode, \disablemode or \definemode) can be tested about twice as fast as undefined modes which can make a small difference when modes are tested lots of times. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 26 Jun 2014, at 12:08, Hans Hagen
wrote: Another addition is that
\definemode[something][keep]
define an undefined mode; the keep makes sure that the already set value is kept (another option is 'yes').
Using defined modes (that is, set with: \enablemode, \disablemode or \definemode) can be tested about twice as fast as undefined modes which can make a small difference
I do not understand this fully: - if the mode is undefined, how can "define an undefined mode" for a mode that has already been given a value with either \enablemode or \disablemode keep a value? Must not \enablemode, \disablemode do some sort of 'defining' in order to facilitate testing? Does "define" here implements some other mechanism than the 'defining' done by \enablemod, \disablemode? Is this what happens: - if \enablemode or \disablemode has been used before to set a value for the mode, than \definemode[themode][keep] stashes some special definition of that mode and does not change c.q. transfers its value; - \definemode[themode][yes] and \definemode[themode][no] always set that value for the mode in case, regardless of what has been done by a preceding \enablemode or \disablemode. Is that the correct interpretation? Just to make sure I understand. Finally, when \definemode makes testing a lot faster why than not implement this always? That is, using \enablemode or \disablemode the first time implies a \definemode for that mode. Doing so avoids another macro to remember: less clutter for my brain ;-) Hans van der Meer
On 5/22/2016 10:07 AM, Meer, Hans van der wrote:
On 26 Jun 2014, at 12:08, Hans Hagen
wrote: Another addition is that
\definemode[something][keep]
define an undefined mode; the keep makes sure that the already set value is kept (another option is 'yes').
Using defined modes (that is, set with: \enablemode, \disablemode or \definemode) can be tested about twice as fast as undefined modes which can make a small difference
I do not understand this fully: - if the mode is undefined, how can "define an undefined mode" for a mode that has already been given a value with either \enablemode or \disablemode keep a value? Must not \enablemode, \disablemode do some sort of 'defining' in order to facilitate testing? Does "define" here implements some other mechanism than the 'defining' done by \enablemod, \disablemode?
it's more an internal issue. less checking at the tex end and so .. it's only relevant when you check modes tens of thousands of times in a run
Is this what happens: - if \enablemode or \disablemode has been used before to set a value for the mode, than \definemode[themode][keep] stashes some special definition of that mode and does not change c.q. transfers its value; - \definemode[themode][yes] and \definemode[themode][no] always set that value for the mode in case, regardless of what has been done by a preceding \enablemode or \disablemode.
Is that the correct interpretation? Just to make sure I understand.
Finally, when \definemode makes testing a lot faster why than not implement this always? That is, using \enablemode or \disablemode the first time implies a \definemode for that mode. Doing so avoids another macro to remember: less clutter for my brain ;-)
because one property of modes is that one doesn't have to define them, you'd be quite unhappy if you would have to define all possible modes that could be introduced in styles Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 22 May 2016, at 15:11, Hans Hagen
On 5/22/2016 3:33 PM, Meer, Hans van der wrote:
On 22 May 2016, at 15:11, Hans Hagen
mailto:pragma@wxs.nl> wrote: Finally, when \definemode makes testing a lot faster why than not implement this always? That is, using \enablemode or \disablemode the first time implies a \definemode for that mode. Doing so avoids another macro to remember: less clutter for my brain ;-)
because one property of modes is that one doesn't have to define them, you'd be quite unhappy if you would have to define all possible modes that could be introduced in styles
The idea was not to have the user define the mode, but let ConTeXt automatically do the defining when it encounters a specific mode the first time. The work is done by ConTeXt then (would make me even more happy ;-)
it does define them when undefined but even then it gets a special state (modes can be in enable, disable or prevent state) normnally it's not something a user need to worry about Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Meer, Hans van der