summaryrefslogtreecommitdiff
path: root/macros/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-10-26 03:01:46 +0000
committerNorbert Preining <norbert@preining.info>2023-10-26 03:01:46 +0000
commit721b0492f150d59f61b504ab803c7ef1a9a67a0b (patch)
tree95c682efcdefd7abd304cc7fb6ffe1d843d818a8 /macros/generic
parent241082cbe6f4fe8c38e91c38418ca828ac8d2f7c (diff)
CTAN sync 202310260301
Diffstat (limited to 'macros/generic')
-rw-r--r--macros/generic/advice/CHANGELOG.md27
-rw-r--r--macros/generic/advice/README.md11
-rw-r--r--macros/generic/advice/advice.edtx42
3 files changed, 72 insertions, 8 deletions
diff --git a/macros/generic/advice/CHANGELOG.md b/macros/generic/advice/CHANGELOG.md
new file mode 100644
index 0000000000..63de5163a9
--- /dev/null
+++ b/macros/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/macros/generic/advice/README.md b/macros/generic/advice/README.md
index 0b001d9df8..fa1e6294d9 100644
--- a/macros/generic/advice/README.md
+++ b/macros/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/macros/generic/advice/advice.edtx b/macros/generic/advice/advice.edtx
index ee9486226e..dcbdfb297e 100644
--- a/macros/generic/advice/advice.edtx
+++ b/macros/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
+%% (<texmf>/doc/generic/advice/)FILES.
%
% \fi
%
@@ -28,14 +29,14 @@
% \relax
%
%<*main>
-%<latex>\ProvidesPackage{advice}[2023/10/10 v1.0.0 Extend commands and environments]
+%<latex>\ProvidesPackage{advice}[2023/10/25 v1.0.1 Extend commands and environments]
%<context>%D \module[
%<context>%D file=t-advice.tex,
-%<context>%D version=1.0.0,
+%<context>%D version=1.0.1,
%<context>%D title=Advice,
%<context>%D subtitle=Extend commands and environments,
%<context>%D author=Saso Zivanovic,
-%<context>%D date=2023-10-10,
+%<context>%D date=2023-10-25,
%<context>%D copyright=Saso Zivanovic,
%<context>%D license=LPPL,
%<context>%D ]
@@ -43,9 +44,14 @@
%<context>\unprotect
%<context>\startmodule[advice]
% \paragraph{Required packages}
+%<plain,context>\input miniltx
%<latex>\RequirePackage{collargs}
%<plain>\input collargs
%<context>\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|.
+%<latex>\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.
+%<plain>\ifdefined\luatexversion
+ %<!latex>\long\def\advice@typeout#1{\directlua{texio.write_nl("\luaescapestring{#1}")}}
+%<plain>\else
+ %<latex>\def\advice@typeout{\immediate\write\@unused}
+ %<plain>\def\advice@typeout{\immediate\write128}
+%<plain>\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}
%<plain>\resetatcatcode
%<context>\stopmodule
%<context>\protect