[latex3-commits] [git/LaTeX3-latex3-pdfresources] test-new-hooks: adapt to new hook code (68a05a2)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun May 3 19:29:55 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : test-new-hooks
Link       : https://github.com/latex3/pdfresources/commit/68a05a2886d747568dc4646959d4659b51ae24bf

>---------------------------------------------------------------

commit 68a05a2886d747568dc4646959d4659b51ae24bf
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun May 3 19:29:55 2020 +0200

    adapt to new hook code


>---------------------------------------------------------------

68a05a2886d747568dc4646959d4659b51ae24bf
 pdfresources.dtx                    | 36 +++++++++++++++++++++++-------------
 testfiles/catalog-remove.luatex.tlg |  8 +-------
 testfiles/catalog-remove.tlg        |  8 +-------
 testfiles/catalog-remove.xetex.tlg  |  8 +-------
 testfiles/dict_if_empty.luatex.tlg  |  7 ++-----
 testfiles/dict_if_empty.tlg         |  7 ++-----
 testfiles/dict_if_empty.xetex.tlg   |  7 ++-----
 7 files changed, 32 insertions(+), 49 deletions(-)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index 0b48f20..0892833 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -38,7 +38,7 @@
 %<*package>
 \RequirePackage{xparse,l3pdf}
 %\RequirePackage{tmpl3shipout}
-\RequirePackage{atbegshi,zref-lastpage}
+\RequirePackage{lthooks,zref-lastpage}
 \ProvidesExplPackage {pdfresources} {2020-04-08} {0.5}
   {experimental pdf-resource management}
 \DeclareOption { debug }
@@ -251,9 +251,10 @@
   {
     \cs_new_protected:Npn \@@_BACKEND_end_run:
       {
-        \AtEndDocument
+        \hook_gput_code:nnn {enddocument/afterlastpage}
+          {pdf}
           {
-            \clearpage \g_@@_BACKEND_end_run_tl
+            \g_@@_BACKEND_end_run_tl
           }
       }
   }
@@ -306,13 +307,15 @@
     \tl_gput_right:Nn \g_@@_BACKEND_thispage_shipout_tl { #1 }
   }
 
-\AtBeginShipout
-  {
-    \AtBeginShipoutAddToBox
-      {
-        \@@_BACKEND_shipout_code:
-      }
-  }
+%box needed??
+\hook_gput_code:nnn{shipout}{pdf}{\AtBeginShipoutAddToBox { \@@_BACKEND_shipout_code:} }
+%\AtBeginShipout
+%  {
+%    \AtBeginShipoutAddToBox
+%      {
+%        \@@_BACKEND_shipout_code:
+%      }
+%  }
 
 \cs_new_protected:Npn \@@_BACKEND_shipout_code:
   {
@@ -3799,7 +3802,10 @@
       }
   }
 \def\pgfutil at setuppdfresources{\@@_pgf_sys_setuppdfresources_plain:}
-\AtEndPreamble{\pgfutil at setuppdfresources}
+
+%label??
+\hook_gput_code:nnn {begindocument/end} {pdf} { \pgfutil at setuppdfresources }
+%\AtEndPreamble{\pgfutil at setuppdfresources}
 % helper commands as pgf doesn't pass resources as two arguments
 % code to add to the resources existing stuff in the format "/name value":
 \cs_new:Npn \@@_split_dict_entry_aux:NNw #1 #2 /#3~#4\q_stop
@@ -3836,7 +3842,10 @@
 % transparent, we assume that pdfresource is loaded first.
 % the code does nothing is with new-transparent ...
 %    \begin{macrocode}
-\AtEndPreamble
+
+%label??
+\hook_gput_code:nnn {begindocument/end} {pdf}
+%\AtEndPreamble
   {
     \def\TRP at addresource
       {
@@ -3861,7 +3870,8 @@
 % it can not be avoided to recreate the objects (and so to get duplicates)
 % as colorspace uses temporary macros whose contents is lost.
 %    \begin{macrocode}
-\AtEndPreamble
+\hook_gput_code:nnn {begindocument/end} {pdf}
+%\AtEndPreamble
   {
     \tl_if_exist:NT \spc at op
       {
diff --git a/testfiles/catalog-remove.luatex.tlg b/testfiles/catalog-remove.luatex.tlg
index 9f8e1cd..6f1aa67 100644
--- a/testfiles/catalog-remove.luatex.tlg
+++ b/testfiles/catalog-remove.luatex.tlg
@@ -39,10 +39,4 @@ outer braces):
 <recently read> }
 l. ...\pdfdict_show:n {Catalog/AcroForm/DR/Font}
 [1
-]
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line ....
-Package atveryend Info: Executing hook `AfterLastShipout' on input line ...
-(catalog-remove.aux)
-Package atveryend Info: Empty hook `AtVeryEndDocument' on input line ....
-Package atveryend Info: Empty hook `AtEndAfterFileList' on input line ....
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line ....
+] (catalog-remove.aux)
diff --git a/testfiles/catalog-remove.tlg b/testfiles/catalog-remove.tlg
index 9f8e1cd..6f1aa67 100644
--- a/testfiles/catalog-remove.tlg
+++ b/testfiles/catalog-remove.tlg
@@ -39,10 +39,4 @@ outer braces):
 <recently read> }
 l. ...\pdfdict_show:n {Catalog/AcroForm/DR/Font}
 [1
-]
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line ....
-Package atveryend Info: Executing hook `AfterLastShipout' on input line ...
-(catalog-remove.aux)
-Package atveryend Info: Empty hook `AtVeryEndDocument' on input line ....
-Package atveryend Info: Empty hook `AtEndAfterFileList' on input line ....
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line ....
+] (catalog-remove.aux)
diff --git a/testfiles/catalog-remove.xetex.tlg b/testfiles/catalog-remove.xetex.tlg
index 9e8f35e..6f1aa67 100644
--- a/testfiles/catalog-remove.xetex.tlg
+++ b/testfiles/catalog-remove.xetex.tlg
@@ -38,11 +38,5 @@ outer braces):
 >  {NameB}  =>  {<</ABC/CDE>>}.
 <recently read> }
 l. ...\pdfdict_show:n {Catalog/AcroForm/DR/Font}
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line ....
 [1
-]
-Package atveryend Info: Executing hook `AfterLastShipout' on input line ...
-(catalog-remove.aux)
-Package atveryend Info: Empty hook `AtVeryEndDocument' on input line ....
-Package atveryend Info: Empty hook `AtEndAfterFileList' on input line ....
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line ....
+] (catalog-remove.aux)
diff --git a/testfiles/dict_if_empty.luatex.tlg b/testfiles/dict_if_empty.luatex.tlg
index c07257d..af3764e 100644
--- a/testfiles/dict_if_empty.luatex.tlg
+++ b/testfiles/dict_if_empty.luatex.tlg
@@ -3,6 +3,7 @@ Don't change this file in any respect.
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0, direction TLT
 .\hbox(0.0+0.0)x0.0, direction TLT
+.\hbox(0.0+0.0)x0.0, direction TLT
 ..\latelua0{l3kernel.__pdf.backend_ThisPage_gpush(tex.count["g__pdf_abspage_int
 "]\ETC.}
 .\glue 16.0
@@ -119,9 +120,5 @@ Completed box being shipped out [1]
 ...\TU/lmr/m/n/10 1
 ...\glue 0.0 plus 1.0fil
 .\kern0.0
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line ....
-Package atveryend Info: Executing hook `AfterLastShipout' on input line ...
+.\kern0.0
 (dict_if_empty.aux)
-Package atveryend Info: Empty hook `AtVeryEndDocument' on input line ....
-Package atveryend Info: Empty hook `AtEndAfterFileList' on input line ....
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line ....
diff --git a/testfiles/dict_if_empty.tlg b/testfiles/dict_if_empty.tlg
index 7f66453..a58b492 100644
--- a/testfiles/dict_if_empty.tlg
+++ b/testfiles/dict_if_empty.tlg
@@ -3,6 +3,7 @@ Don't change this file in any respect.
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
 .\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
 .\glue 16.0
 .\vbox(617.0+0.0)x345.0, shifted 62.0
 ..\vbox(12.0+0.0)x345.0, glue set 12.0fil
@@ -95,9 +96,5 @@ Completed box being shipped out [1]
 ...\OT1/cmr/m/n/10 1
 ...\glue 0.0 plus 1.0fil
 .\kern 0.0
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line ....
-Package atveryend Info: Executing hook `AfterLastShipout' on input line ...
+.\kern 0.0
 (dict_if_empty.aux)
-Package atveryend Info: Empty hook `AtVeryEndDocument' on input line ....
-Package atveryend Info: Empty hook `AtEndAfterFileList' on input line ....
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line ....
diff --git a/testfiles/dict_if_empty.xetex.tlg b/testfiles/dict_if_empty.xetex.tlg
index 672bb30..21de67d 100644
--- a/testfiles/dict_if_empty.xetex.tlg
+++ b/testfiles/dict_if_empty.xetex.tlg
@@ -1,9 +1,9 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line ....
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
 .\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
 ..\special{pdf: put @thispage <</Rotate 90 >>}
 ..\special{pdf:put @pages <<>>}
 .\glue 16.0
@@ -68,8 +68,5 @@ Completed box being shipped out [1]
 ...\TU/lmr/m/n/10 1
 ...\glue 0.0 plus 1.0fil
 .\kern 0.0
-Package atveryend Info: Executing hook `AfterLastShipout' on input line ...
+.\kern 0.0
 (dict_if_empty.aux)
-Package atveryend Info: Empty hook `AtVeryEndDocument' on input line ....
-Package atveryend Info: Empty hook `AtEndAfterFileList' on input line ....
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line ....





More information about the latex3-commits mailing list.