blob: f9edc73dc1302018f6a46af6522531d8946191d8 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
%D \module
%D [ file=filt-ini,
%D version=2000.09.19,
%D title=\CONTEXT\ Filter Macros,
%D subtitle=Initialization,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%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 Filter Macros (ini)}
% \ifx\OmegaVersion\undefined
% \let\definefiltersynonym \gobbledoubleempty
% \let\definefiltersequence \gobbledoubleempty
% \unexpanded\def\usefiltersequence {\gobblesingleempty}
% \let\usefilter \gobblesingleempty
% \let\truefiltername \gobbleoneargument
% \expandafter \endinput
% \fi
\unprotect
%D The real work starts here.
\startmessages dutch library: filters
title: filter
1: filter -- wordt geladen
2: onbekend filter --
\stopmessages
\startmessages english library: filters
title: filter
1: filter -- is loaded
2: unknown filter --
\stopmessages
\startmessages german library: filters
title: filter
1: filter -- is loaded
2: unknown filter --
\stopmessages
\startmessages czech library: filters
title: filter
1: filter -- is loaded
2: unknown filter --
\stopmessages
\startmessages italian library: filters
title: filtri
1: filtro -- caricato
2: filtro sconosciuto --
\stopmessages
\startmessages french library: filters
title: filter
1: le filtre -- est chargé
2: filtre -- inconnu
\stopmessages
%D \macros
%D {definefiltersynonym}
\def\definefiltersynonym
{\dodoubleargument\dodefinefiltersynonym}
\def\dodefinefiltersynonym[#1][#2]%
{\setvalue{\??or#1}{#2}}
%D \macros
%D {truefiltername}
\def\truefiltername#1%
{\ifundefined{\??or#1}#1\else\truefiltername{\getvalue{\??or#1}}\fi}
%D \macros
%D {definefiltersequence}
\def\definefiltersequence%
{\dodoubleargument\dodefinefiltersequence}
\def\dodefinefiltersequence[#1][#2]%
{\setvalue{\??ot#1}{#2}}
%D \macros
%D {usefiltersequence}
%D
\def\magicocpnumber{1}
% \def\dodousefiltersequence#1%
% {\expandafter\ocp\csname\??or:#1\endcsname=\truefiltername{#1}\relax
% \@EA \appendtoks
% \@EA \addbeforeocplist \@EA \magicocpnumber \csname\??or:#1\endcsname
% \to \scratchtoks}
% one can do:
%
% \definefiltersequence
% [farsi]
% [utf8 to unicode16=>5,
% persian fix,
% arabic analysis=>3,
% arabic glyphs]
%
% so, => is used to signal a priority
\def\dodousefiltersequence#1%
{\expandafter\ocp\csname\??or:#1\endcsname=\truefiltername{#1}\relax
\splitstring#1\at=>\to\!!stringa\and\!!stringb
\edef\!!stringb{\number\ifx\!!stringb\empty\magicocpnumber\else\!!stringb\fi}%
\appendetoks
\noexpand\addbeforeocplist
\!!stringb\space
\expandafter\noexpand\csname\??or:\!!stringa\endcsname
\to \scratchtoks}
\unexpanded\def\usefiltersequence[#1]%
{\edef\currentfiltersequence{\getvalue{\??ot#1}}%
\scratchtoks\emptytoks
\processcommacommand[\currentfiltersequence]\dodousefiltersequence
% \showthe\scratchtoks
\expanded{\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist
\expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}
%D \macros
%D {usefilter}
\def\dousefilter#1%
{\doifundefined{\c!file\f!filterprefix#1}%
{\letvalue{\c!file\f!filterprefix#1}\empty
\makeshortfilename[\truefilename{\f!filterprefix#1}]%
\startreadingfile
\readsysfile\shortfilename
{\showmessage\m!filters1{#1}}
{\showmessage\m!filters2{#1}}%
\stopreadingfile}}
\def\usefilter[#1]%
{\processcommalist[#1]\dousefilter}
\protect \endinput
|