Repository: latex3/latex3

Issue #168: Various problems with g_file_current_name_tl
Created: 2014-05-28T21:47:50Z
The variable \g_file_current_name_tl is meant to contain the current file name.  There is code to set the right name when reading a file with \file_input:n (and when closing it, get back to the old name).  Four problems:

The initial value in package mode is the value of \@currname in effect when our tl is defined, namely expl3.
When loading an expl3-based package (or another package) the value of our tl is not updated.  We need to add code to \RequirePackage (probably that can be combined with what we already do to setup the \ExplSyntaxOn/Off correctly), and \LoadClass.
The value is not updated either when using \input or \include, but I don't think we should alter this, just document it (well, unless there is a convenient low-level macro we could touch?).
The initial value, \@currname, does not include the extension.  In contrast, when reading a file with \file_input:n, the name contains the extension.

Some of that probably also applies to our file list.

Duplicate issue #218: \file_input:n throws an error with a trivial use under pdftex
Created: 2015-07-05T03:46:37Z
Having forgotten about this issue tracker, I posted this on LaTeX-L as well. Sorry about the duplicates 😦

Possibly related: #168
The following files will throw an error when run with $ pdftex d1.tex.
d1.tex
\nonstopmode \input expl3-generic \relax \ExplSyntaxOn % -*- expl3 -*-
\file_input:n { d2 }
\bye

d2.tex
\msg_term:n { hello,~world }

The log file is attached.
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdftex 2015.5.24)  3 JUL 2015 18:53
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**d1.tex
(./d1.tex
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3-generic.tex
Package: expl3 2015/03/01 v5547 L3 programming layer (loader) 

(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3-code.tex
Package: expl3 2015/03/01 v5547 L3 programming layer (code) 
L3 Module: l3bootstrap 2015/02/28 v5542 L3 Bootstrap code
L3 Module: l3names 2015/02/24 v5535 L3 Namespace for primitives
L3 Module: l3basics 2015/01/27 v5500 L3 Basic definitions
L3 Module: l3expan 2014/11/27 v5472 L3 Argument expansion
L3 Module: l3tl 2015/01/27 v5500 L3 Token lists
L3 Module: l3str 2015/03/01 v5545 L3 Strings
L3 Module: l3seq 2014/08/23 v5354 L3 Sequences and stacks
L3 Module: l3int 2015/02/21 v5529 L3 Integers
\c_max_int=\count27
\l_tmpa_int=\count28
\l_tmpb_int=\count29
\g_tmpa_int=\count30
\g_tmpb_int=\count31
L3 Module: l3quark 2014/08/23 v5354 L3 Quarks
L3 Module: l3prg 2014/08/23 v5354 L3 Control structures
\g__prg_map_int=\count32
L3 Module: l3clist 2014/08/23 v5354 L3 Comma separated lists
L3 Module: l3token 2014/09/15 v5422 L3 Experimental token manipulation
L3 Module: l3prop 2014/08/23 v5354 L3 Property lists
L3 Module: l3msg 2015/02/26 v5537 L3 Messages
L3 Module: l3file 2014/08/24 v5369 L3 File and I/O operations
\l_iow_line_count_int=\count33
\l__iow_target_count_int=\count34
\l__iow_current_line_int=\count35
\l__iow_current_word_int=\count36
\l__iow_current_indentation_int=\count37
L3 Module: l3skip 2014/08/23 v5354 L3 Dimensions and skips
\c_zero_dim=\dimen16
\c_max_dim=\dimen17
\l_tmpa_dim=\dimen18
\l_tmpb_dim=\dimen19
\g_tmpa_dim=\dimen20
\g_tmpb_dim=\dimen21
\c_zero_skip=\skip18
\c_max_skip=\skip19
\l_tmpa_skip=\skip20
\l_tmpb_skip=\skip21
\g_tmpa_skip=\skip22
\g_tmpb_skip=\skip23
\c_zero_muskip=\muskip10
\c_max_muskip=\muskip11
\l_tmpa_muskip=\muskip12
\l_tmpb_muskip=\muskip13
\g_tmpa_muskip=\muskip14
\g_tmpb_muskip=\muskip15
L3 Module: l3keys 2015/01/27 v5500 L3 Key-value interfaces
\g__keyval_level_int=\count38
\l_keys_choice_int=\count39
L3 Module: l3fp 2014/08/22 v5336 L3 Floating points
\c__fp_leading_shift_int=\count40
\c__fp_middle_shift_int=\count41
\c__fp_trailing_shift_int=\count42
\c__fp_big_leading_shift_int=\count43
\c__fp_big_middle_shift_int=\count44
\c__fp_big_trailing_shift_int=\count45
\c__fp_Bigg_leading_shift_int=\count46
\c__fp_Bigg_middle_shift_int=\count47
\c__fp_Bigg_trailing_shift_int=\count48
L3 Module: l3box 2014/08/23 v5354 L3 Experimental boxes
\c_empty_box=\box16
\l_tmpa_box=\box17
\l_tmpb_box=\box18
\g_tmpa_box=\box19
\g_tmpb_box=\box20
L3 Module: l3coffins 2014/08/23 v5354 L3 Coffin code layer
\l__coffin_internal_box=\box21
\l__coffin_internal_dim=\dimen22
\l__coffin_offset_x_dim=\dimen23
\l__coffin_offset_y_dim=\dimen24
\l__coffin_x_dim=\dimen25
\l__coffin_y_dim=\dimen26
\l__coffin_x_prime_dim=\dimen27
\l__coffin_y_prime_dim=\dimen28
\c_empty_coffin=\box22
\l__coffin_aligned_coffin=\box23
\l__coffin_aligned_internal_coffin=\box24
\l_tmpa_coffin=\box25
\l_tmpb_coffin=\box26
\l__coffin_display_coffin=\box27
\l__coffin_display_coord_coffin=\box28
\l__coffin_display_pole_coffin=\box29
\l__coffin_display_offset_dim=\dimen29
\l__coffin_display_x_dim=\dimen30
\l__coffin_display_y_dim=\dimen31
L3 Module: l3color 2014/08/23 v5354 L3 Experimental color support
L3 Module: l3candidates 2015/03/01 v5544 L3 Experimental additions to l3kernel
\l__box_top_dim=\dimen32
\l__box_bottom_dim=\dimen33
\l__box_left_dim=\dimen34
\l__box_right_dim=\dimen35
\l__box_top_new_dim=\dimen36
\l__box_bottom_new_dim=\dimen37
\l__box_left_new_dim=\dimen38
\l__box_right_new_dim=\dimen39
\l__box_internal_box=\box30
\l__coffin_bounding_shift_dim=\dimen40
\l__coffin_left_corner_dim=\dimen41
\l__coffin_right_corner_dim=\dimen42
\l__coffin_bottom_corner_dim=\dimen43
\l__coffin_top_corner_dim=\dimen44
\l__coffin_scaled_total_height_dim=\dimen45
\l__coffin_scaled_width_dim=\dimen46
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
File: l3pdfmode.def 2014/10/16 v5435 L3 Experimental driver: PDF mode
\l__driver_color_stack_int=\count49
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/l3unicode-data.def
File: l3unicode-data.def 2015/03/01 v5544 L3 Unicode data
))
\g__file_internal_ior=\read1

! Undefined control sequence.
<argument> \g_file_current_name_tl 

\exp_args:NNo ...\exp_after:wN #2\exp_after:wN {#3
                                                  }
\__file_input_aux:n ...eq \g_file_current_name_tl 
                                                  \tl_gset:Nn \g_file_curren...
l.5 \file_input:n { d2 }

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

(./d2.tex
*************************************************
* hello, world
*************************************************
) )
No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Closing comment (2015-07-17T07:32:38Z): This is probably related to #168 .