[latex3-commits] [git/LaTeX3-latex3-latex3] master: Alter nature of \c_sys_jobname_str (7b3169543)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Oct 27 09:49:28 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/7b3169543852f1297563cafd60793936ddfafa2e

>---------------------------------------------------------------

commit 7b3169543852f1297563cafd60793936ddfafa2e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Oct 27 08:49:28 2019 +0000

    Alter nature of \c_sys_jobname_str
    
    This will be needed as part of preloading.


>---------------------------------------------------------------

7b3169543852f1297563cafd60793936ddfafa2e
 l3kernel/CHANGELOG.md |  1 +
 l3kernel/l3sys.dtx    | 23 +++++++++++++++--------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 4ee2ce732..17c080110 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Changed
 
+- Internal structure of `\c_sys_jobname_str` altered
 - Update upTeX test to follow guidance from developers
 
 ## [2019-10-24]
diff --git a/l3kernel/l3sys.dtx b/l3kernel/l3sys.dtx
index 9aebfcc19..effa5ebcb 100644
--- a/l3kernel/l3sys.dtx
+++ b/l3kernel/l3sys.dtx
@@ -51,11 +51,12 @@
 %
 % \section{The name of the job}
 %
-% \begin{variable}[added = 2015-09-19]{\c_sys_jobname_str}
+% \begin{variable}[added = 2015-09-19, updated = 2019-10-27]{\c_sys_jobname_str}
 %   Constant that gets the \enquote{job name} assigned when \TeX{} starts.
 %   \begin{texnote}
-%     This copies the contents of the primitive \tn{jobname}. It is a constant
-%     that is set by \TeX{} and should not be overwritten by the package.
+%     This copies the contents of the primitive \tn{jobname}. For technical
+%     reasons, the string here is not of the same internal form as other,
+%     but may be manipulated using normal string functions.
 %   \end{texnote}
 % \end{variable}
 %
@@ -603,12 +604,16 @@
 % \subsubsection{The name of the job}
 %
 % \begin{variable}{\c_sys_jobname_str}
-%   Inherited from the \LaTeX3 name for the primitive: this needs to
-%   actually contain the text of the job name rather than the name of
-%   the primitive, of course.
+%   Inherited from the \LaTeX3 name for the primitive. This \emph{has} to be
+%   the primitive as it's set in \tn{everyjob}. If the user does
+%   \begin{verbatim}
+%     pdflatex \input some-file-name
+%   \end{verbatim}
+%   then \tn{everyjob} is inserted \emph{before} \tn{jobname} is changed form
+%   |texput|, and thus we would have the wrong result.
 %    \begin{macrocode}
 \@@_everyjob:n
-  { \str_const:Nx \c_sys_jobname_str { \tex_jobname:D } }
+  { \cs_new_eq:NN \c_sys_jobname_str \tex_jobname:D }
 %    \end{macrocode}
 % \end{variable}
 %
@@ -748,9 +753,11 @@
 % \subsubsection{Held over from \pkg{l3file}}
 %
 % \begin{variable}{\g_file_curr_name_str}
+%   See comments about \cs{c_sys_jobname_str}: here, as soon as there is
+%   file input/output, things get \enquote{tided up}.
 %    \begin{macrocode}
 \@@_everyjob:n
-  { \str_gset:Nx \g_file_curr_name_str { \tex_jobname:D } }
+  { \cs_gset_eq:NN \g_file_curr_name_str \tex_jobname:D }
 %    \end{macrocode}
 % \end{variable}
 %





More information about the latex3-commits mailing list