[latex3-commits] [latex3/latex3] main: Expand object names (closes #1521) (bcfbc26be)

github at latex-project.org github at latex-project.org
Tue Mar 26 10:53:03 CET 2024


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/bcfbc26beede9356282a30802df8a0c3c2cc956e

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

commit bcfbc26beede9356282a30802df8a0c3c2cc956e
Author: Joseph Wright <joseph at texdev.net>
Date:   Tue Mar 26 09:51:59 2024 +0000

    Expand object names (closes #1521)


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

bcfbc26beede9356282a30802df8a0c3c2cc956e
 l3kernel/CHANGELOG.md |  3 +++
 l3kernel/l3pdf.dtx    | 13 ++++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index d2f2fd7c6..d1bf5e43a 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Expand object names in `\pdf_object_...` functions (issue \#1521)
+
 ### Fixed
 - Global assignment to constant in `\cctab_const:Nn` (issue \#1508)
 - Undefined `\__kernel_iwo_open:Nn` used in `\iow_shell_open:Nn`
diff --git a/l3kernel/l3pdf.dtx b/l3kernel/l3pdf.dtx
index a0e704ddc..a4b7f6200 100644
--- a/l3kernel/l3pdf.dtx
+++ b/l3kernel/l3pdf.dtx
@@ -51,6 +51,9 @@
 %
 % \section{Objects}
 %
+% An \meta{object} name should fully expand to tokens suitable for use in a
+% label-like context.
+%
 % \begin{function}[added = 2022-08-23]{\pdf_object_new:n}
 %   \begin{syntax}
 %     \cs{pdf_object_new:n} \Arg{object}
@@ -327,25 +330,25 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \pdf_object_new:n #1
   {
-    \@@_backend_object_new:n {#1}
+    \exp_args:Ne \@@_backend_object_new:n {#1}
   }
 \cs_new_protected:Npn \pdf_object_write:nnn #1#2#3
   {
-    \@@_backend_object_write:nnn {#1} {#2} {#3}
+    \exp_args:Ne \@@_backend_object_write:nnn {#1} {#2} {#3}
     \bool_gset_true:N \g_@@_init_bool
   }
 \cs_generate_variant:Nn \pdf_object_write:nnn { nne , nnx }
 \cs_new:Npn \pdf_object_ref:n #1 { \@@_backend_object_ref:n {#1} }
 \cs_new_protected:Npn \pdf_object_unnamed_write:nn #1#2
   {
-    \@@_backend_object_now:nn {#1} {#2}
+    \exp_args:Ne \@@_backend_object_now:nn {#1} {#2}
     \bool_gset_true:N \g_@@_init_bool
   }
 \cs_generate_variant:Nn \pdf_object_unnamed_write:nn { ne , nx }
 \cs_new:Npn \pdf_object_ref_last: { \@@_backend_object_last: }
 \prg_new_conditional:Npnn \pdf_object_if_exist:n #1 { p , T , F , TF }
   {
-    \int_if_exist:cTF { c_@@_object_ \tl_to_str:n {#1} _int }
+    \int_if_exist:cTF { c_@@_object_ #1 _int }
       \prg_return_true:
       \prg_return_false:
   }
@@ -360,7 +363,7 @@
 % \begin{macro}{\pdf_pageobject_ref:n}
 %    \begin{macrocode}
 \cs_new:Npn \pdf_pageobject_ref:n #1
-  { \@@_backend_pageobject_ref:n {#1} }
+  { \exp_args:Ne \@@_backend_pageobject_ref:n {#1} }
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list.