trac-tex.mkiv /size: 2410 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=trac-tex,
3
%D version=2009.07.20,
4
%D title=\CONTEXT\ Tracking Macros,
5
%D subtitle=\TEX,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\writestatus
{
loading
}{
ConTeXt
Tracking
Macros
/
TeX
}
15 16
\registerctxluafile
{
trac
-
tex
}{}
17 18
%D All tracing flags at the \TEX\ end will be redone this way so
19
%D that we have a similar mechanism for \TEX\ and \LUA. Also, the
20
%D currently used if's might become conditionals.
21 22
\unprotect
23 24
% \def\enabletextracerwhatever {...}
25
% \def\disabletextracerwhatever{...}
26 27
\let
\alltextracers
\empty
% so that we can report available tracers
28 29
\unexpanded
\def
\installtextracer
#
1
%
30
{
\addtocommalist
{
#
1
}
\alltextracers
}
31 32
\unexpanded
\def
\enabletextracers
[#
1
]
{
\processcommalist
[#
1
]
\syst_textracers_enable
}
33
\unexpanded
\def
\disabletextracers
[#
1
]
{
\processcommalist
[#
1
]
\syst_textracers_disable
}
34 35
\def
\syst_textracers_enable
#
1
{
\begincsname
enabletracer
#
1
\endcsname
}
36
\def
\syst_textracers_disable
#
1
{
\begincsname
disabletracer
#
1
\endcsname
}
37 38
% The next one is for Taco, although we can use directives as well:
39 40
\unexpanded
\def
\nomkivstatistics
{
\enabledirectives
[
system
.
nostatistics
]
}
41 42
%D This is not really a tracker but for decades it lived in my \type {cont-loc}
43
%D file. I moved it here because I wanted someone else to use it. This macro is not
44
%D really useful for users. I kept the \LUA\ variant in \type {cont-loc.mkiv}.
45 46
\installcorenamespace
{
profilemacrocount
}
47
\installcorenamespace
{
profilemacromacro
}
48 49
\newtoks
\t_syst_profile
50 51
\appendtoks
52
\the
\t_syst_profile
53
\to
\everystoptext
54 55
\unexpanded
\def
\profilemacro
#
1
% an oldie, but modernized a bit
56
{
\edef
\p_name
{
\csstring
#
1
}
%
57
\ifcsname
\??profilemacrocount
\p_name
\endcsname
\else
58
\expandafter
\newcount
\csname
\??profilemacrocount
\p_name
\endcsname
59
\expandafter\let\csname
\??profilemacromacro
\p_name
\endcsname
#
1
%
60
\xtoksapp
\t_syst_profile
61
{
\writestatus
62
{
profile
}
%
63
{
\string
#
1
:
\noexpand\the\csname
\??profilemacrocount
\p_name
\endcsname
}}
%
64
\unexpanded
\xdef
#
1
%
65
{
\global\advance\csname
\??profilemacrocount
\p_name
\endcsname
\plusone
66
\expandafter\noexpand\csname
\??profilemacromacro
\p_name
\endcsname
}
%
67
\fi
}
68 69
\protect
\endinput
70