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

Process global options once per package #1625

Merged
merged 4 commits into from
Jan 15, 2025
Merged

Process global options once per package #1625

merged 4 commits into from
Jan 15, 2025

Conversation

josephwright
Copy link
Member

Internal housekeeping

Status of pull request

  • Feedback wanted
  • Under development
  • 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

@josephwright
Copy link
Member Author

@Skillmon Could you review here?

@josephwright
Copy link
Member Author

No rollback here: this is purely suppressing some stray warnings and there should be no sense in which people need the older behaviour.

Copy link
Member

@FrankMittelbach FrankMittelbach left a comment

Choose a reason for hiding this comment

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

one typo noticed

base/doc/ltnews41.tex Outdated Show resolved Hide resolved
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.

Seems to work well with my own tests with and without usage=load

Copy link
Contributor

@Skillmon Skillmon left a comment

Choose a reason for hiding this comment

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

I'd additionally add the following test file:

\begin{filecontents*}[overwrite]{testpackage.sty}
\ProvidesExplPackage{testpackage}{2025-02-04}{}{}
\keys_define:nn { testpackage }
  {
    testoption .code:n = { \def \testmacro { #1 } } ,
    testoption .usage:n = load
  }
\ProcessKeyOptions [ testpackage ]
\endinput
\end{filecontents*}

\input{test2e}

\documentclass[testoption = false]{article}

\START

\usepackage[testoption = true]{testpackage}
\usepackage[testoption = ERROR]{testpackage}

\TYPE{\testmacro}

\END

(should type true)

Comment on lines +413 to +414
given globally (in the optional argument to \cs{documentclass}) would be
repeatedly processed and could therefore lead to spurious warnings. This has
Copy link
Contributor

Choose a reason for hiding this comment

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

The, imho, much bigger issue than these spurious warnings is that load options are applied just once while every other option is applied multiple times (potentially overwriting any explicitly set option for this package). But otherwise the wording is fine. This is just a note, not a request for change.

\usepackage{testpackage}
\usepackage{testpackage}

\END
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing EOL.

base/testfiles/github-1619b.lvt Outdated Show resolved Hide resolved
base/testfiles/github-1619c.lvt Outdated Show resolved Hide resolved
base/testfiles/github-1619d.lvt Outdated Show resolved Hide resolved
@josephwright josephwright merged commit 87372f4 into develop Jan 15, 2025
3 checks passed
@josephwright josephwright deleted the gh1619 branch January 15, 2025 19:02
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.

Global options give "ignored" warning if packages are listed multiple times
4 participants