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

Adding \newluacmd #536

Merged
merged 3 commits into from
Dec 27, 2021
Merged

Adding \newluacmd #536

merged 3 commits into from
Dec 27, 2021

Conversation

zauguin
Copy link
Member

@zauguin zauguin commented Mar 22, 2021

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.

Pull requests in this repository are intended for LaTeX Team members only.

\luafunction only defines a number register, while most uses of it actually end up defining a lua command using \luadef. This adds unnecessary indirection and requires an additional csname for the index. Therefore this adds \newluacmd and \newprotectedluacmd to combine the index allocation and the following \luadef.

Open questions:

  • That is a sensible name for this? The common convention of allocating e.g. \countdef with \newcount would lead to \newlua, but that seems overly generic. Alternativly we could use \newluadef but def suggests that the index is explicitly given. IMO \newluacmd sounds good, but luacmd isn't a name which is used anywhere else.
  • Currently this the expandable version as the normal case and explicitly names the unexpandable one as protected. This is consistent with the underlying engine, but we might prefer to default to being unexpandable instead and using e.g. \newexpandableluacmd for the other one as for e.g. xparse. Also protected might be misleading since these commands really act like unexpandable primitives and are not semi-expandable like \protected macros.

Internal housekeeping

Status of pull request

  • Feedback wanted
  • Under development

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
  • ltnewsX.tex updated

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity.

@zauguin zauguin marked this pull request as ready for review December 27, 2021 05:45
@zauguin zauguin merged commit 42a8fa1 into develop Dec 27, 2021
@josephwright josephwright deleted the newluacmd branch January 6, 2022 12:33
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.

1 participant