[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: use a hook for better timing (cb50451)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Jan 20 16:37:34 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/cb50451459f386dce1df809dc3c3b70e3e1ebebc

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

commit cb50451459f386dce1df809dc3c3b70e3e1ebebc
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jan 20 16:37:34 2021 +0100

    use a hook for better timing


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

cb50451459f386dce1df809dc3c3b70e3e1ebebc
 l3pdfmanagement.dtx | 9 ++++++++-
 ltdocinit.dtx       | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/l3pdfmanagement.dtx b/l3pdfmanagement.dtx
index 26a1510..4205e5e 100644
--- a/l3pdfmanagement.dtx
+++ b/l3pdfmanagement.dtx
@@ -522,14 +522,21 @@
   \pdfmanagement_if_active: \@@_if_active: { p , T , F , TF }
 
 %    \end{macrocode}
+% We use a hook, to collect value added before the backend is ready.
 %    \begin{macrocode}
+\hook_new:n {pdfmanagement/add}
 \cs_new_protected:Npn \pdfmanagement_add:nnn #1 #2 #3
   {
     \@@_if_active:TF
       {
         \pdfdict_if_exist:nTF { g__pdf_Core/#1 }
           {
-            \@@_handler_gput:nnn { #1 }{ #2 }{ #3 }
+            \hook_gput_code:nnn
+              {pdfmanagement/add}
+              {pdfmanagement}
+              {
+                \@@_handler_gput:nnn { #1 }{ #2 }{ #3 }
+              }
           }
           {
             \msg_error:nnn{pdfmanagement}{unknown-dict}{#1}
diff --git a/ltdocinit.dtx b/ltdocinit.dtx
index bcfa1ab..737b48c 100644
--- a/ltdocinit.dtx
+++ b/ltdocinit.dtx
@@ -129,6 +129,7 @@
           {
             \PassOptionsToPackage{customdriver=hgeneric-experimental}{hyperref}
           }
+        \hook_use_once:n {pdfmanagement/add}  
         \RenewDocumentCommand\DeclareDocumentMetadata { m }
           {
             \keys_set_filter:nnn  { pdf / setup } { init } { ##1 }





More information about the latex3-commits mailing list.