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

Gh1399 Trim spaces from envname #1401

Merged
merged 5 commits into from
Jul 6, 2024

Conversation

muzimuzhi
Copy link
Contributor

Fix for #1399.

Internal housekeeping

Status of pull request

  • Feedback wanted
  • Ready to merge

Checklist of required changes before merge will be approved

  • Test file(s) added (extended an existing test)
  • 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

Comment on lines 633 to 642
\cs_new_protected:Npn \@@_declare_env:nnnn #1#2
{
\str_set:Nx \l_@@_environment_str {#1}
\str_set:Nx \l_@@_environment_str
{ \tl_trim_spaces:o { \l_@@_environment_str } }
\cs_if_exist:cTF { \l_@@_environment_str }
{
\msg_info:nnxx { cmd } { redefine-env }
{ \l_@@_environment_str } { \tl_to_str:n {#2} }
}
{
\msg_info:nnxx { cmd } { define-env }
{ \l_@@_environment_str } { \tl_to_str:n {#2} }
}
\str_set:Nn \l_@@_environment_str {#1}
\cs_if_exist:cTF { #1 }
{ \msg_info:nnnn { cmd } { redefine-env } { #1 } { #2 } }
{ \msg_info:nnnn { cmd } { define-env } { #1 } { #2 } }
\bool_set_false:N \l_@@_expandable_bool
\bool_set_true:N \l_@@_environment_bool
\exp_args:NV \@@_declare_env_internal:nnnn
\l_@@_environment_str {#2}
\@@_declare_env_internal:nnnn {#1} {#2}
}
Copy link
Contributor Author

@muzimuzhi muzimuzhi Jul 6, 2024

Choose a reason for hiding this comment

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

A tiny difference: before str (the content of \l_@@_environment_str) is used, now tl (the expansion result of \tl_trim_spaces:e { <envname> }) is used.

As the fully-expanded, space-trimmed <envname> is either used in csname or message, this change shouldn't affect behavior of code.

@FrankMittelbach FrankMittelbach merged commit 7e2f1a1 into latex3:develop Jul 6, 2024
41 checks passed
@muzimuzhi muzimuzhi deleted the gh1399-space-trim-envname branch July 6, 2024 12:44
muzimuzhi added a commit to muzimuzhi/latex2e that referenced this pull request Jul 6, 2024
davidcarlisle pushed a commit that referenced this pull request Jul 8, 2024
* Correct typos introduced in #1401

* Correct typos introduced in #1398

And reformat longtable.dtx.
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.

None yet

3 participants