diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-24 23:40:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-24 23:40:06 +0000 |
commit | 76955d84451b6ee69a2420d86c0a2c2eeea06d7d (patch) | |
tree | 9ea031f2f8081f4a2eff050752be62fe48c47ef4 /Master/texmf-dist/source | |
parent | 306f3a8701f9ffc15a69bf77f89777b162de87d6 (diff) |
morewrites (24aug12)
git-svn-id: svn://tug.org/texlive/trunk@27516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/morewrites/morewrites.dtx | 70 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/morewrites/primargs.dtx | 13 |
2 files changed, 53 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/latex/morewrites/morewrites.dtx b/Master/texmf-dist/source/latex/morewrites/morewrites.dtx index 4766f3abe5e..cb1f7da2b54 100644 --- a/Master/texmf-dist/source/latex/morewrites/morewrites.dtx +++ b/Master/texmf-dist/source/latex/morewrites/morewrites.dtx @@ -11,9 +11,6 @@ %% %% ----------------------------------------------------------------------- % -%<*driver|package> -\RequirePackage{l3names} -%</driver|package> %<*driver> \RequirePackage{morewrites} \documentclass[full]{l3doc} @@ -29,9 +26,9 @@ % % \title{The \textsf{morewrites} package: \\ % Always room for a new \cs{write}\thanks{This -% file has version number v0.2, last revised 2012-07-10.}} +% file has version number v0.2c, last revised 2012/08/24.}} % \author{Bruno Le Floch} -% \date{July 10, 2012} +% \date{2012/08/24} % % \maketitle % \tableofcontents @@ -64,12 +61,15 @@ % bundle needs to be up to date. If Heiko Oberdiek's package % \pkg{atbegshi} is available, it will be used. % -% \section{Known deficiencies} +% \section{Known deficiencies and open questions} % % Some distributions of \TeX{} allow a quoted syntax for file names with % spaces. I haven't yet coded that. A temporary fix is to avoid file % names with spaces. % +% The current code trims spaces at the end of every line that is written +% to a file. I might be able to change the code to avoid this. +% % The package code is not very legible, and definitely uses too many % |:D| control sequences, whose name means \enquote{do not use}. The % author does not see a way to avoid using primitives in this package, @@ -79,6 +79,12 @@ % code with \pkg{expl3}; go and see Joseph Wright's \pkg{siunitx} % instead.} % +% Things that I need to do. +% \begin{itemize} +% \item Redefine the \LaTeX3 functions to use \pkg{morewrites} too? +% \item Should \tn{newwrite} be protected? +% \end{itemize} +% % \end{documentation} % % \begin{implementation} @@ -87,9 +93,10 @@ % %<*package> % \begin{macrocode} +\RequirePackage {expl3} [2012/08/14] +\RequirePackage {primargs} [2012/08/24] \ProvidesExplPackage - {morewrites} {2012/07/10} {0.2} {Always room for a new write} -\RequirePackage{expl3, primargs} + {morewrites} {2012/08/24} {0.2c} {Always room for a new write} % \end{macrocode} % % \begin{macrocode} @@ -182,6 +189,15 @@ % assignment of the form \tn{toks}|0=|\meta{general text}. % \end{itemize} % +% \subsection{Variants} +% +% \begin{macro}[aux]{\prop_gpop:NVNT} +% We need this function later. +% \begin{macrocode} +\cs_generate_variant:Nn \prop_gpop:NnNT { NV } +% \end{macrocode} +% \end{macro} +% % \subsection{Renaming primitives (again)} % % \begin{macro}[int] @@ -306,7 +322,7 @@ \tex_aftergroup:D #1 \primargs_remove_equals:N \@@_parse_file_name: } -\cs_new_protected:Npn \@@_parse_file_name: +\cs_new_protected_nopar:Npn \@@_parse_file_name: { \primargs_get_file_name:N \group_end: } % \end{macrocode} % \end{macro} @@ -394,8 +410,7 @@ % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_immediate_closeout_aux: { - \exp_args:NNV \prop_pop:NnNT \g_@@_iow_prop - \g_@@_stream_int \l_@@_internal_tl + \prop_gpop:NVNT \g_@@_iow_prop \g_@@_stream_int \l_@@_internal_tl { \@@_immediate_write_and_close:nn { \g_@@_stream_int } { \l_@@_internal_tl } @@ -480,7 +495,7 @@ % \begin{macrocode} \cs_new_protected_nopar:Npn \@@_immediate_write_aux:n { - \prop_if_in:NVTF \g_@@_iow_prop \g_@@_stream_int + \prop_get:NVNTF \g_@@_iow_prop \g_@@_stream_int \l_@@_internal_tl { \@@_immediate_write_open:n } { \@@_immediate_write_closed:n } } @@ -562,8 +577,6 @@ % strange delimiters). After each shipout, we can read the file to see % which output operations we need to perform, and in what order. % -% ^^A todo: check "_nopar"? -% % \subsubsection{Replacement for primitives} % % \begin{macro}[aux]{\@@_late:n} @@ -654,6 +667,18 @@ % % \subsubsection{Shipout business} % +% In this section, we hook into the \cs{shipout} primitive, and redefine +% it to first build a box with the material to ship out, then perform +% \begin{quote} +% \cs{@@_before_shipout:} \\ +% \meta{primitive shipout} \meta{collected box} \\ +% \cs{@@_after_shipout:} +% \end{quote} +% This is correct even if the values of the \tn{newlinechar} is changed +% within the user code which builds the shipped out box, because the +% value that \TeX{} uses is the value in effect immediately after +% \tn{shipout}. +% % \begin{macro}[aux]{\@@_before_shipout:} % Immediately before the shipout, we must open the writing stream % \cs{g_@@_iow}. Each delayed output operation has been replaced by @@ -671,7 +696,6 @@ % \end{macrocode} % \end{macro} % -%% ^^A todo: \shipout{\immediate\write4{}} => bug. % \begin{macro}[aux]{\@@_after_shipout:} % \begin{macro}[aux, rEXP]{\@@_after_shipout_loop:ww} % Immediately after all the \tn{write}s are performed, close the file, @@ -700,13 +724,13 @@ \tl_map_inline:nn { `(0123456789) } { \char_set_catcode_other:n {`##1} } \etex_everyeof:D { `() \exp_not:N } - \exp_args:NNx + \tl_gset:Nx \g_@@_internal_tl + { + \exp_after:wN \@@_after_shipout_loop:ww + \tex_input:D \g_@@_tmp_file_tl \c_space_tl + } \group_end: - \tl_map_inline:nn - { - \exp_after:wN \@@_after_shipout_loop:ww - \tex_input:D \g_@@_tmp_file_tl \c_space_tl %^^A bug? - } + \tl_map_inline:Nn \g_@@_internal_tl { \tl_use:c { c_@@_late_write_ ##1 _tl } } } \cs_new:Npn \@@_after_shipout_loop:ww #1 `( #2 ) @@ -841,8 +865,8 @@ % We need to allow \cs{newwrite} to allocate more than $16$ writes, % but beware that $18$ is reserved, and that packages might expect % $16$ or $17$ to write to the terminal. So instead skip until $20$, -% to be on the safe side. -% % ^^A todo: redefine the LaTeX3 things too? +% to be on the safe side. This really ought to be \tn{protected}, but +% none of the formats does that. % \begin{macrocode} \cs_new:Npn \@@_newwrite:N #1 { diff --git a/Master/texmf-dist/source/latex/morewrites/primargs.dtx b/Master/texmf-dist/source/latex/morewrites/primargs.dtx index a88bc6169e8..cff44ae4fb3 100644 --- a/Master/texmf-dist/source/latex/morewrites/primargs.dtx +++ b/Master/texmf-dist/source/latex/morewrites/primargs.dtx @@ -11,9 +11,6 @@ %% %% ----------------------------------------------------------------------- % -%<*driver|package> -\RequirePackage{l3names} -%</driver|package> %<*driver> \documentclass[full]{l3doc} \newcommand{\proc}[1]{\texttt{#1}} @@ -25,9 +22,9 @@ % % \title{The \textsf{primargs} package: \\ % Parsing arguments of primitives\thanks{This -% file has version number v0.1, last revised 2012-07-10.}} +% file has version number v0.2c, last revised 2012/08/24.}} % \author{Bruno Le Floch} -% \date{2012-07-10} +% \date{2012/08/24} % % \maketitle % \tableofcontents @@ -151,9 +148,9 @@ % %<*package> % \begin{macrocode} +\RequirePackage {expl3} [2012/08/14] \ProvidesExplPackage - {primargs}{2012/07/10}{0.1}{Parsing~arguments~of~primitives} -\RequirePackage{expl3} + {primargs} {2012/08/24} {0.2c} {Parsing arguments of primitives} % \end{macrocode} % % \begin{macrocode} @@ -465,6 +462,8 @@ \msg_warning:nn { primargs } { get-mudimen } \primargs_get_muglue:N } +\msg_new:nnn { primargs } { get-mudimen } + { The~\iow_char:N\\primargs_get_mudimen:N~function~is~buggy. } % \end{macrocode} % \end{macro} % |