[latex3-commits] [git/LaTeX3-latex3-latex3] main: Remove deprecated l3kernel Lua table (b1c1e4475)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Jan 6 20:21:03 CET 2022
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/b1c1e44753eb504f37616186401d4ee47fb64997
>---------------------------------------------------------------
commit b1c1e44753eb504f37616186401d4ee47fb64997
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Jan 6 19:21:03 2022 +0000
Remove deprecated l3kernel Lua table
>---------------------------------------------------------------
b1c1e44753eb504f37616186401d4ee47fb64997
l3kernel/CHANGELOG.md | 3 +
l3kernel/doc/l3obsolete.txt | 1 +
l3kernel/l3luatex.dtx | 169 ++------------------------------------------
3 files changed, 8 insertions(+), 165 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index d464de69f..8c2f8f2aa 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Removed
+- Lua functions in `l3kernel` table
+
## [2021-11-22]
### Added
diff --git a/l3kernel/doc/l3obsolete.txt b/l3kernel/doc/l3obsolete.txt
index 23f559388..303592965 100644
--- a/l3kernel/doc/l3obsolete.txt
+++ b/l3kernel/doc/l3obsolete.txt
@@ -661,4 +661,5 @@ Function Date removed
[key property] .value_required: 2017-01-01
Variants of n into N/c 2018-12-27
Variants of N into n/o/V/v/f/x 2018-12-27
+l3kernel table (Lua code) 2022-01-06
----------------------------------------------------------
diff --git a/l3kernel/l3luatex.dtx b/l3kernel/l3luatex.dtx
index 13081b8ea..3353e143b 100644
--- a/l3kernel/l3luatex.dtx
+++ b/l3kernel/l3luatex.dtx
@@ -125,34 +125,9 @@
% |ltx.utils| table.
% \end{function}
%
-% \begin{function}[deprecated = 2021-12-31]{l3kernel}
-% For compatibility reasons, there are also some deprecated interfaces provided
-% in the |l3kernel| table. These do not return their result as Lua values but
-% instead print them to \TeX.
-% \end{function}
-%
-% \begin{function}{l3kernel.charcat}
-% \begin{syntax}
-% |l3kernel.charcat(|\meta{charcode}, \meta{catcode}|)|
-% \end{syntax}
-% Constructs a character of \meta{charcode} and \meta{catcode} and returns
-% the result to \TeX{}.
-% \end{function}
-%
-% \begin{function}{l3kernel.elapsedtime}
-% \begin{syntax}
-% |l3kernel.elapsedtime()|
-% \end{syntax}
-% Returns the CPU time in \meta{scaled seconds} since the start of the
-% \TeX{} run or since |l3kernel.resettimer| was issued. This only
-% measures the time used by the CPU, not the real time, e.g., waiting
-% for user input.
-% \end{function}
-%
-% \begin{function}{ltx.utils.filedump, l3kernel.filedump}
+% \begin{function}{ltx.utils.filedump}
% \begin{syntax}
% \meta{dump}| = ltx.utils.filedump(|\meta{file}|,|\meta{offset}|,|\meta{length}|)| \\
-% |l3kernel.filedump(|\meta{file}|,|\meta{offset}|,|\meta{length}|)|
% \end{syntax}
% Returns the uppercase hexadecimal representation of the content of the
% \meta{file} read as bytes. If the \meta{length} is given, only this part
@@ -161,10 +136,9 @@
% is read starting at the \meta{offset}.
% \end{function}
%
-% \begin{function}{ltx.utils.filemd5sum, l3kernel.filemdfivesum}
+% \begin{function}{ltx.utils.filemd5sum}
% \begin{syntax}
% \meta{hash}| = ltx.utils.filemd5sum(|\meta{file}|)| \\
-% |l3kernel.filemdfivesum(|\meta{file}|)|
% \end{syntax}
% Returns the MD5 sum of the file contents read as bytes; note that
% the result will depend on the nature of the line endings used in the file,
@@ -172,10 +146,9 @@
% nothing is returned with \emph{no error raised}.
% \end{function}
%
-% \begin{function}{ltx.utils.filemoddate, l3kernel.filemoddate}
+% \begin{function}{ltx.utils.filemoddate}
% \begin{syntax}
% \meta{date}| = ltx.utils.filemoddate(|\meta{file}|)| \\
-% |l3kernel.filemoddate(|\meta{file}|)|
% \end{syntax}
% Returns the date/time of last modification of the \meta{file} in the
% format
@@ -188,37 +161,14 @@
% not found, nothing is returned with \emph{no error raised}.
% \end{function}
%
-% \begin{function}{ltx.utils.filesize, l3kernel.filesize}
+% \begin{function}{ltx.utils.filesize}
% \begin{syntax}
% |size = ltx.utils.filesize(|\meta{file}|)| \\
-% |l3kernel.filesize(|\meta{file}|)|
% \end{syntax}
% Returns the size of the \meta{file} in bytes. If the \meta{file} is not
% found, nothing is returned with \emph{no error raised}.
% \end{function}
%
-% \begin{function}{l3kernel.resettimer}
-% \begin{syntax}
-% |l3kernel.resettimer()|
-% \end{syntax}
-% Resets the timer used by |l3kernel.elapsetime|.
-% \end{function}
-%
-% \begin{function}{l3kernel.shellescape}
-% \begin{syntax}
-% |l3kernel.shellescape(|\meta{cmd}|)|
-% \end{syntax}
-% Executes the \meta{cmd} and prints to the log as for \pdfTeX{}.
-% \end{function}
-%
-% \begin{function}{l3kernel.strcmp}
-% \begin{syntax}
-% |l3kernel.strcmp(|\meta{str one}, \meta{str two}|)|
-% \end{syntax}
-% Compares the two strings and returns |0| to \TeX{}
-% if the two are identical.
-% \end{function}
-%
% \end{documentation}
%
% \begin{implementation}
@@ -322,18 +272,14 @@
% Most of the emulation of \pdfTeX{} here is based heavily on Heiko Oberdiek's
% \pkg{pdftexcmds} package.
%
-% \begin{macro}{l3kernel}
% \begin{macro}{ltx.utils}
% Create a table for the kernel's own use.
% \begin{macrocode}
-l3kernel = l3kernel or { }
-local l3kernel = l3kernel
ltx = ltx or {utils={}}
ltx.utils = ltx.utils or { }
local ltxutils = ltx.utils
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% Local copies of global tables.
% \begin{macrocode}
@@ -413,16 +359,6 @@ if not command_id and tokens and tokens.commands then
end
% \end{macrocode}
%
-% \begin{macrocode}
-local function deprecated(table, name, func)
- table[name] = function(...)
- write_nl(format("Calling deprecated Lua function %s", name))
- table[name] = func
- return func(...)
- end
-end
-% \end{macrocode
-%
% Deal with Con\TeX{}t: doesn't use |kpse| library.
% \begin{macrocode}
local kpse_find = (resolvers and resolvers.findfile) or kpse.find_file
@@ -440,40 +376,7 @@ end
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{l3kernel.charcat}
-% Creating arbitrary chars using |tex.cprint|.
-% The alternative approach using |token.put_next(token.create(...))|
-% would be about 10\% slower.
-% \begin{macrocode}
-deprecated(l3kernel, 'charcat', function(charcode, catcode)
- cprint(catcode, utf8_char(charcode))
-end)
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{l3kernel.elapsedtime, l3kernel.resettimer}
-% Simple timing set up: give the result from the system clock in scaled
-% seconds.
-% \begin{macrocode}
-local os_clock = os.clock
-local base_clock_time = 0
-local function elapsedtime()
- local val = (os_clock() - base_clock_time) * 65536 + 0.5
- if val > 2147483647 then
- val = 2147483647
- end
- write(format("%d",floor(val)))
-end
-l3kernel.elapsedtime = elapsedtime
-local function resettimer()
- base_clock_time = os_clock()
-end
-l3kernel.resettimer = resettimer
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{ltx.utils.filedump}
-% \begin{macro}{l3kernel.filedump}
% Similar comments here to the next function: read the file in binary mode
% to avoid any line-end weirdness.
% \begin{macrocode}
@@ -490,15 +393,8 @@ local function filedump(name,offset,length)
return escapehex(data)
end
ltxutils.filedump = filedump
-deprecated(l3kernel, "filedump", function(name, offset, length)
- local dump = filedump(name, tonumber(offset), tonumber(length))
- if dump then
- write(dump)
- end
-end)
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{md5.HEX}
% Hash a string and return the hash in uppercase hexadecimal format.
@@ -516,7 +412,6 @@ end
% \end{macrocode}
% \end{macro}
% \begin{macro}{ltx.utils.filemd5sum}
-% \begin{macro}{l3kernel.filemdfivesum}
% Read an entire file and hash it: the hash function itself is a built-in.
% As Lua is byte-based there is no work needed here in terms of UTF-8
% (see \pkg{pdftexcmds} and how it handles strings that have passed through
@@ -532,18 +427,10 @@ local function filemd5sum(name)
return md5_HEX(data)
end
ltxutils.filemd5sum = filemd5sum
-deprecated(l3kernel, "filemdfivesum", function(name)
- local hash = filemd5sum(name)
- if hash then
- write(hash)
- end
-end)
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{ltx.utils.filemoddate}
-% \begin{macro}{l3kernel.filemoddate}
% There are two cases: If the C standard library is C99 compliant,
% we can use |%z| to get the timezone in almost the right format.
% We only have to add primes and replace a zero or missing offset
@@ -607,18 +494,10 @@ else
end
end
ltxutils.filemoddate = filemoddate
-deprecated(l3kernel, "filemoddate", function(name)
- local hash = filemoddate(name)
- if hash then
- write(hash)
- end
-end)
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{ltx.utils.filesize}
-% \begin{macro}{l3kernel.filesize}
% A simple disk lookup.
% \begin{macrocode}
local function filesize(name)
@@ -631,46 +510,6 @@ local function filesize(name)
end
end
ltxutils.filesize = filesize
-deprecated(l3kernel, "filesize", function(name)
- local size = filesize(name)
- if size then
- write(size)
- end
-end)
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{l3kernel.strcmp}
-% String comparison which gives the same results as \pdfTeX{}'s
-% \tn{pdfstrcmp}, although the ordering should likely not be relied upon!
-% \begin{macrocode}
-deprecated(l3kernel, "strcmp", function (A, B)
- if A == B then
- write("0")
- elseif A < B then
- write("-1")
- else
- write("1")
- end
-end)
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{l3kernel.shellescape}
-% Replicating the \pdfTeX{} log interaction for shell escape.
-% \begin{macrocode}
-local os_exec = os.execute
-deprecated(l3kernel, "shellescape", function(cmd)
- local status,msg = os_exec(cmd)
- if status == nil then
- write_nl("log","runsystem(" .. cmd .. ")...(" .. msg .. ")\n")
- elseif status == 0 then
- write_nl("log","runsystem(" .. cmd .. ")...executed\n")
- else
- write_nl("log","runsystem(" .. cmd .. ")...failed " .. (msg or "") .. "\n")
- end
-end)
% \end{macrocode}
% \end{macro}
%
More information about the latex3-commits
mailing list.