blob: 8481048bb97ae7240043d9c050c470061b16bf90 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
%D \module
%D [ file=bndr-ini,
%D version=2022.05.02,
%D title=\CONTEXT\ Boundary Macros,
%D subtitle=Initialization,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\writestatus{loading}{ConTeXt Boundary Macros / Initialization}
\unprotect
\registerctxluafile{bndr-ini}{autosuffix}
% \defineboundary[foobar][public]\meaning\foobar\par
% \defineboundary[barfoo][public]\meaning\barfoo\par
\immutable\def\??boundaryprefix{c_bndr_}
\permanent\tolerant\protected\def\defineboundary[#1]#*[#2]% nicer for users
{\doifelseinset\s!public{#2}%
{\ifcsname#1\endcsname\else
\global\permanent\expandafter\integerdef\csname#1\endcsname\clf_defineboundary{#1}\relax
\fi}
{\ifcsname\??boundaryprefix#1\endcsname\else
\global\permanent\expandafter\integerdef\csname\??boundaryprefix#1\endcsname\clf_defineboundary{#1}\relax
\fi}}
\permanent\protected\def\newboundary#1% nicer for lowlevel
{\ifdefined#1\else
\global\immutable\integerdef#1\clf_defineboundary{\csstring#1}\relax
\fi}
\protect
|