From 7f3dfb9f769892bef6b4d1e272142c9e43ea3bf6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 25 Oct 2023 20:00:42 +0000 Subject: advice (25oct23) git-svn-id: svn://tug.org/texlive/trunk@68648 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/advice/CHANGELOG.md | 27 ++++++++++++++ Master/texmf-dist/doc/generic/advice/FILES | 3 +- Master/texmf-dist/doc/generic/advice/README.md | 11 ++++++ .../texmf-dist/source/generic/advice/advice.edtx | 42 +++++++++++++++++----- .../tex/context/third/advice/t-advice.tex | 9 +++-- .../tex/generic/advice/advice-tikz.code.tex | 3 +- Master/texmf-dist/tex/latex/advice/advice.sty | 9 +++-- Master/texmf-dist/tex/plain/advice/advice.tex | 11 ++++-- 8 files changed, 97 insertions(+), 18 deletions(-) create mode 100644 Master/texmf-dist/doc/generic/advice/CHANGELOG.md diff --git a/Master/texmf-dist/doc/generic/advice/CHANGELOG.md b/Master/texmf-dist/doc/generic/advice/CHANGELOG.md new file mode 100644 index 00000000000..63de5163a9f --- /dev/null +++ b/Master/texmf-dist/doc/generic/advice/CHANGELOG.md @@ -0,0 +1,27 @@ +# Advice changelog + +This package was developed as an auxiliary package of +[Memoize](https://ctan.org/pkg/memoize), and is documented alongside that +package. Note, however, that the Memoize manual, `memoize-doc.pdf`, is not +reissued for patch-level releases of Advice; the version of the Memoize manual +fully applicable to the particular version of Advice is indicated at each +version. + +Whenever the date of the Memoize manual is older than the release date of a +particular version of Advice, the documented source of Advice shown in that +version of `memoize-code.pdf` of course does not reflect the latest changes; in +those cases, please see [Memoize's GitHub +repository](https://github.com/sasozivanovic/memoize) for the recent +development history. + +## 2023/10/25 v1.0.1 +* Require package `xparse`, as `\GetDocumentCommandArgSpec` is being dropped + from the LaTeX kernel. +* Reimplement the tracing typeout routine (don't use `\write16`). + +Manual: Memoize 2023/10/10 v1.0.0 + +## 2023/10/10 v1.0.0 +* The initial release. + +Manual: Memoize 2023/10/10 v1.0.0 diff --git a/Master/texmf-dist/doc/generic/advice/FILES b/Master/texmf-dist/doc/generic/advice/FILES index 7389bea3d5d..8b1d96da492 100644 --- a/Master/texmf-dist/doc/generic/advice/FILES +++ b/Master/texmf-dist/doc/generic/advice/FILES @@ -1,9 +1,10 @@ doc/generic/advice/LICENCE doc/generic/advice/INSTALL.md +doc/generic/advice/CHANGELOG.md doc/generic/advice/FILES doc/generic/advice/README.md tex/latex/advice/advice.sty -tex/context/advice/t-advice.tex +tex/context/third/advice/t-advice.tex tex/plain/advice/advice.tex tex/generic/advice/advice-tikz.code.tex source/generic/advice/Makefile diff --git a/Master/texmf-dist/doc/generic/advice/README.md b/Master/texmf-dist/doc/generic/advice/README.md index 0b001d9df89..fa1e6294d92 100644 --- a/Master/texmf-dist/doc/generic/advice/README.md +++ b/Master/texmf-dist/doc/generic/advice/README.md @@ -6,3 +6,14 @@ This package was developed as an auxiliary package of [Memoize](https://ctan.org/pkg/memoize). This is why it is, somewhat unconventionally, documented alongside that package. This applies to both the manual and the documented code listing. + +# LICENCE + +This work may be distributed and/or modified under the conditions of the LaTeX +Project Public License, either version 1.3c of this license or (at your option) +any later version. The latest version of this license is in +https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all +distributions of LaTeX version 2008 or later. + +This work has the LPPL maintenance status `maintained'. The Current Maintainer +of this work is Sašo Živanović (saso.zivanovic@guest.arnes.si). diff --git a/Master/texmf-dist/source/generic/advice/advice.edtx b/Master/texmf-dist/source/generic/advice/advice.edtx index ee9486226ec..dcbdfb297e7 100644 --- a/Master/texmf-dist/source/generic/advice/advice.edtx +++ b/Master/texmf-dist/source/generic/advice/advice.edtx @@ -19,7 +19,8 @@ %% This work has the LPPL maintenance status `maintained'. %% The Current Maintainer of this work is Saso Zivanovic. %% -%% The files belonging to this work and covered by LPPL are listed in `FILES`. +%% The files belonging to this work and covered by LPPL are listed in +%% (/doc/generic/advice/)FILES. % % \fi % @@ -28,14 +29,14 @@ % \relax % %<*main> -%\ProvidesPackage{advice}[2023/10/10 v1.0.0 Extend commands and environments] +%\ProvidesPackage{advice}[2023/10/25 v1.0.1 Extend commands and environments] %%D \module[ %%D file=t-advice.tex, -%%D version=1.0.0, +%%D version=1.0.1, %%D title=Advice, %%D subtitle=Extend commands and environments, %%D author=Saso Zivanovic, -%%D date=2023-10-10, +%%D date=2023-10-25, %%D copyright=Saso Zivanovic, %%D license=LPPL, %%D ] @@ -43,9 +44,14 @@ %\unprotect %\startmodule[advice] % \paragraph{Required packages} +%\input miniltx %\RequirePackage{collargs} %\input collargs %\input t-collargs +% In \hologo{LaTeX}, we also require |xparse|. Even though +% |\NewDocumentCommand| and friends are integrated into the \hologo{LaTeX} +% kernel, |\GetDocumentCommandArgSpec| is only available through |xparse|. +%\RequirePackage{xparse} % % \subsubsection{Installation into a keypath} % @@ -959,10 +965,12 @@ } % \subsubsection{Tracing} % +% We implement tracing by adding the tracing information to the handlers after +% we load them. So it is the handlers themselves which, if and when they are +% executed, will print out that this is happening. +% % \begin{macro}{\AdviceTracingOn,\AdviceTracingOff} -% We implement tracing by adding the tracing information to the handlers -% after we load them. So it is the handlers themselves which, if and when -% they are executed, will print out that this is happening. +% Enable and disable tracing. \def\AdviceTracingOn{% \let\advice@init@i\advice@trace@init@i \let\advice@init@I\advice@trace@init@I @@ -972,7 +980,24 @@ \let\advice@init@I\advice@setup@init@I } % \end{macro} -\def\advice@trace#1{\immediate\write16{[tracing advice] #1}} +% \begin{macro}{\advice@typeout,\advice@trace} +% The tracing output routine; the typeout macro depends on the format. In +% \hologo{LaTeX}, we use stream |\@unused|, which is guaranteed to be +% unopened, so that the output will go to the terminal and the log. +% \hologo{ConTeXt}, we don't muck about with write streams but simply use Lua +% function |texio.write_nl|. In \hologo{plainTeX}, we use either Lua or the +% stream, depending on the engine; we use a high stream number 128 although +% the good old 16 would probably work just as well. +%\ifdefined\luatexversion + %\long\def\advice@typeout#1{\directlua{texio.write_nl("\luaescapestring{#1}")}} +%\else + %\def\advice@typeout{\immediate\write\@unused} + %\def\advice@typeout{\immediate\write128} +%\fi +\def\advice@trace#1{\advice@typeout{[tracing advice] #1}} +% \end{macro} +% \begin{macro}{\advice@trace@init@i,\advice@trace@init@I} +% Install the tracing code. \def\advice@trace@init@i#1#2{% \advice@trace{Advising \detokenize\expandafter{\string#2} (\detokenize{#1})}% \advice@setup@init@i{#1}{#2}% @@ -1033,6 +1058,7 @@ }% \def\AdviceInnerHandler{\advice@inner@handler@trace}% } +% \end{macro} %\resetatcatcode %\stopmodule %\protect diff --git a/Master/texmf-dist/tex/context/third/advice/t-advice.tex b/Master/texmf-dist/tex/context/third/advice/t-advice.tex index dcffe7205e3..e30bed0869a 100644 --- a/Master/texmf-dist/tex/context/third/advice/t-advice.tex +++ b/Master/texmf-dist/tex/context/third/advice/t-advice.tex @@ -23,20 +23,22 @@ %% This work has the LPPL maintenance status `maintained'. %% The Current Maintainer of this work is Saso Zivanovic. %% -%% The files belonging to this work and covered by LPPL are listed in `FILES`. +%% The files belonging to this work and covered by LPPL are listed in +%% (/doc/generic/advice/)FILES. %D \module[ %D file=t-advice.tex, %D version=1.0.1, %D title=Advice, %D subtitle=Extend commands and environments, %D author=Saso Zivanovic, -%D date=2023-09-10, +%D date=2023-10-24, %D copyright=Saso Zivanovic, %D license=LPPL, %D ] \writestatus{loading}{ConTeXt User Module / advice} \unprotect \startmodule[advice] +\input miniltx \input t-collargs \pgfkeys{ /handlers/.install advice/.code={% @@ -410,7 +412,8 @@ \let\advice@init@i\advice@setup@init@i \let\advice@init@I\advice@setup@init@I } -\def\advice@trace#1{\immediate\write16{[tracing advice] #1}} + \long\def\advice@typeout#1{\directlua{texio.write_nl("\luaescapestring{#1}")}} +\def\advice@trace#1{\advice@typeout{[tracing advice] #1}} \def\advice@trace@init@i#1#2{% \advice@trace{Advising \detokenize\expandafter{\string#2} (\detokenize{#1})}% \advice@setup@init@i{#1}{#2}% diff --git a/Master/texmf-dist/tex/generic/advice/advice-tikz.code.tex b/Master/texmf-dist/tex/generic/advice/advice-tikz.code.tex index 7bc9dac90cd..6159b6a67af 100644 --- a/Master/texmf-dist/tex/generic/advice/advice-tikz.code.tex +++ b/Master/texmf-dist/tex/generic/advice/advice-tikz.code.tex @@ -23,7 +23,8 @@ %% This work has the LPPL maintenance status `maintained'. %% The Current Maintainer of this work is Saso Zivanovic. %% -%% The files belonging to this work and covered by LPPL are listed in `FILES`. +%% The files belonging to this work and covered by LPPL are listed in +%% (/doc/generic/advice/)FILES. \edef\mmzresetatcatcode{\catcode`\noexpand\@\the\catcode`\@\relax}% \catcode`\@=11 \def\AdviceCollectTikZArguments{% diff --git a/Master/texmf-dist/tex/latex/advice/advice.sty b/Master/texmf-dist/tex/latex/advice/advice.sty index c10d9e566ea..5678958cb59 100644 --- a/Master/texmf-dist/tex/latex/advice/advice.sty +++ b/Master/texmf-dist/tex/latex/advice/advice.sty @@ -23,9 +23,11 @@ %% This work has the LPPL maintenance status `maintained'. %% The Current Maintainer of this work is Saso Zivanovic. %% -%% The files belonging to this work and covered by LPPL are listed in `FILES`. -\ProvidesPackage{advice}[2023/10/10 v1.0.0 Extend commands and environments] +%% The files belonging to this work and covered by LPPL are listed in +%% (/doc/generic/advice/)FILES. +\ProvidesPackage{advice}[2023/10/24 v1.0.1 Extend commands and environments] \RequirePackage{collargs} +\RequirePackage{xparse} \pgfkeys{ /handlers/.install advice/.code={% \edef\auto@install@namespace{\pgfkeyscurrentpath}% @@ -426,7 +428,8 @@ \let\advice@init@i\advice@setup@init@i \let\advice@init@I\advice@setup@init@I } -\def\advice@trace#1{\immediate\write16{[tracing advice] #1}} + \def\advice@typeout{\immediate\write\@unused} +\def\advice@trace#1{\advice@typeout{[tracing advice] #1}} \def\advice@trace@init@i#1#2{% \advice@trace{Advising \detokenize\expandafter{\string#2} (\detokenize{#1})}% \advice@setup@init@i{#1}{#2}% diff --git a/Master/texmf-dist/tex/plain/advice/advice.tex b/Master/texmf-dist/tex/plain/advice/advice.tex index 90b8d472ef1..b648020d0c1 100644 --- a/Master/texmf-dist/tex/plain/advice/advice.tex +++ b/Master/texmf-dist/tex/plain/advice/advice.tex @@ -23,7 +23,9 @@ %% This work has the LPPL maintenance status `maintained'. %% The Current Maintainer of this work is Saso Zivanovic. %% -%% The files belonging to this work and covered by LPPL are listed in `FILES`. +%% The files belonging to this work and covered by LPPL are listed in +%% (/doc/generic/advice/)FILES. +\input miniltx \input collargs \pgfkeys{ /handlers/.install advice/.code={% @@ -395,7 +397,12 @@ \let\advice@init@i\advice@setup@init@i \let\advice@init@I\advice@setup@init@I } -\def\advice@trace#1{\immediate\write16{[tracing advice] #1}} +\ifdefined\luatexversion + \long\def\advice@typeout#1{\directlua{texio.write_nl("\luaescapestring{#1}")}} +\else + \def\advice@typeout{\immediate\write128} +\fi +\def\advice@trace#1{\advice@typeout{[tracing advice] #1}} \def\advice@trace@init@i#1#2{% \advice@trace{Advising \detokenize\expandafter{\string#2} (\detokenize{#1})}% \advice@setup@init@i{#1}{#2}% -- cgit v1.2.3