summaryrefslogtreecommitdiff
path: root/tex/context/base/core-sys.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/core-sys.mkiv')
-rw-r--r--tex/context/base/core-sys.mkiv80
1 files changed, 57 insertions, 23 deletions
diff --git a/tex/context/base/core-sys.mkiv b/tex/context/base/core-sys.mkiv
index 66f2a4380..249500e0a 100644
--- a/tex/context/base/core-sys.mkiv
+++ b/tex/context/base/core-sys.mkiv
@@ -36,21 +36,31 @@
%D line ending. I hate this mess.
\edef\operatingsystem {\cldcontext{os.platform}}
-\def \jobfilename {\cldcontext{environment.jobfilename or ""}}
-\def \jobfilesuffix {\cldcontext{environment.jobfilesuffix or ""}}
-\def \inputfilebarename{\cldcontext{environment.inputfilebarename or ""}}
-\def \inputfilesuffix {\cldcontext{environment.inputfilesuffix or ""}}
-\def \inputfilename {\cldcontext{environment.inputfilename or ""}}
-\def \outputfilename {\cldcontext{environment.outputfilename or ""}}
+
+%D The jobname is what gets loaded by the cont-yes stub file. This name
+%D also determines the name of tuc etc files.
+
+\def \jobfilename {\cldcontext{environment.jobfilename or ""}}
+\def \jobfilesuffix {\cldcontext{environment.jobfilesuffix or ""}}
+
+%D However, that one can itself load another file.
+
+\def \inputfilebarename {\cldcontext{environment.inputfilebarename or ""}}
+\def \inputfilerealsuffix{\cldcontext{environment.inputfilerealsuffix or ""}}
+\def \inputfilesuffix {\cldcontext{environment.inputfilesuffix or ""}}
+\def \inputfilename {\cldcontext{environment.inputfilename or ""}}
+
+%D The output name is only used for some checking.
+
+\def \outputfilename {\cldcontext{environment.outputfilename or ""}}
\installcorenamespace{system}
\installdirectcommandhandler \??system {system}
\appendtoks
- \edef\outputresolution{\directsystemparameter\c!resolution}%
- \edef\outputfilename {\directsystemparameter\c!file }%
- \edef\inputfilename {\directsystemparameter\c!inputfile }%
+% \edef\outputfilename {\directsystemparameter\c!file }%
+% \edef\inputfilename {\directsystemparameter\c!inputfile }%
\to \everysetupsystem
\appendtoks
@@ -75,9 +85,9 @@
\setsystemmode{suffix-\m_system_job_suffix}%
\to \everysetupsystem
-\appendtoks
- \ctxcommand{updatefilenames("\inputfilename","\outputfilename")}%
-\to \everysetupsystem
+% \appendtoks
+% \ctxcommand{updatefilenames("\jobame","\inputfilename","\outputfilename")}%
+% \to \everysetupsystem
% Some mechanisms (see x-res-01) use either \jobfilename or
% \jobfilename.somesuffix, in which case we need to use the
@@ -104,6 +114,10 @@
%D \NC \type{\operatingsystem} \NC \operatingsystem \NC \NR
%D \stoptabulate
+\appendtoks
+ \edef\outputresolution{\directsystemparameter\c!resolution}%
+\to \everysetupsystem
+
%D The system modes set by the setup command can be used in
%D situations like:
%D
@@ -138,9 +152,9 @@
[\c!directory=,
\c!n=0, % 0:unknown 1: one run 2: first 3: successive 4: final run
\c!resolution=600,% in dpi, no unit in mkiv
- %c!random=, % obsolete here
- \c!file=\jobname,
- \c!inputfile=\outputfilename,
+ % \c!random=, % obsolete here
+ % \c!file=\jobname,
+ % \c!inputfile=\outputfilename,
\c!type=unix, % windows is normally less sensitive to handle
\c!bodyfont=\normalizedlocalbodyfontsize] % of iets anders
@@ -150,14 +164,34 @@
%D But anyway, in \MKIV\ we avoid most of the complications anyway as we
%D deal with much at the \LUA\ end.
-\def\complexstart[#1]{\bgroup\getvalue{\e!start#1}}
-\def\complexstop [#1]{\getvalue{\e!stop #1}\egroup}
-
-\let\simplestart\bgroup
-\let\simplestop \egroup
-
-\definecomplexorsimple\start
-\definecomplexorsimple\stop
+\unexpanded\def\start
+ {\dosingleempty\syst_start}
+
+\def\syst_start
+ {\bgroup
+ \iffirstargument
+ \expandafter\syst_start_yes
+ \else
+ \expandafter\syst_start_nop
+ \fi}
+
+\def\syst_start_yes[#1]%
+ {\edef\m_syst_start_stop{#1}%
+ \ifx\m_syst_start_stop\empty
+ \let\syst_stop_indeed\donothing
+ \else\ifcsname\e!start\m_syst_start_stop\endcsname
+ \let\expandafter\syst_stop_indeed\csname\e!stop\m_syst_start_stop\endcsname
+ \csname\e!start\currentstartstop\expandafter\expandafter\expandafter\endcsname
+ \else
+ \let\syst_stop_indeed\donothing
+ \fi\fi}
+
+\def\syst_start_nop[#1]%
+ {\let\syst_stop_indeed\donothing}
+
+\unexpanded\def\stop
+ {\syst_stop_indeed
+ \egroup}
% \c!before \c!after \c!inbetween \c!commands \c!style \c!color