diff options
Diffstat (limited to 'macros/latex-dev/base/ltproperties.dtx')
-rw-r--r-- | macros/latex-dev/base/ltproperties.dtx | 69 |
1 files changed, 46 insertions, 23 deletions
diff --git a/macros/latex-dev/base/ltproperties.dtx b/macros/latex-dev/base/ltproperties.dtx index 71b6e2a14f..40c50cd20a 100644 --- a/macros/latex-dev/base/ltproperties.dtx +++ b/macros/latex-dev/base/ltproperties.dtx @@ -22,8 +22,8 @@ % % for those people who are interested. % \begin{macrocode} -\def\ltpropertiesversion{1.0b} -\def\ltpropertiesdate{2023-09-13} +\def\ltpropertiesversion{1.0c} +\def\ltpropertiesdate{2023-10-15} % \end{macrocode} %<*driver> @@ -177,7 +177,7 @@ % \begin{function} % { % \property_record:nN, -% \property_record:nn, \property_record:nV, \property_record:xx +% \property_record:nn, \property_record:nV, \property_record:ee % } % \begin{syntax} % \cs{property_record:nN} \Arg{label} \Arg{clist var} @@ -227,7 +227,7 @@ % or in some outer group! % \end{function} % -% \begin{function}{\property_ref_undefined_warn:n,\property_ref_undefined_warn:x} +% \begin{function}{\property_ref_undefined_warn:n,\property_ref_undefined_warn:e} % \begin{syntax} % \cs{property_ref_undefined_warn:n} \Arg{label} % \end{syntax} @@ -241,7 +241,7 @@ % \texttt{Reference~`\meta{label}'~on~page~\meta{page}\space undefined}. % \end{function} % -% \begin{function}{\property_ref_undefined_warn:nn,\property_ref_undefined_warn:xx} +% \begin{function}{\property_ref_undefined_warn:nn,\property_ref_undefined_warn:ee} % \begin{syntax} % \cs{property_ref_undefined_warn:nn} \Arg{label} \Arg{property} % \end{syntax} @@ -302,6 +302,8 @@ % \section{\LaTeXe{} interface} % % The LaTeXe{} interfaces always expand label and property arguments. +% This means that one must be careful when using active chars or commands in the +% names. UTF8-chars are protected and should be safe, similar most babel shorthands. % % \begin{function}{\NewProperty,\SetProperty} % \begin{syntax} @@ -397,7 +399,7 @@ % comparisions. % \end{variable} % -% \begin{variable}{currentlabel} +% \begin{variable}{label} % (now) The content of \cs{@currentlabel}. This is the value that % you get also with the standard \cs{label}/\cs{ref}. % \end{variable} @@ -410,10 +412,17 @@ % % \begin{variable}{target} % (now) The content of \cs{@currentHref}. -% This command is normally filled by for example by +% This command is normally filled by for example % \pkg{hyperref} and gives the name of the last destination it created. % \end{variable} % +% \begin{variable}{pagetarget} +% (shipout) The content of \cs{@currentHpage}. +% This command is filled for example by a recent version of +% \pkg{hyperref} and then gives the name of the last page +% destination it created. +% \end{variable} +% % \begin{variable}{counter} % (now) The content of \cs{@currentcounter}. % This command contains after a \cs{refstepcounter} the name of the counter. @@ -486,7 +495,7 @@ } \cs_new_protected:Npn \property_gset:nnnn #1#2#3#4 { - \@@_gset:xnnn { \tl_to_str:n {#1} } + \@@_gset:ennn { \tl_to_str:n {#1} } {#2} {#3} {#4} } \cs_new_protected:Npn \@@_gset:nnnn #1#2#3#4 @@ -504,21 +513,24 @@ } { \msg_error:nnnn { property } { unknown-setpoint } {#1} {#2} } } -\cs_generate_variant:Nn \@@_gset:nnnn {xnnn} +\cs_generate_variant:Nn \@@_gset:nnnn {ennn} % \end{macrocode} % \end{macro} % % \begin{macro}{\NewProperty,\SetProperty} % For consistency we expand the property name, but this doesn't warant a % variant of the L3-commands. +% \changes{v1.0c}{2023-09-20}{use \cs{protected@edef}} % \begin{macrocode} \cs_new_protected:Npn \NewProperty #1#2#3#4 { - \exp_args:Nx \property_new:nnnn {#1}{#2}{#3}{#4} + \protected@edef\reserved@a{#1} + \exp_args:No \property_new:nnnn {\reserved@a} {#2}{#3}{#4} } \cs_new_protected:Npn \SetProperty #1#2#3#4 { - \exp_args:Nx \property_gset:nnnn {#1}{#2}{#3}{#4} + \protected@edef\reserved@a{#1} + \exp_args:No \property_gset:nnnn {\reserved@a} {#2}{#3}{#4} } % \end{macrocode} % \end{macro} @@ -528,9 +540,10 @@ % { % \property_record:nn, % \property_record:nV, -% \property_record:xx, +% \property_record:ee, +% \property_record:oo, % \@@_record:nn, -% \@@_record:xn +% \@@_record:en % } % \begin{macro}[EXP] % {\@@_record_value:n, \@@_record_value_aux:n, \@@_record_value_aux:e} @@ -542,8 +555,8 @@ \cs_new_protected:Npn \property_record:nN #1#2 { \property_record:nV {#1} #2 } \cs_new_protected:Npn \property_record:nn #1#2 - { \@@_record:xn { \tl_to_str:n {#1} } {#2} } -\cs_generate_variant:Nn \property_record:nn { nV , xx } + { \@@_record:en { \tl_to_str:n {#1} } {#2} } +\cs_generate_variant:Nn \property_record:nn { nV , ee, oo } \cs_new_protected:Npn \@@_record:nn #1#2 { \legacy_if:nT { @filesw } @@ -556,7 +569,7 @@ } } } -\cs_generate_variant:Nn \@@_record:nn { x } +\cs_generate_variant:Nn \@@_record:nn { e } \cs_new:Npn \@@_record_value:n #1 { \@@_record_value_aux:e { \tl_to_str:n {#1} } } \cs_new:Npn \@@_record_value_aux:n #1 @@ -580,11 +593,14 @@ % \end{macro} % % \begin{macro}{\RecordProperties} +% \changes{v1.0c}{2023-09-20}{use \cs{protected@edef} for safer handling of active chars.} % % \begin{macrocode} \NewDocumentCommand\RecordProperties { m m } { \@bsphack - \property_record:xx {#1}{#2} + \protected@edef\reserved@a{#1} + \protected@edef\reserved@b{#2} + \property_record:oo {\reserved@a}{\reserved@b} \@esphack } % \end{macrocode} @@ -803,8 +819,8 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\property_ref_undefined_warn:nn, -% \property_ref_undefined_warn:xx, +% \begin{macro}{\property_ref_undefined_warn:nn, +% \property_ref_undefined_warn:ee, % \RefUndefinedWarn} % \begin{macrocode} \cs_new_protected:Npn \property_ref_undefined_warn:nn #1#2 %#1 label, #2 property @@ -823,8 +839,8 @@ \@latex@warning { Reference~`#1'~on~page~\thepage\space undefined }% } } -\cs_generate_variant:Nn \property_ref_undefined_warn:nn {xx} -\cs_set_eq:NN \RefUndefinedWarn \property_ref_undefined_warn:xx +\cs_generate_variant:Nn \property_ref_undefined_warn:nn {ee} +\cs_set_eq:NN \RefUndefinedWarn \property_ref_undefined_warn:ee % \end{macrocode} % \end{macro} % @@ -849,9 +865,9 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{currentlabel} +% \begin{variable}{label} % \begin{macrocode} -\property_new:nnnn { currentlabel } { now } { ?? } { \@currentlabel } +\property_new:nnnn { label } { now } { ?? } { \@currentlabel } % \end{macrocode} % \end{variable} % @@ -868,6 +884,13 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{target} +% \begin{macrocode} +\newcommand\@currentHpage{} +\property_new:nnnn { pagetarget } { shipout } { } { \@currentHpage } +% \end{macrocode} +% \end{variable} + % \begin{variable}{counter} % \begin{macrocode} \property_new:nnnn { counter } { now } { } { \@currentcounter } |