Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct doc about list handler (ltluatex) #1618

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Udi-Fogiel
Copy link

@Udi-Fogiel Udi-Fogiel commented Jan 11, 2025

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

READ ME FIRST: Please understand that in most cases we will not be able to merge a pull request because there are a lot of internal activities needed when updating the LaTeX2e sources. If you have a code suggestion please discuss it with the team first.

Internal housekeeping

Status of pull request

  • Ready to merge

Checklist of required changes before merge will be approved

  • Test file(s) added
  • Version and date string updated in changed source files
  • Relevant \changes entries in source included
  • Relevant changes.txt updated
  • Rollback provided (if necessary)?
  • ltnewsX.tex (and/or latexchanges.tex) updated

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
Copy link
Member

@davidcarlisle davidcarlisle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this seems OK. The documentation was true when written but the code changed in 2021

2021-11-17  Marcel Krüger  <[email protected]>

	* ltluatex.dtx:
	Classify [hv]pack_quality callbacks as exclusive
	Never pass true to the engine for LuaTeX list callbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants