[latex3-commits] [git/LaTeX3-latex3-pdfresources] master: starting unknown choices handling (085ff7c)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed Apr 1 00:49:48 CEST 2020
Repository : https://github.com/latex3/pdfresources
On branch : master
Link : https://github.com/latex3/pdfresources/commit/085ff7c48e8739b2d8210e901d9632aed5ebe290
>---------------------------------------------------------------
commit 085ff7c48e8739b2d8210e901d9632aed5ebe290
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed Apr 1 00:49:48 2020 +0200
starting unknown choices handling
>---------------------------------------------------------------
085ff7c48e8739b2d8210e901d9632aed5ebe290
hgeneric-experimental.def | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index b89527c..152c871 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -100,6 +100,16 @@
{
unknown~key~#2~of~module~’#1’~set~to~’#3’.
}
+\msg_new:nnn
+ { hyp }
+ { unknown-choice }
+ {
+ Value~'#3'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ \clist_map_function:nN { #2 }\__hyp_clist_display:n
+ An~empty~value~removes~the~setting.
+ }
+\cs_new:Npn \__hyp_clist_display:n #1 {*~#1\\}
%% I require the bookmark package to get rid of some of the bookmarks code.
% but the testing code doesn't work.
% !!!!!!!!!!!!!!!!!!!!! to do !!!!!!!!!!!!!!!!!!!!!
@@ -818,6 +828,11 @@
}
,pdfdirection / .code:n =
{ \pdf_catalog_gremove:n { ViewerPreferences / Direction } }
+ ,pdfdirection / unknown .code:n =
+ \msg_error:nnxxx { hyp } { unknown-choice }
+ { pdfdirection } % Name of choice key
+ { L2R , R2L } % Valid choices
+ { \exp_not:n {#1} }, % Invalid choice given
,pdfduplex .choices:nn =
{Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge}
{
More information about the latex3-commits
mailing list.