[latex3-commits] [git/LaTeX3-latex3-pdfresources] splitting: removed merge command - it is used only once (5ec2b18)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Jul 7 19:16:29 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : splitting
Link       : https://github.com/latex3/pdfresources/commit/5ec2b18ca648c8c2d5f45199f952f64d6b161026

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

commit 5ec2b18ca648c8c2d5f45199f952f64d6b161026
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Jun 16 16:39:40 2020 +0200

    removed merge command - it is used only once


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

5ec2b18ca648c8c2d5f45199f952f64d6b161026
 l3pdfdict.dtx    |  8 ++++----
 l3pdfgdict.dtx   | 18 ------------------
 pdfresources.dtx | 56 ++++++++++++++++++++++++++++++++++----------------------
 3 files changed, 38 insertions(+), 44 deletions(-)

diff --git a/l3pdfdict.dtx b/l3pdfdict.dtx
index b9eaf1d..a65697e 100644
--- a/l3pdfdict.dtx
+++ b/l3pdfdict.dtx
@@ -201,15 +201,14 @@
 %   escaping. It does nothing if \Arg{value} is empty.
 % \end{function}
 % \subsection{Predeclared dictionaries}
-% The module predeclares a number of dictionaries and fills them with
-% some standard values. These dictionaries are meant has templates. They can
+% The module predeclares a number of local dictionaries and fills them with
+% some standard values. These dictionaries are meant as templates. They can
 % be changed and used directly but this should be done only inside
 % groups when no other code is involved which tries to change them too.
+% The following tabular summarize the predeclared dictionaries.
 % \begin{NOTE}{UF}
 % Check which (local) dictionaries should be predefined.
 % Check also if the reset idea makes sense. (Removed for now)
-% The following tabular summarize the dictionaries
-%
 % \end{NOTE}
 %
 % \medskip
@@ -680,6 +679,7 @@
 %</package>
 %    \end{macrocode}
 % \end{macro}
+%
 % \subsection{Predeclared dictionaries}
 % \begin{variable}{page/Trans}
 %     \begin{macrocode}
diff --git a/l3pdfgdict.dtx b/l3pdfgdict.dtx
index 4dd5cb7..172dfcf 100644
--- a/l3pdfgdict.dtx
+++ b/l3pdfgdict.dtx
@@ -639,24 +639,6 @@
 % \end{macro}
 %
 %
-% \begin{macro}{ \@@_gmerge:nnN }
-% \cs{@@_gmerge:nnN} merges at first the property \meta{name_1}
-%  then optionally \meta{name_2} into property |#3|.
-%    \begin{macrocode}
-
-\cs_new_protected:Npn \@@_gmerge:nnN #1 #2 #3
-  {
-    \prop_gset_eq:Nc #3 { \pdfdict_gname:n  { #1 } }
-    \prop_if_exist:cT  { \pdfdict_gname:n  { #2 } }
-      {
-        \prop_map_inline:cn { \pdfdict_gname:n  { #2 } }
-          {
-            \prop_gput:Nnn #3 { ##1 }{ ##2 }
-          }
-      }
-  }
-%    \end{macrocode}
-% \end{macro}
 %    \begin{macrocode}
 \cs_new_protected:Npn \pdfgdict_show:n #1
   {
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 2d8ccc5..7042dd2 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -363,7 +363,6 @@
   }
 %</pdfmode>
 %<*dvips>
-%dvips
 \cs_new_protected:Npx \@@_backend_Pages_primitive:n #1
   {
     \tex_special:D{ps:~[#1~/PAGES~pdfmark} %]
@@ -377,7 +376,7 @@
 %</xdvipdfmx>
 %    \end{macrocode}
 % \end{macro}
-%<*package>
+%
 % \subsubsection{\enquote{Pages} / management}
 % \begin{NOTE}{UF}
 % The register is normally used only a few times in a document, so it would be
@@ -385,8 +384,8 @@
 % but with dvips/dvipdfmx this would disable removing entries.
 % So we issue the push code only at the end of the document.
 % \end{NOTE}
-% moved to l3pdfgdict
-%</package>
+%  code moved to l3pdfgdict
+%
 % \subsection{\enquote{Page} and \enquote{ThisPage} (pdfpageattr)}
 % \subsubsection{\enquote{Page} and \enquote{ThisPage} /backend}
 % \begin{NOTE}{UF}
@@ -401,18 +400,21 @@
 %  this differences. Simply variants of \cs{pdfpageattr} are not enough ...%
 %  dvips syntax: \special{ps: [{ThisPage}<</Rotate 90>> /PUT pdfmark}%
 %  There seem to be an in-built management code: multiple uses don't lead to
-%  multiple entries (/Rotate is special: there is always a /Rotate 0 in the dict, but seems
-%  not to do harm).
-%  dvipdfmx syntax: \special{pdf: put @thispage << /Rotate 90 >>}, like dvips has an in-built
-%  management code.
+%  multiple entries (/Rotate is special: there is always a /Rotate 0 in the dict,
+%  but seems not to do harm).
+%  dvipdfmx syntax: \special{pdf: put @thispage << /Rotate 90 >>},
+%  like dvips the backend has an in-built  management code.
 %  Both change only the current page, so to get the pdftex behavior (which sets
 %  also the following pages) one need to repeat it on every shipout.
 % \end{NOTE}
-% \begin{macro}{\@@_backend_Page_primitive:n,
-%               \@@_backend_Page_gput:nn,
-%               \@@_backend_Page_gremove:n,
-%               \@@_backend_ThisPage_gput:nn,
-%               \@@_backend_ThisPage_gpush:n }
+% \begin{macro}
+%   {
+%     \@@_backend_Page_primitive:n,
+%     \@@_backend_Page_gput:nn,
+%     \@@_backend_Page_gremove:n,
+%     \@@_backend_ThisPage_gput:nn,
+%     \@@_backend_ThisPage_gpush:n
+%   }
 % \cs{@@_backend_Page_primitive:n} is the primitive command to add
 % something to the /Page dictionary.
 % It works differently for the backends: pdftex and luatex overwrite existing
@@ -421,15 +423,15 @@
 % \cs{@@_backend_Page_gput:nn} stores default values.
 % \cs{@@_backend_Page_gremove:n} allows to remove a value.
 % \cs{@@_backend_ThisPage_gput:nn} adds a value to the current page.
-% \cs{@@_backend_ThisPage_gpush:n} merges the default and the page value and
-% adds it to the dictionary of the current page in
+% \cs{@@_backend_ThisPage_gpush:n} merges the default and the current page values
+% and add them to the dictionary of the current page in
 % \cs{g_@@_backend_thispage_shipout_tl}.
 %    \begin{macrocode}
 %  backend commands
 %<*pdfmode>
 \sys_if_engine_pdftex:T
   {
-  %the primitive
+    %the primitive
     \cs_new_protected:Npn \@@_backend_Page_primitive:n #1
       {
         \tex_global:D \tex_pdfpageattr:D { #1 }
@@ -437,10 +439,10 @@
   % the command to store default values.
   % Uses a prop with pdflatex + dvi,
   % sets a lua table with lualatex
-  \cs_new_protected:Npn \@@_backend_Page_gput:nn #1 #2 %key,value
-    {
-      \pdfdict_gput:nnn {Page}{ #1 }{ #2 }
-    }
+   \cs_new_protected:Npn \@@_backend_Page_gput:nn #1 #2 %key,value
+     {
+       \pdfdict_gput:nnn {Page}{ #1 }{ #2 }
+     }
   % the command to remove a default value.
   % Uses a prop with pdflatex + dvi,
   % changes a lua table with lualatex
@@ -455,6 +457,7 @@
  % write to aux and store in prop with pdflatex
   \cs_new_protected:Npn \@@_backend_ThisPage_gput:nn #1 #2
     {
+      %we need to know the page the resource should be added too.
       \int_gincr:N\g_@@_backend_resourceid_int
       \zref at labelbylist {l3pdf\int_use:N\g_@@_backend_resourceid_int} {l3pdf}
       \tl_set:Nx \l_@@_tmpa_tl
@@ -468,7 +471,9 @@
         {
           \pdfdict_gnew:n          {backend_Page\l_@@_tmpa_tl}
         }
-      \__pdfgdict_handler_gput:nnn {backend_Page\l_@@_tmpa_tl}{ #1 }{ #2 }
+      %\__pdfgdict_handler_gput:nnn {backend_Page\l_@@_tmpa_tl}{ #1 }{ #2 }
+      %backend_Page has no handler.
+      \pdfdict_gput:nnn {backend_Page\l_@@_tmpa_tl}{ #1 }{ #2 }
     }
   %the code to push the values, used in shipout
   %merges the two props and then fills the register in pdflatex
@@ -476,7 +481,14 @@
   %issues the values stored in the global prop with dvi
   \cs_new_protected:Npn \@@_backend_ThisPage_gpush:n #1
     {
-      \__pdfgdict_gmerge:nnN {Page}{backend_Page#1}\g_@@_tmpa_prop
+      \prop_gset_eq:Nc \g_@@_tmpa_prop { \pdfdict_gname:n  { Page } }
+      \prop_if_exist:cT  { \pdfdict_gname:n  { backend_Page#1 } }
+        {
+          \prop_map_inline:cn { \pdfdict_gname:n  { backend_Page#1 } }
+            {
+              \prop_gput:Nnn \g_@@_tmpa_prop { ##1 }{ ##2 }
+            }
+        }
       \exp_args:Nx \@@_backend_Page_primitive:n
         {
           \prop_map_function:NN \g_@@_tmpa_prop \pdfdict_item:ne





More information about the latex3-commits mailing list.