summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xpackages/xtras
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-10-12 00:07:04 +0000
committerKarl Berry <karl@freefriends.org>2010-10-12 00:07:04 +0000
commita8c915878e3e9b15a28df3a92b0c1ac925d6e28e (patch)
treedd35661fdc51376d4d11645e7920a32a0fa1a041 /Master/texmf-dist/tex/latex/xpackages/xtras
parentf260c3c6b4661850cc6f51f22729f2092d7ebf61 (diff)
xpackages 2072 (10oct10)
git-svn-id: svn://tug.org/texlive/trunk@20058 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xpackages/xtras')
-rw-r--r--Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty101
1 files changed, 59 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty
index bae23bd05fd..d5009a13cba 100644
--- a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty
+++ b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty
@@ -49,77 +49,94 @@
{Parsing LaTeX3 keyvals as LaTeX2e package options}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
-\RequirePackage{xparse}
+\RequirePackage { xparse }
\clist_new:N \keys_latexe_options_clist
\bool_new:N \_l_keys_process_class_bool
-\cs_new:Npn \keys_latexe_options:n #1 {
+\cs_new_protected:Npn \keys_latexe_options:n #1 {
\clist_clear:N \keys_latexe_options_clist
\keys_latexe_options_global:n {#1}
\keys_latexe_options_local:
- \keys_if_exist:nnF {#1} { unknown } {
- \keys_define:nn {#1} {
- unknown .code:n = {
- \msg_error:nnxx { Option~Processing } { unknown-option }
- { \l_keys_key_tl } { \@currname }
- }
+ \cs_if_exist:cTF { \c_keys_root_tl {#1} / unknown .cmd:n }
+ {
+ \keys_define:nn {#1}
+ {
+ unknown .code:n =
+ {
+ \msg_kernel_error:nnxx { keyvalue } { option-unknown }
+ { \l_keys_key_tl } { \@currname }
+ }
+ }
}
- }
\keys_set:nV {#1} \keys_latexe_options_clist
\AtEndOfPackage { \cs_set_eq:NN \@unprocessedoptions \scan_stop: }
}
-\msg_new:nnn { Option~Processing } { unknown-option } {%
- Unknown~option~`#1'\\%
- for~module~#2.%
-}
-\cs_new:Npn \keys_latexe_options_global:n #1 {
- \cs_if_eq:NNF \@classoptionslist \scan_stop: {
- \cs_if_eq:NNTF \@currext \@clsextension {
- \keys_latexe_options_class:n {#1}
- }{
- \bool_if:NT \_l_keys_process_class_bool
- { \keys_latexe_options_package:n {#1} }
+\cs_new_protected:Npn \keys_latexe_options_global:n #1 {
+ \cs_if_eq:NNF \@classoptionslist \scan_stop:
+ {
+ \cs_if_eq:NNTF \@currext \@clsextension
+ { \keys_latexe_options_class:n {#1} }
+ {
+ \bool_if:NT \_l_keys_process_class_bool
+ { \keys_latexe_options_package:n {#1} }
+ }
}
- }
}
-\cs_new:Npn \keys_latexe_options_class:n #1 {
- \clist_map_inline:Nn \@classoptionslist {
- \keys_if_exist:nnTF {#1} { \keys_latexe_remove_equals:n {##1} } {
- \clist_put_right:Nn \keys_latexe_options_clist {##1}
- }{
- \clist_put_right:Nn \@unusedoptionlist {##1}
+\cs_new_protected:Npn \keys_latexe_options_class:n #1 {
+ \clist_map_inline:Nn \@classoptionslist
+ {
+ \cs_if_exist:cTF
+ {
+ \c_keys_root_tl #1 /
+ \keys_latexe_remove_equals:n {##1} .cmd:n
+ }
+ { \clist_put_right:Nn \keys_latexe_options_clist {##1} }
+ { \clist_put_right:Nn \@unusedoptionlist {##1} }
}
- }
}
-\cs_new:Npn \keys_latexe_options_package:n #1 {
- \clist_map_inline:Nn \@classoptionslist {
- \keys_if_exist:nnT {#1} { \keys_latexe_remove_equals:n {##1} } {
- \clist_put_right:Nn \keys_latexe_options_clist {##1}
- \clist_remove_element:Nn \@unusedoptionlist {##1}
+\cs_new_protected:Npn \keys_latexe_options_package:n #1 {
+ \clist_map_inline:Nn \@classoptionslist
+ {
+ \cs_if_exist:cTF
+ {
+ \c_keys_root_tl #1 /
+ \keys_latexe_remove_equals:n {##1} .cmd:n
+ }
+ {
+ \clist_put_right:Nn \keys_latexe_options_clist {##1}
+ \clist_remove_element:Nn \@unusedoptionlist {##1}
+ }
}
- }
}
-\cs_new_nopar:Npn \keys_latexe_options_local: {
- \cs_if_eq:NNF \@currext \@clsextension {
- \cs_if_exist:cT { opt@ \@currname . \@currext } {
- \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist
- { opt@ \@currname . \@currext }
+\cs_new_protected_nopar:Npn \keys_latexe_options_local: {
+ \cs_if_eq:NNF \@currext \@clsextension
+ {
+ \cs_if_exist:cT { opt@ \@currname . \@currext }
+ {
+ \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist
+ { opt@ \@currname . \@currext }
+ }
}
- }
}
\cs_new:Npn \keys_latexe_remove_equals:n #1 {
\keys_latexe_remove_equals:w #1 = \q_stop
}
\cs_new:Npn \keys_latexe_remove_equals:w #1 = #2 \q_stop {#1}
-\NewDocumentCommand \ProcessKeysOptions { m } {
+\cs_new_protected:Npn \ProcessKeysOptions #1 {
\bool_set_true:N \_l_keys_process_class_bool
\keys_latexe_options:n {#1}
}
-\NewDocumentCommand \ProcessKeysPackageOptions { m } {
+\cs_new_protected:Npn \ProcessKeysPackageOptions #1 {
\bool_set_false:N \_l_keys_process_class_bool
\keys_latexe_options:n {#1}
}
\@onlypreamble \ProcessKeysOptions
\@onlypreamble \ProcessKeysPackageOptions
+\msg_kernel_new:nnnn { keyvalue } { option-unknown }
+ { Unknown~option~'#1'~for~package~#2. }
+ {
+ LaTeX~has~been~asked~to~set~an~option~called~'#1'\\
+ but~the~#2~package~has~not~created~an~option~with~this~name.
+ }
\endinput
%%
%% End of file `l3keys2e.sty'.