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

l3keys: inherit does not seem to inherit defaults #504

Closed
callegar opened this issue Dec 15, 2018 · 1 comment
Closed

l3keys: inherit does not seem to inherit defaults #504

callegar opened this issue Dec 15, 2018 · 1 comment
Assignees
Labels
bug Something isn't working l3keys

Comments

@callegar
Copy link

Using .inherit:n it looks like only the variable setting actions are inherited for the inherited keys while the default values (i.e. the default:n) are not (I wonder if the initialization values, that is initial:n is passed).

For instance if you have

\keys_define:nn {test-1}
  {
    foo .bool_set:N = \g_scstuff_roman_constants_bool,
    foo .initial:n = true,
    foo .default:n = true,

and

\keys_define:nn { }
  {  
    test .inherit:n = test-1
  }

then \ProcessKeysPackageOptions{test} errors out if the package options include foo. The error message says that the key foo accepts boolean values only.

@eg9 eg9 added bug Something isn't working l3keys labels Dec 15, 2018
@eg9
Copy link
Contributor

eg9 commented Dec 15, 2018

The initial value is preserved, because it was already set.

\documentclass{article}
\usepackage{expl3}

\ExplSyntaxOn
\keys_define:nn {test-1}
  {
    foo .bool_gset:N = \g_scstuff_roman_constants_bool,
    foo .initial:n = true,
    foo .default:n = true,
  }

\keys_define:nn { }
  {
    test .inherit:n = test-1
  }

\keys_set:nn { test } {foo} % raises error

\bool_show:N \g_scstuff_roman_constants_bool

\stop

produces

! LaTeX3 Error: Key 'foo' accepts boolean values only.

For immediate help type H <return>.
 ...                                              
                                                  
l.17 \keys_set:nn { test } {foo}
                                 % raises error
? 
> \g_scstuff_roman_constants_bool=true.
<recently read> }
                 
l.19 \bool_show:N \g_scstuff_roman_constants_bool

@josephwright josephwright self-assigned this Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working l3keys
Projects
None yet
Development

No branches or pull requests

3 participants