texlive[69243] Master/texmf-dist: pgfkeysearch (30dec23)
commits+karl at tug.org
commits+karl at tug.org
Sat Dec 30 22:26:16 CET 2023
Revision: 69243
https://tug.org/svn/texlive?view=revision&revision=69243
Author: karl
Date: 2023-12-30 22:26:16 +0100 (Sat, 30 Dec 2023)
Log Message:
-----------
pgfkeysearch (30dec23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/pgfkeysearch/README.md
trunk/Master/texmf-dist/doc/latex/pgfkeysearch/pgfkeysearch.pdf
trunk/Master/texmf-dist/doc/latex/pgfkeysearch/pgfkeysearch.tex
trunk/Master/texmf-dist/tex/latex/pgfkeysearch/pgfkeysearch.sty
Modified: trunk/Master/texmf-dist/doc/latex/pgfkeysearch/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgfkeysearch/README.md 2023-12-30 21:26:08 UTC (rev 69242)
+++ trunk/Master/texmf-dist/doc/latex/pgfkeysearch/README.md 2023-12-30 21:26:16 UTC (rev 69243)
@@ -34,6 +34,28 @@
The Current Maintainer of this work is Alceu Frigeri
+-------------
+## This work consist of the files
+* pgfkeysearch.sty
+ - the package itself
+
+* README.md (this file)
+ - quick introduction
+
+* pgfkeysearch.tex
+ - pakcage documentation
+* pgfkeysearch.pdf
+ - documentation in PDF format
+
+-------------
+
+## Changelog
+
+* Version 1.1 (this)
+ - More typos.
+ - renamed some internal variables to better follow the expl3 recommendations.
+ - exposing the Expl3 commands.
+
* Version 1.0
- Initial setup.
Modified: trunk/Master/texmf-dist/doc/latex/pgfkeysearch/pgfkeysearch.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/pgfkeysearch/pgfkeysearch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgfkeysearch/pgfkeysearch.tex 2023-12-30 21:26:08 UTC (rev 69242)
+++ trunk/Master/texmf-dist/doc/latex/pgfkeysearch/pgfkeysearch.tex 2023-12-30 21:26:16 UTC (rev 69243)
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Alceu Frigeri
%%
-%% This is version {1.5} {2023/11/28}
+%% This is version {1.5} {2023/12/29}
%%
%% The list of files that compose this work can be found in the README.md file at
%% https://ctan.org/pkg/pgfkeysearch
@@ -51,7 +51,7 @@
\tsobj[marg]{path-list} is a comma separated list (clist) of paths (can be a single one). \tsobj[marg]{key} is the desired key and \tsobj[marg]{macro} is the macro/command that will receive (store) the key value (if one was found).
For instance, given a path /A/B/C/D it will look first at /A/B/C/D/\tsobj[marg]{key}, them /A/B/C/\tsobj[marg]{key}, and so on, until /A/\tsobj[marg]{key},
-Stopping at the first hit, returning the value found in the \tsobj[marg]{macro}.
+stopping at the first hit, returning the value found in the \tsobj[marg]{macro}.
The branch version will also execute either \tsobj[marg,sep={or}]{if-found,if-not}.
\end{codedescribe}
@@ -61,26 +61,31 @@
\begin{codestore}[keyval.demo]
\pgfkeys{/tikz/A/.cd,
- keyA/.initial={A keyA},
- keyB/.initial={A keyB},
+ keyA/.initial={keyA at /tikz/A},
+ keyB/.initial={keyB at /tikz/A},
B/.cd,
- keyA/.initial={B keyA},
- keyC/.initial={B keyC},
+ keyA/.initial={keyA at /tikz/A/B},
+ keyC/.initial={keyC at /tikz/A/B},
C/.cd,
- keyX/.initial={C keyX} }
+ keyX/.initial={keyX at /tikz/A/B/C} }
\pgfkeysearchvalueof{/tikz/A/B/C}{keyA}{\VALkeyA}
\pgfkeysearchvalueof{/tikz/A/B/C}{keyB}{\VALkeyB}
\pgfkeysearchvalueof{/tikz/A/B/C}{keyC}{\VALkeyC}
\pgfkeysearchvalueof{/tikz/A/B/C}{keyX}{\VALkeyX}
-
I got for keyA: \textbf{\VALkeyA} \par
I got for keyB: \textbf{\VALkeyB} \par
I got for keyC: \textbf{\VALkeyC} \par
I got for keyX: \textbf{\VALkeyX} \par
-
\end{codestore}
\tsdemo[emph={pgfkeysearchvalueof}]{keyval.demo}
-
-\end{document}
\ No newline at end of file
+\section{Expl3 Base Commands}
+\begin{codedescribe}{\pgfkeysearch_multipath_keysearch:nnnTF,\pgfkeysearch_keysearch:nnnTF}
+\begin{codesyntax}%
+\tsmacro{\pgfkeysearch_multipath_keysearch:nnnTF}{path-list,key,macro,if-found,if-not}
+\tsmacro{\pgfkeysearch_keysearch:nnnTF}{single-path,key,macro,if-found,if-not}
+\end{codesyntax}
+These are the \tsobj[pkg]{Expl3} version of it (for package writers). In fact, the \tsobj{\pgfkeysearchvalueof} is just a wrapper to \tsobj{\pgfkeysearch_multipath_keysearch:nnnTF}. The \tsobj{\pgfkeysearch_keysearch:nnnTF} is the single path version.
+\end{codedescribe}
+\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/pgfkeysearch/pgfkeysearch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgfkeysearch/pgfkeysearch.sty 2023-12-30 21:26:08 UTC (rev 69242)
+++ trunk/Master/texmf-dist/tex/latex/pgfkeysearch/pgfkeysearch.sty 2023-12-30 21:26:16 UTC (rev 69243)
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Alceu Frigeri
%%
-%% This is version {1.0} {2023/12/27}
+%% This is version {1.1} {2023/12/29}
%%
%% The list of files that compose this work can be found in the README.md file at
%% https://ctan.org/pkg/pgfkeysearch
@@ -23,8 +23,8 @@
\ProvidesExplPackage
{pgfkeysearch}
- {2023/12/27}
- {1.0}
+ {2023/12/29}
+ {1.1}
{pgfkeys Search Extension}
\ExplSyntaxOn
@@ -38,8 +38,8 @@
{
name .code:n = {pgfkeysearch} ,
prefix .code:n = {pgfkeysearch} ,
- date .code:n = {2023/12/27},
- version .code:n = {1.0} ,
+ date .code:n = {2023/12/29},
+ version .code:n = {1.1} ,
description .code:n = {pgfkeys Search Extension}
}
\cs_if_exist:NF \__codedesc_pkg_info:nn
@@ -60,89 +60,24 @@
%%% End of cut-n-paste
%%%%%%%
-
%%%%%%%%%%%%%%%
%%%
-%%% Expl3 machinery. _keysearch_ allows to find a key,
+%%% _keysearch allows to find a key,
%%% if it's defined from 'anywhere' in the tree. I mean, upwards until, likely, /tikz/<key>
%%% if it isn't defined, returns nothing (no error triggered)
%%%
%%%%%%%%%%%%%%%
-\seq_new:N \l__ctikzext_pathterms_seq
-\seq_new:N \l__ctikzext_pathtree_seq
-\tl_new:N \l__ctikzext_key_tl
-\tl_new:N \l__ctikzext_path_tl
+\seq_new:N \l__pgfkeysearch_pathterms_seq
+\seq_new:N \l__pgfkeysearch_pathtree_seq
+\tl_new:N \l__pgfkeysearch_path_tl
+\bool_new:N \l__pgfkeysearch_keyfound_bool
+\bool_new:N \l__pgfkeysearch_multipath_keyfound_bool
+\cs_generate_variant:Nn \tl_set:Nn {Ne}
-%%%%%%%%%%%%%%%%
-%%%%
-%%%% This works BUT, it isn't expandable and not a 1-to-1 replacement for pgfkeysvalueof (which is fully expandable)
-%%%% don't use this unless you know what you are doing. To avoid trouble tickets headaches, it's commeted out
-%%%%
-%%%%%%%%%%%%%%%%
-%\cs_new_protected:Npn \__ctikzext_keysearch:n #1
-% {
-% \seq_set_split:Nne \l__ctikzext_pathterms_seq {/} {#1}
-% \seq_pop_right:NN \l__ctikzext_pathterms_seq \l__ctikzext_key_tl
-% \seq_remove_all:Nn \l__ctikzext_pathterms_seq {}
-% \tl_clear:N \l__ctikzext_path_tl
-% \seq_clear:N \l__ctikzext_pathtree_seq
-% \seq_map_inline:Nn \l__ctikzext_pathterms_seq
-% {
-% \tl_put_right:Ne \l__ctikzext_path_tl {/##1}
-% \seq_put_right:Ne \l__ctikzext_pathtree_seq {\l__ctikzext_path_tl}
-% }
-% \seq_reverse:N \l__ctikzext_pathtree_seq
-% \seq_map_inline:Nn \l__ctikzext_pathtree_seq
-% {
-% \cs_if_exist:cT {pgfk@##1/\l__ctikzext_key_tl}
-% {
-% \exp_args:Ne \use:c {pgfk@##1/\l__ctikzext_key_tl}
-% \seq_map_break:
-% }
-% }
-% }
-
-
-
%%%%%%%%%%%%%%%
%%%
-%%% Deplecated... single path key search (just a bit faster if a single path)
-%%%
-%%%%%%%%%%%%%%%
-%\prg_new_protected_conditional:Npnn \__ctikzext_keysearch:nn #1#2 {TF,T,F}
-% {
-% \seq_set_split:Nne \l__ctikzext_pathterms_seq {/} {#1}
-% \seq_pop_right:NN \l__ctikzext_pathterms_seq \l__ctikzext_key_tl
-% \seq_remove_all:Nn \l__ctikzext_pathterms_seq {}
-% \tl_clear:N \l__ctikzext_path_tl
-% \seq_clear:N \l__ctikzext_pathtree_seq
-% \seq_map_inline:Nn \l__ctikzext_pathterms_seq
-% {
-% \tl_put_right:Ne \l__ctikzext_path_tl {/##1}
-% \seq_put_right:Ne \l__ctikzext_pathtree_seq {\l__ctikzext_path_tl}
-% }
-% \seq_reverse:N \l__ctikzext_pathtree_seq
-% \bool_set_false:N \l__ctikzext_valuefound_bool
-% \seq_map_inline:Nn \l__ctikzext_pathtree_seq
-% {
-% \cs_if_exist:cT {pgfk@##1/\l__ctikzext_key_tl}
-% {
-% \tl_set:Ne #2 {\exp_not:N \use:c{pgfk@##1/\l__ctikzext_key_tl}}
-% \bool_set_true:N \l__ctikzext_valuefound_bool
-% \seq_map_break:
-% }
-% }
-% \bool_if:nTF {\l__ctikzext_valuefound_bool}
-% { \prg_return_true: }
-% { \prg_return_false: }
-% }
-
-
-
-%%%%%%%%%%%%%%%
-%%%
-%%% Given a path /A/B/C/D it will look after
+%%% Given a single path /A/B/C/D it will look after
%%% /A/B/C/D/<key>
%%% /A/B/C/<key>
%%% /A/B/<key>
@@ -150,64 +85,57 @@
%%% stoping at the first hit
%%%
%%%%%%%%%%%%%%%
-
-\bool_new:N \l__ctikzext_valuefound_bool
-\prg_new_protected_conditional:Npnn \__ctikzext_keysearch:nnn #1#2#3 {TF,T,F}
+\prg_new_protected_conditional:Npnn \pgfkeysearch_keysearch:nnn #1#2#3 {TF,T,F}
{
- \seq_set_split:Nne \l__ctikzext_pathterms_seq {/} {#1}
- \seq_remove_all:Nn \l__ctikzext_pathterms_seq {}
- \tl_clear:N \l__ctikzext_path_tl
- \seq_clear:N \l__ctikzext_pathtree_seq
- \seq_map_inline:Nn \l__ctikzext_pathterms_seq
+ \seq_set_split:Nne \l__pgfkeysearch_pathterms_seq {/} {#1}
+ \seq_remove_all:Nn \l__pgfkeysearch_pathterms_seq {}
+ \tl_clear:N \l__pgfkeysearch_path_tl
+ \seq_clear:N \l__pgfkeysearch_pathtree_seq
+ \seq_map_inline:Nn \l__pgfkeysearch_pathterms_seq
{
- \tl_put_right:Ne \l__ctikzext_path_tl {/##1}
- \seq_put_right:Ne \l__ctikzext_pathtree_seq {\l__ctikzext_path_tl}
+ \tl_put_right:Ne \l__pgfkeysearch_path_tl {/##1}
+ \seq_put_right:Ne \l__pgfkeysearch_pathtree_seq {\l__pgfkeysearch_path_tl}
}
- \seq_reverse:N \l__ctikzext_pathtree_seq
- \bool_set_false:N \l__ctikzext_valuefound_bool
- \seq_map_inline:Nn \l__ctikzext_pathtree_seq
+ \seq_reverse:N \l__pgfkeysearch_pathtree_seq
+ \bool_set_false:N \l__pgfkeysearch_keyfound_bool
+ \seq_map_inline:Nn \l__pgfkeysearch_pathtree_seq
{
\cs_if_exist:cT {pgfk@##1/#2}
{
\tl_set:Ne #3 {\exp_not:N \use:c{pgfk@##1/#2}}
- \bool_set_true:N \l__ctikzext_valuefound_bool
+ \bool_set_true:N \l__pgfkeysearch_keyfound_bool
\seq_map_break:
}
}
- \bool_if:nTF {\l__ctikzext_valuefound_bool}
+ \bool_if:nTF {\l__pgfkeysearch_keyfound_bool}
{ \prg_return_true: }
{ \prg_return_false: }
}
-
-
-
%%%%%%%%%%%%%%%
%%%
%%% #1 shall be a comma separated list of paths (can be a single one)
-%%% it searchs for the key in every path, stoping at the first hit.
+%%% it searchs for key in every path, stoping at the first hit.
%%%
%%%%%%%%%%%%%%%
-
-\bool_new:N \l__ctikzext_multisearch_bool
-\prg_new_protected_conditional:Npnn \__ctikzext_multipath_keysearch:nnn #1#2#3 {T,F,TF}
+\prg_new_protected_conditional:Npnn \pgfkeysearch_multipath_keysearch:nnn #1#2#3 {T,F,TF}
{
- \bool_set_false:N \l__ctikzext_multisearch_bool
+ \bool_set_false:N \l__pgfkeysearch_multipath_keyfound_bool
\clist_map_inline:nn {#1}
{
- \__ctikzext_keysearch:nnnT {##1}{#2}{#3}
+ \pgfkeysearch_keysearch:nnnT {##1}{#2}{#3}
{
- \bool_set_true:N \l__ctikzext_multisearch_bool
+ \bool_set_true:N \l__pgfkeysearch_multipath_keyfound_bool
\clist_map_break:
}
}
- \bool_if:nTF {\l__ctikzext_multisearch_bool}
+ \bool_if:nTF {\l__pgfkeysearch_multipath_keyfound_bool}
{ \prg_return_true: }
{ \prg_return_false: }
}
-\cs_generate_variant:Nn \tl_set:Nn {Ne}
+
%%%%%%%%%%%%%%%
%%%
%%% The caveats: this ins't expandable.
@@ -223,13 +151,13 @@
\NewDocumentCommand{\pgfkeysearchvalueof}{mmm}
{
- \__ctikzext_multipath_keysearch:nnnF {#1}{#2}{#3}
+ \pgfkeysearch_multipath_keysearch:nnnF {#1}{#2}{#3}
{ \tl_set:Nn #3 {} }
}
\NewDocumentCommand{\pgfkeysearchvalueofTF}{mmmmm}
{
- \__ctikzext_multipath_keysearch:nnnTF {#1}{#2}{#3}
+ \pgfkeysearch_multipath_keysearch:nnnTF {#1}{#2}{#3}
{ #4 }
{
\tl_set:Nn #3 {}
More information about the tex-live-commits
mailing list.