diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-02 21:38:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-02 21:38:04 +0000 |
commit | c4ee329d9de36c54e6715838a7617a385228e519 (patch) | |
tree | 425aed8cb12860211598c572beea774479d8b351 /Master/texmf-dist/source/latex/l3kernel/expl3.dtx | |
parent | d59eb254bbc4402d6e35a1e112e652643512faa3 (diff) |
l3 (2sep20)
git-svn-id: svn://tug.org/texlive/trunk@56245 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/expl3.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/expl3.dtx | 121 |
1 files changed, 45 insertions, 76 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 85284e594ac..9e38bfb6dbb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2020-08-07}% +\def\ExplFileDate{2020-09-01}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2020-08-07} +% \date{Released 2020-09-01} % % \maketitle % @@ -924,10 +924,13 @@ % \item[dvips] Use the \texttt{dvips} driver. % \item[dvipdfmx] Use the \texttt{dvipdfmx} driver. % \item[dvisvgm] Use the \texttt{dvisvgm} driver. -% \item[pdfmode] Use the \texttt{pdfmode} driver (direct PDF output from -% \pdfTeX{} or \LuaTeX{}). -% \item[xdvipdfmx] Use the \texttt{xdvipdfmx} driver (\XeTeX{} only). +% \item[luatex] Use the direct PDF output mode of \LuaTeX{} +% \item[pdftex] Use the direct PDF output mode of \pdfTeX{} +% \item[xetex] Use the \XeTeX{} version of the \texttt{dvipdfmx} driver. % \end{itemize} +% For historical reasons, there is also \texttt{pdfmode} as an equivalent of +% \texttt{luatex} or \texttt{pdftex}, and \texttt{xdvipdfmx} as +% an equivalent to \texttt{xetex}, but these are deprecated % % \DescribeOption{suppress-backend-headers} % The \texttt{suppress-backend-headers} option suppresses loading of @@ -1064,8 +1067,10 @@ % \url{https://github.com/latex3/latex3/issues/781}). % \begin{macrocode} %<*2ekernel> -\global\expandafter\let\csname\detokenize - {c__kernel_expl_date_tl}\endcsname\ExplFileDate +\unless\ifcsname\detokenize{c__kernel_expl_date_tl}\endcsname + \global\expandafter\let\csname\detokenize + {c__kernel_expl_date_tl}\endcsname\ExplFileDate +\fi %</2ekernel> % \end{macrocode} % \end{macro} @@ -1243,86 +1248,50 @@ %<@@=expl> % \end{macrocode} % -% Several times users reported this error when loading \pkg{expl3}: -% \begin{verbatim} -% ! Undefined control sequence. -% l.67 \bool -% _new:N \g__expl_reload_bool -% \end{verbatim} -% raised in the reload block below. This happens because the reload -% check below assumes that if the boolean \cs{g_@@_reload_bool} doesn't -% exist, this file is being loaded for the first time, and \pkg{expl3} -% syntax is on. This is a bit of a stretch for assumptions, but it's -% valid as long as everything's in sync. However the problem reported -% happened because of a stray format file in the user tree which didn't -% have the reload code defined here (commit \texttt{1d16336}), so the -% \cs{g_@@_reload_bool} doesn't exist, but \pkg{expl3} syntax is off, -% thus the error. -% -% At this point, if we have \cs{c__kernel_expl_date_tl} defined, the -% situation is straightforward: if it matches \cs{ExplLoaderFileDate}, -% then everything's as expected, so no need to worry. If it doesn't, -% then the current version of \pkg{expl3} differs from the one in the -% format, so raise a fatal error: the bahaviour is too unpredictable to -% continue safely. Also, if the error is to be raised, then we're -% reloading, which means that \pkg{expl3} syntax is off, so we turn it -% on for the message. +% At this point, if we have \cs{c__kernel_expl_date_tl} defined, just +% call the \cs{__kernel_dependency_version_check:Nn} auxiliary to check +% if it matches \cs{ExplLoaderFileDate}. Here the test is performed +% only if \cs{c__kernel_expl_date_tl} exists because this file can be +% loaded in a \LaTeXe{} format without \pkg{expl3} preloaded, where that +% token list doesn't exist. +% +% This is all done in the \texttt{package} \pkg{docstrip} guard because +% it doesn't apply to \pkg{expl3.ltx}. % \begin{macrocode} +%<*package> \ifcsname\detokenize{c__kernel_expl_date_tl}\endcsname - \expandafter\ifx\csname\detokenize - {c__kernel_expl_date_tl}\endcsname\ExplLoaderFileDate - \else - \ExplSyntaxOn - \__kernel_msg_set:nnn { kernel } { mismatched-expl3 } - { - Mismatched~expl3~detected!~Loading~expl3~will~abort. - \\ \\ - The~version~of~expl3~preloaded~in~LaTeX~is~ - \c__kernel_expl_date_tl,~but~the~version~of~expl3~you~are~ - trying~to~load~is~dated~\ExplLoaderFileDate.~This~is~most~ - likely~due~to~a~stray~format~file~in~the~user~tree.~Please~ - make~sure~that~your~LaTeX~format~is~updated. - } - \exp_after:wN \ExplSyntaxOff \use:n - { - \__kernel_msg_critical:nn { kernel } { mismatched-expl3 } - \use:c { fi: } \use:c { fi: } - } - \fi + \expandafter\@firstofone +\else % \end{macrocode} -% If \cs{c__kernel_expl_date_tl} does \emph{not} exist, then we're on -% uncharted lands (that is, any time prior to the version that -% introduced this token list :-). Two cases might be here, depending -% whether \pkg{expl3} is loaded into the kernel or not. If we're loading -% \pkg{expl3} \enquote{normally} as a package, \pkg{expl3} syntax is on. -% Otherwise it's already loaded in the kernel and we're reloading -% \file{expl3.sty} so (\file{expl3-code.tex} doesn't load again and) -% \pkg{expl3} syntax is off. +% If \cs{c__kernel_expl_date_tl} does \emph{not} exist we may be loading +% in a format without \pkg{expl3} preloaded or in the earlier (although +% still compatible) version in which the error mentioned above showed +% up. If loading as a package, \file{expl3-code.tex} got read and here +% the \pkg{expl3} syntax is on. Otherwise it was already loaded in a +% sligtly older kernel, so we fire the incompatibility error message and +% abort loading. % \begin{macrocode} -\else \ifodd\csname\detokenize{l__kernel_expl_bool}\endcsname % \end{macrocode} -% Package mode; all should be fine, since \file{expl3.sty} and -% \file{expl3-code.tex} are both loaded in one go, so versions should -% match (if they don't, it's detected above). -% Also, we've just tested that \pkg{expl3} syntax is on, so the reload -% test below will return false and \cs{bool_new:N} will run correctly. +% In package mode all files are loaded in one go, so versions will +% match. We just have to set \cs{c__kernel_expl_date_tl} so that +% further dependencies don't break: % \begin{macrocode} + \global\expandafter\let\csname\detokenize + {c__kernel_expl_date_tl}\endcsname\ExplLoaderFileDate + \expandafter\expandafter + \expandafter\@gobble \else % \end{macrocode} -% In this branch we're reloading, but there are still two cases to -% consider (sigh\ldots); whether the version preloaded in the format -% is recent enough to have \cs{g_@@_reload_bool} (2020-06-18 and -% later) or not. If the boolean is there, we have to do nothing -% because right ahead we deal with this case. -% If it is not, we just have to create it: +% And reloading in an incompatible version is an error: % \begin{macrocode} - \ExplSyntaxOn - \bool_if_exist:NF \g_@@_reload_bool - { \bool_new:N \g_@@_reload_bool } - \ExplSyntaxOff + \expandafter\expandafter + \expandafter\@firstofone \fi \fi + {\csname\detokenize{__kernel_dependency_version_check:Nn}\endcsname + \ExplLoaderFileDate{expl3.sty}}% +%</package> % \end{macrocode} % % Here we can also detect whether we're reloading. This code goes into @@ -1403,7 +1372,7 @@ \keys_define:nn { sys } { backend .choices:nn = - { dvipdfmx , dvips , dvisvgm , pdfmode , xdvipdfmx } + { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex } { \sys_load_backend:n {#1} } , check-declarations .code:n = { |