Skip to content

Commit

Permalink
correct doc about list handler (ltluatex)
Browse files Browse the repository at this point in the history
The documentation states that of all the functions
in the callback returns true then the callback returns
true as well, but the following example (and the code)
shows that the return value in this case is the head
passed to the callback.

\directlua{
luatexbase.create_callback('foo', 'list', false)
luatexbase.add_to_callback('foo', function(head) print('bar') return true end, 'baz')
print(luatexbase.call_callback('foo', token.scan_list()))
}\hbox{foo}

\stop
  • Loading branch information
Udi-Fogiel committed Jan 11, 2025
1 parent afc5bf6 commit 22fcad0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2025-01-10 Udi Fogiel <[email protected]>

* ltluatex.dtx (subsubsection{Handlers}):
Correct documentation about the return value
of the list handler

2025-01-10 Frank Mittelbach <[email protected]>

* ltmarks.dtx (subsection{Updating mark structures}):
Expand Down
17 changes: 9 additions & 8 deletions base/ltluatex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
%<*plain>
% \fi
% \ProvidesFile{ltluatex.dtx}
[2024/08/16 v1.2e
[2025/01/11 v1.2e
% LaTeX Kernel (LuaTeX support)^^A
%\iffalse
%<plain> LuaTeX support for plain TeX (core)%
Expand Down Expand Up @@ -1676,14 +1676,15 @@ end
% passed the return value of the previous (and the other arguments
% untouched, if any). The return value is that of the last function;
% \item[list] is a specialized variant of \emph{data} for functions
% filtering node lists. Such functions may return either the head of a
% modified node list, or the boolean values |true| or |false|. The
% functions are chained the same way as for \emph{data} except that for
% the following. If
% one function returns |false|, then |false| is immediately returned and
% the following functions are \emph{not} called. If one function returns
% filtering node lists. Such functions are called with a node list head
% as the first argument and may return either the head of a modified node list,
% or the boolean values |true| or |false|.
% The functions are chained the same way as for \emph{data} except for
% the following cases.
% If a function returns |false|, then |false| is immediately returned and
% the following functions are \emph{not} called. If a function returns
% |true|, then the same head is passed to the next function. If all
% functions return |true|, then |true| is returned, otherwise the return
% functions return |true|, then the original head is returned, otherwise the return
% value of the last function not returning |true| is used.
% \item[reverselist] is a specialized variant of \emph{list} which executes
% functions in inverse order.
Expand Down

0 comments on commit 22fcad0

Please sign in to comment.