texlive[72992] Master/texmf-dist: postnotes (28nov24)

commits+karl at tug.org commits+karl at tug.org
Thu Nov 28 22:24:23 CET 2024


Revision: 72992
          https://tug.org/svn/texlive?view=revision&revision=72992
Author:   karl
Date:     2024-11-28 22:24:23 +0100 (Thu, 28 Nov 2024)
Log Message:
-----------
postnotes (28nov24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
    trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf
    trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex
    trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
    trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md	2024-11-28 21:24:05 UTC (rev 72991)
+++ trunk/Master/texmf-dist/doc/latex/postnotes/CHANGELOG.md	2024-11-28 21:24:23 UTC (rev 72992)
@@ -1,7 +1,12 @@
 # Changelog
 
-## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.4.1...HEAD)
+## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.4.2...HEAD)
 
+## [v0.4.2](https://github.com/gusbrs/postnotes/compare/v0.4.1...v0.4.2) (2024-11-27)
+
+### Fixed
+- Be more careful in expanding content.
+
 ## [v0.4.1](https://github.com/gusbrs/postnotes/compare/v0.4.0...v0.4.1) (2024-11-14)
 
 ### Fixed

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex	2024-11-28 21:24:05 UTC (rev 72991)
+++ trunk/Master/texmf-dist/doc/latex/postnotes/postnotes-doc.tex	2024-11-28 21:24:23 UTC (rev 72992)
@@ -573,8 +573,8 @@
 \DescribeOption{exp} %
 By default, \cs{postnotesection} stores its \meta{text} argument with ``no
 manipulation''.  The \opt{exp} option allows one to fully expand
-(\texttt{e}-type expansion) \meta{text} in place before storing it.  It is a
-boolean option, and the option given with no value is equivalent to
+(\cs{protected at edef} expansion) \meta{text} in place before storing it.  It is
+a boolean option, and the option given with no value is equivalent to
 \texttt{exp=true}.
 
 
@@ -1356,6 +1356,7 @@
   % 2024-10-22: https://github.com/gusbrs/postnotes/issues/8#issuecomment-2429501962
   % 2024-10-25: https://chat.stackexchange.com/transcript/message/66510334#66510334 (discussion)
   % 2024-11-03: https://chat.stackexchange.com/transcript/message/66554870#66554870 (discussion)
+  % 2024-11-27: https://chat.stackexchange.com/transcript/message/66696438#66696438 (discussion)
   David Carlisle,
   % 2022-03-28: https://chat.stackexchange.com/transcript/message/60754383#60754383
   % 2022-04-08: https://tex.stackexchange.com/a/640035 (comments)
@@ -1364,6 +1365,7 @@
   % 2023-12-12: https://chat.stackexchange.com/transcript/message/64848034#64848034 (and discussion)
   % 2024-01-28: https://chat.stackexchange.com/transcript/message/65071091#65071091 (discussion)
   % 2024-10-15: https://chat.stackexchange.com/transcript/message/66444011#66444011 (discussion)
+  % 2024-11-27: https://chat.stackexchange.com/transcript/message/66696438#66696438 (discussion)
   Moritz Wemheuer,
   % 2022-04-05: https://tex.stackexchange.com/q/597359#comment1594585_597389
   Joseph Wright,

Modified: trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx	2024-11-28 21:24:05 UTC (rev 72991)
+++ trunk/Master/texmf-dist/source/latex/postnotes/postnotes.dtx	2024-11-28 21:24:23 UTC (rev 72992)
@@ -153,7 +153,7 @@
 %
 %
 %    \begin{macrocode}
-\ProvidesExplPackage {postnotes} {2024-11-14} {0.4.1}
+\ProvidesExplPackage {postnotes} {2024-11-27} {0.4.2}
   {Endnotes for LaTeX}
 %    \end{macrocode}
 %
@@ -215,8 +215,8 @@
   {
     \prop_new:c { \@@_data_name:e {#1} }
     \prop_gput:cnn { \@@_data_name:e {#1} } { type } { note }
-    \prop_gput:cne { \@@_data_name:e {#1} } { mark }
-      { \l_@@_mark_tl }
+    \prop_gput:cnV { \@@_data_name:e {#1} } { mark }
+      \l_@@_mark_tl
     \prop_gput:cne { \@@_data_name:e {#1} } { counter }
       { \int_use:N \c at postnote }
     \prop_gput:cne { \@@_data_name:e {#1} } { sortnum }
@@ -227,18 +227,21 @@
       }
     \cs_if_exist:cT { chapter }
       {
-        \prop_gput:cne { \@@_data_name:e {#1} }
-          { thechapter } { \thechapter }
+        \protected at edef \l_@@_tmpa_tl { \thechapter }
+        \prop_gput:cnV { \@@_data_name:e {#1} }
+          { thechapter } \l_@@_tmpa_tl
       }
-    \prop_gput:cne { \@@_data_name:e {#1} } { thesection }
-      { \thesection }
-    \prop_gput:cne { \@@_data_name:e {#1} } { pnsectname }
-      { \g_@@_section_name_tl }
+    \protected at edef \l_@@_tmpa_tl { \thesection }
+    \prop_gput:cnV { \@@_data_name:e {#1} } { thesection }
+      \l_@@_tmpa_tl
+    \prop_gput:cnV { \@@_data_name:e {#1} } { pnsectname }
+      \g_@@_section_name_tl
     \prop_gput:cne { \@@_data_name:e {#1} } { pnsectid }
       { \int_use:N \g_@@_sectid_int }
     \prop_gput:cne { \@@_data_name:e {#1} } { multibool }
       { \bool_to_str:N \l_@@_maybe_multi_bool }
     \prop_gput:cnn { \@@_data_name:e {#1} } { content } {#2}
+    \tl_clear:N \l_@@_tmpa_tl
     \UseHook { postnotes/note/store }
   }
 %    \end{macrocode}
@@ -258,14 +261,17 @@
     \prop_gput:cnn { \@@_data_name:e {#1} } { type } { section }
     \cs_if_exist:cT { chapter }
       {
-        \prop_gput:cne { \@@_data_name:e {#1} }
-          { thechapter } { \thechapter }
+        \protected at edef \l_@@_tmpa_tl { \thechapter }
+        \prop_gput:cnV { \@@_data_name:e {#1} }
+          { thechapter } \l_@@_tmpa_tl
       }
-    \prop_gput:cne { \@@_data_name:e {#1} } { thesection }
-      { \thesection }
+    \protected at edef \l_@@_tmpa_tl { \thesection }
+    \prop_gput:cnV { \@@_data_name:e {#1} } { thesection }
+      \l_@@_tmpa_tl
     \prop_gput:cnn { \@@_data_name:e {#1} } { content } {#2}
+    \tl_clear:N \l_@@_tmpa_tl
   }
-\cs_generate_variant:Nn \@@_store_section:nn { ne }
+\cs_generate_variant:Nn \@@_store_section:nn { nV }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -416,6 +422,7 @@
 %     \@@_set_text_page_label:n ,
 %     \@@_set_print_page_label:n ,
 %     \@@_set_pre_print_label:n ,
+%     \c_@@_page_counter_tl ,
 %   }
 %   Label setting functions for each pertinent context.  They must use
 %   \cs{iow_shipout_e:Nn}, since the main information we are interested in is
@@ -434,10 +441,12 @@
   {
     \legacy_if:nT { @filesw }
       {
-        \iow_shipout_e:Nn \@auxout
+        \protected at write \@auxout
+          { \cs_set_eq:NN \c_@@_page_counter_tl \scan_stop: }
           { \token_to_str:N \post at note { #1 } { #2 } { #3 } { #4 } }
       }
   }
+\tl_const:Nn \c_@@_page_counter_tl { \int_use:N \c at page }
 \cs_new_protected:Npn \@@_set_mark_page_label:nn #1#2
   { \@@_set_label:nnnn { mark } { #1 } { \thepage } { #2 } }
 \cs_generate_variant:Nn \@@_set_mark_page_label:nn { ee }
@@ -445,10 +454,10 @@
   { \@@_set_label:nnnn { section } { #1 } { \thepage } { } }
 \cs_generate_variant:Nn \@@_set_section_page_label:n { e }
 \cs_new_protected:Npn \@@_set_text_page_label:n #1
-  { \@@_set_label:nnnn { text } { #1 } { \int_use:N \c at page } { } }
+  { \@@_set_label:nnnn { text } { #1 } { \c_@@_page_counter_tl } { } }
 \cs_generate_variant:Nn \@@_set_text_page_label:n { e }
 \cs_new_protected:Npn \@@_set_print_page_label:n #1
-  { \@@_set_label:nnnn { print } { #1 } { \int_use:N \c at page } { } }
+  { \@@_set_label:nnnn { print } { #1 } { \c_@@_page_counter_tl } { } }
 \cs_generate_variant:Nn \@@_set_print_page_label:n { e }
 \cs_new_protected:Npn \@@_set_pre_print_label:n #1
   { \@@_set_label:nnnn { preprint } { #1 } { } { } }
@@ -974,7 +983,7 @@
     \@bsphack
     \legacy_if:nT { @filesw }
       {
-        \iow_shipout_e:Nn \@auxout
+        \protected at write \@auxout { }
           { \token_to_str:N \postnote at setcounteraux { #1 } }
       }
     \@esphack
@@ -984,7 +993,7 @@
     \@bsphack
     \legacy_if:nT { @filesw }
       {
-        \iow_shipout_e:Nn \@auxout
+        \protected at write \@auxout { }
           { \token_to_str:N \postnote at addtocounteraux { #1 } }
       }
     \@esphack
@@ -1239,15 +1248,15 @@
                     { \int_set:Nn \c at postnote { \l_@@_tmpa_tl } }
                   \tl_clear:N \l_@@_tmpa_tl
                 }
-              \tl_set:Ne \l_@@_mark_tl { \thepostnote }
+              \protected at edef \l_@@_mark_tl { \thepostnote }
             }
             { \int_set:Nn \l_@@_counteraux_step_int { 0 } }
           \UseHook { postnotes/note/begin }
           \seq_gput_right:Ne \g_@@_queue_seq
             { \l_postnotes_note_id_tl }
-          \cs_set:Npn \@currentcounter { postnote }
-          \cs_set:Npe \@currentlabel { \p at postnote \l_@@_mark_tl }
-          \cs_gset:Npe \@currentHref
+          \tl_set:Nn \@currentcounter { postnote }
+          \protected at edef \@currentlabel { \p at postnote \l_@@_mark_tl }
+          \tl_gset:Ne \@currentHref
             { postnote. \l_postnotes_note_id_tl .mark }
           \@@_store:nn { \l_postnotes_note_id_tl } {#2}
           \tl_set_eq:NN \l_@@_mark_typeset_tl \l_@@_mark_tl
@@ -1373,14 +1382,15 @@
             \bool_if:NTF \l_@@_print_plain_mark_stepcounter_bool
               {
                 \stepcounter { postnote }
-                \tl_set:Ne \l_@@_mark_typeset_tl { \thepostnote }
+                \protected at edef \l_@@_mark_typeset_tl { \thepostnote }
               }
               {
                 \group_begin:
                   \int_incr:N \c at postnote
-                  \exp_args:NNNe
+                  \protected at edef \l_@@_tmpa_tl { \thepostnote }
+                  \exp_args:NNNV
                     \group_end:
-                    \tl_set:Nn \l_@@_mark_typeset_tl { \thepostnote }
+                    \tl_set:Nn \l_@@_mark_typeset_tl \l_@@_tmpa_tl
               }
 %    \end{macrocode}
 % If the note has a \opt{label}, use a cross-reference to that as the mark
@@ -1446,7 +1456,7 @@
           { postnotes@ \l_@@_note_label_str }
           { postnotes/mark }
           {
-            \tl_set:Ne #1
+            \protected at edef #1
               {
                 \property_ref:ee
                   { __postnotes_ \l_@@_note_label_str } { postnotes/mark }
@@ -1551,11 +1561,11 @@
 %     \cs{@@_note_ref:nn} \Arg{star bool} \Arg{label}
 %   \end{syntax}
 %    \begin{macrocode}
-\tl_new:N \l_@@_note_ref_label_tl
+\str_new:N \l_@@_note_ref_label_str
 \cs_new_protected:Npn \@@_note_ref:nn #1#2
   {
     \group_begin:
-      \tl_set:Nn \l_@@_note_ref_label_tl {#2}
+      \str_set:Nn \l_@@_note_ref_label_str {#2}
       \@@_typeset_mark_wrapper:nnn
         {
           \bool_lazy_and:nnTF
@@ -1609,7 +1619,11 @@
       \keys_set:nn { postnotes/section } {#1}
       \@@_set_section_page_label:e { \l_postnotes_note_id_tl }
       \bool_if:NTF \l_@@_section_exp_bool
-        { \@@_store_section:ne { \l_postnotes_note_id_tl } {#2} }
+        {
+          \protected at edef \l_@@_tmpa_tl {#2}
+          \@@_store_section:nV { \l_postnotes_note_id_tl }
+            \l_@@_tmpa_tl
+        }
         { \@@_store_section:nn { \l_postnotes_note_id_tl } {#2} }
     \group_end:
   }
@@ -1904,10 +1918,10 @@
                     \@@_prop_get:nnN
                       { \l_postnotes_print_note_id_tl }
                       { content } \l_@@_print_content_tl
-                    \cs_set:Npn \@currentcounter { postnotetext }
+                    \tl_set:Nn \@currentcounter { postnotetext }
                     \int_set:Nn \c at postnotetext
                       { \l_@@_print_counter_tl }
-                    \cs_set:Npe \@currentlabel
+                    \protected at edef \@currentlabel
                       { \p at postnote \l_@@_print_mark_tl }
                     \tl_set:Nn \l_@@_print_typeset_mark_tl
                       {
@@ -2540,35 +2554,41 @@
 %    \begin{macrocode}
                       \tl_if_empty:NF \l_@@_prev_text_page_tl
                         {
-                          \prop_gput:Nee \g_@@_header_page_last_prop
-                            { \l_@@_prev_text_page_tl }
-                            { \l_@@_prev_mark_page_tl }
-                          \prop_gput:Nee \g_@@_header_chap_last_prop
-                            { \l_@@_prev_text_page_tl }
-                            { \l_@@_prev_mark_chap_tl }
-                          \prop_gput:Nee \g_@@_header_sect_last_prop
-                            { \l_@@_prev_text_page_tl }
-                            { \l_@@_prev_mark_sect_tl }
-                          \prop_gput:Nee \g_@@_header_name_last_prop
-                            { \l_@@_prev_text_page_tl }
-                            { \l_@@_prev_mark_name_tl }
+                          \prop_gput:NVV \g_@@_header_page_last_prop
+                            \l_@@_prev_text_page_tl
+                            \l_@@_prev_mark_page_tl
+                          \prop_gput:NVV \g_@@_header_chap_last_prop
+                            \l_@@_prev_text_page_tl
+                            \l_@@_prev_mark_chap_tl
+                          \prop_gput:NVV \g_@@_header_sect_last_prop
+                            \l_@@_prev_text_page_tl
+                            \l_@@_prev_mark_sect_tl
+                          \prop_gput:NVV \g_@@_header_name_last_prop
+                            \l_@@_prev_text_page_tl
+                            \l_@@_prev_mark_name_tl
                         }
 %    \end{macrocode}
 %
 % Set `first' values for current page, based on the current note ID.
 %    \begin{macrocode}
-                      \prop_gput:Nee \g_@@_header_page_first_prop
-                        { \l_@@_curr_text_page_tl }
+                      \prop_gput:NVe \g_@@_header_page_first_prop
+                        \l_@@_curr_text_page_tl
                         { \@@_extract_pageref:n { mark@ ##1 } }
-                      \prop_gput:Nee \g_@@_header_chap_first_prop
-                        { \l_@@_curr_text_page_tl }
-                        { \@@_prop_item:nn {##1} { thechapter } }
-                      \prop_gput:Nee \g_@@_header_sect_first_prop
-                        { \l_@@_curr_text_page_tl }
-                        { \@@_prop_item:nn {##1} { thesection } }
-                      \prop_gput:Nee \g_@@_header_name_first_prop
-                        { \l_@@_curr_text_page_tl }
-                        { \@@_prop_item:nn {##1} { pnsectname } }
+                      \@@_prop_get:nnN {##1} { thechapter }
+                        \l_@@_tmpa_tl
+                      \prop_gput:NVV \g_@@_header_chap_first_prop
+                        \l_@@_curr_text_page_tl
+                        \l_@@_tmpa_tl
+                      \@@_prop_get:nnN {##1} { thesection }
+                        \l_@@_tmpa_tl
+                      \prop_gput:NVV \g_@@_header_sect_first_prop
+                        \l_@@_curr_text_page_tl
+                        \l_@@_tmpa_tl
+                      \@@_prop_get:nnN {##1} { pnsectname }
+                        \l_@@_tmpa_tl
+                      \prop_gput:NVV \g_@@_header_name_first_prop
+                        \l_@@_curr_text_page_tl
+                        \l_@@_tmpa_tl
 %    \end{macrocode}
 %
 % Store \texttt{prev_mark} data for the first note on the page.
@@ -2601,18 +2621,18 @@
 %    \begin{macrocode}
       \tl_if_empty:NF \l_@@_prev_text_page_tl
         {
-          \prop_gput:Nee \g_@@_header_page_last_prop
-            { \l_@@_prev_text_page_tl }
-            { \l_@@_prev_mark_page_tl }
-          \prop_gput:Nee \g_@@_header_chap_last_prop
-            { \l_@@_prev_text_page_tl }
-            { \l_@@_prev_mark_chap_tl }
-          \prop_gput:Nee \g_@@_header_sect_last_prop
-            { \l_@@_prev_text_page_tl }
-            { \l_@@_prev_mark_sect_tl }
-          \prop_gput:Nee \g_@@_header_name_last_prop
-            { \l_@@_prev_text_page_tl }
-            { \l_@@_prev_mark_name_tl }
+          \prop_gput:NVV \g_@@_header_page_last_prop
+            \l_@@_prev_text_page_tl
+            \l_@@_prev_mark_page_tl
+          \prop_gput:NVV \g_@@_header_chap_last_prop
+            \l_@@_prev_text_page_tl
+            \l_@@_prev_mark_chap_tl
+          \prop_gput:NVV \g_@@_header_sect_last_prop
+            \l_@@_prev_text_page_tl
+            \l_@@_prev_mark_sect_tl
+          \prop_gput:NVV \g_@@_header_name_last_prop
+            \l_@@_prev_text_page_tl
+            \l_@@_prev_mark_name_tl
         }
     \group_end:
   }
@@ -3066,11 +3086,11 @@
 %     \cs{@@_note_zref:nn} \Arg{star bool} \Arg{label}
 %   \end{syntax}
 %    \begin{macrocode}
-    \tl_new:N \l_@@_note_zref_zlabel_tl
+    \str_new:N \l_@@_note_zref_zlabel_str
     \cs_new_protected:Npn \@@_note_zref:nn #1#2
       {
         \group_begin:
-          \tl_set:Nn \l_@@_note_zref_zlabel_tl {#2}
+          \str_set:Nn \l_@@_note_zref_zlabel_str {#2}
           \@@_typeset_mark_wrapper:nnn
             {
               \bool_lazy_all:nTF
@@ -3830,7 +3850,7 @@
       {
         \tag_mc_end_push:
         \property_if_recorded:eeTF
-          { postnote at label@innote. \l_@@_note_ref_label_tl }
+          { postnote at label@innote. \l_@@_note_ref_label_str }
           { postnotes/tagsup at noteid }
           {
 %    \end{macrocode}
@@ -3839,7 +3859,7 @@
             \tl_set:Ne \l_@@_tmpa_tl
               {
                 \property_ref:ee
-                  { postnote at label@innote. \l_@@_note_ref_label_tl }
+                  { postnote at label@innote. \l_@@_note_ref_label_str }
                   { postnotes/tagsup at noteid }
               }
             \tag_struct_begin:n
@@ -3852,7 +3872,7 @@
           }
           {
             \property_if_recorded:eeTF
-              { postnote at label@option. \l_@@_note_ref_label_tl }
+              { postnote at label@option. \l_@@_note_ref_label_str }
               { postnotes/tagsup at noteid }
               {
 %    \end{macrocode}
@@ -3861,7 +3881,7 @@
                 \tl_set:Ne \l_@@_tmpa_tl
                   {
                     \property_ref:ee
-                      { postnote at label@option. \l_@@_note_ref_label_tl }
+                      { postnote at label@option. \l_@@_note_ref_label_str }
                       { postnotes/tagsup at noteid }
                   }
                 \tag_struct_begin:n
@@ -3892,7 +3912,7 @@
         \socket_new_plug:nnn { tagsupport/postnotes/postnotezref/begin } { default }
           {
             \tag_mc_end_push:
-            \zref at ifrefcontainsprop { \l_@@_note_zref_zlabel_tl }
+            \zref at ifrefcontainsprop { \l_@@_note_zref_zlabel_str }
               { postnotes at tagsup@noteid }
               {
 %    \end{macrocode}
@@ -3900,7 +3920,7 @@
 %    \begin{macrocode}
                 \tl_set:Ne \l_@@_tmpa_tl
                   {
-                    \zref at extract { \l_@@_note_zref_zlabel_tl }
+                    \zref at extract { \l_@@_note_zref_zlabel_str }
                       { postnotes at tagsup@noteid }
                   }
                 \tag_struct_begin:n
@@ -3913,7 +3933,7 @@
               }
               {
                 \property_if_recorded:eeTF
-                  { postnote at zlabel@option. \l_@@_note_zref_zlabel_tl }
+                  { postnote at zlabel@option. \l_@@_note_zref_zlabel_str }
                   { postnotes/tagsup at noteid }
                   {
 %    \end{macrocode}
@@ -3924,7 +3944,7 @@
                         \property_ref:ee
                           {
                             postnote at zlabel@option.
-                            \l_@@_note_zref_zlabel_tl
+                            \l_@@_note_zref_zlabel_str
                           }
                           { postnotes/tagsup at noteid }
                       }

Modified: trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty	2024-11-28 21:24:05 UTC (rev 72991)
+++ trunk/Master/texmf-dist/tex/latex/postnotes/postnotes.sty	2024-11-28 21:24:23 UTC (rev 72992)
@@ -52,7 +52,7 @@
         'postnotes' requires a LaTeX kernel \postnotes at required@kernel\space or newer.%
       }%
   }%
-\ProvidesExplPackage {postnotes} {2024-11-14} {0.4.1}
+\ProvidesExplPackage {postnotes} {2024-11-27} {0.4.2}
   {Endnotes for LaTeX}
 \tl_new:N \l__postnotes_tmpa_tl
 \tl_new:N \l__postnotes_tmpb_tl
@@ -67,8 +67,8 @@
   {
     \prop_new:c { \__postnotes_data_name:e {#1} }
     \prop_gput:cnn { \__postnotes_data_name:e {#1} } { type } { note }
-    \prop_gput:cne { \__postnotes_data_name:e {#1} } { mark }
-      { \l__postnotes_mark_tl }
+    \prop_gput:cnV { \__postnotes_data_name:e {#1} } { mark }
+      \l__postnotes_mark_tl
     \prop_gput:cne { \__postnotes_data_name:e {#1} } { counter }
       { \int_use:N \c at postnote }
     \prop_gput:cne { \__postnotes_data_name:e {#1} } { sortnum }
@@ -79,18 +79,21 @@
       }
     \cs_if_exist:cT { chapter }
       {
-        \prop_gput:cne { \__postnotes_data_name:e {#1} }
-          { thechapter } { \thechapter }
+        \protected at edef \l__postnotes_tmpa_tl { \thechapter }
+        \prop_gput:cnV { \__postnotes_data_name:e {#1} }
+          { thechapter } \l__postnotes_tmpa_tl
       }
-    \prop_gput:cne { \__postnotes_data_name:e {#1} } { thesection }
-      { \thesection }
-    \prop_gput:cne { \__postnotes_data_name:e {#1} } { pnsectname }
-      { \g__postnotes_section_name_tl }
+    \protected at edef \l__postnotes_tmpa_tl { \thesection }
+    \prop_gput:cnV { \__postnotes_data_name:e {#1} } { thesection }
+      \l__postnotes_tmpa_tl
+    \prop_gput:cnV { \__postnotes_data_name:e {#1} } { pnsectname }
+      \g__postnotes_section_name_tl
     \prop_gput:cne { \__postnotes_data_name:e {#1} } { pnsectid }
       { \int_use:N \g__postnotes_sectid_int }
     \prop_gput:cne { \__postnotes_data_name:e {#1} } { multibool }
       { \bool_to_str:N \l__postnotes_maybe_multi_bool }
     \prop_gput:cnn { \__postnotes_data_name:e {#1} } { content } {#2}
+    \tl_clear:N \l__postnotes_tmpa_tl
     \UseHook { postnotes/note/store }
   }
 \cs_new_protected:Npn \__postnotes_store_section:nn #1#2
@@ -99,14 +102,17 @@
     \prop_gput:cnn { \__postnotes_data_name:e {#1} } { type } { section }
     \cs_if_exist:cT { chapter }
       {
-        \prop_gput:cne { \__postnotes_data_name:e {#1} }
-          { thechapter } { \thechapter }
+        \protected at edef \l__postnotes_tmpa_tl { \thechapter }
+        \prop_gput:cnV { \__postnotes_data_name:e {#1} }
+          { thechapter } \l__postnotes_tmpa_tl
       }
-    \prop_gput:cne { \__postnotes_data_name:e {#1} } { thesection }
-      { \thesection }
+    \protected at edef \l__postnotes_tmpa_tl { \thesection }
+    \prop_gput:cnV { \__postnotes_data_name:e {#1} } { thesection }
+      \l__postnotes_tmpa_tl
     \prop_gput:cnn { \__postnotes_data_name:e {#1} } { content } {#2}
+    \tl_clear:N \l__postnotes_tmpa_tl
   }
-\cs_generate_variant:Nn \__postnotes_store_section:nn { ne }
+\cs_generate_variant:Nn \__postnotes_store_section:nn { nV }
 \cs_new_protected:Npn \__postnotes_prop_get:nnN #1#2#3
   {
     \prop_get:cnNF { \__postnotes_data_name:e {#1} } {#2} #3
@@ -196,10 +202,12 @@
   {
     \legacy_if:nT { @filesw }
       {
-        \iow_shipout_e:Nn \@auxout
+        \protected at write \@auxout
+          { \cs_set_eq:NN \c__postnotes_page_counter_tl \scan_stop: }
           { \token_to_str:N \post at note { #1 } { #2 } { #3 } { #4 } }
       }
   }
+\tl_const:Nn \c__postnotes_page_counter_tl { \int_use:N \c at page }
 \cs_new_protected:Npn \__postnotes_set_mark_page_label:nn #1#2
   { \__postnotes_set_label:nnnn { mark } { #1 } { \thepage } { #2 } }
 \cs_generate_variant:Nn \__postnotes_set_mark_page_label:nn { ee }
@@ -207,10 +215,10 @@
   { \__postnotes_set_label:nnnn { section } { #1 } { \thepage } { } }
 \cs_generate_variant:Nn \__postnotes_set_section_page_label:n { e }
 \cs_new_protected:Npn \__postnotes_set_text_page_label:n #1
-  { \__postnotes_set_label:nnnn { text } { #1 } { \int_use:N \c at page } { } }
+  { \__postnotes_set_label:nnnn { text } { #1 } { \c__postnotes_page_counter_tl } { } }
 \cs_generate_variant:Nn \__postnotes_set_text_page_label:n { e }
 \cs_new_protected:Npn \__postnotes_set_print_page_label:n #1
-  { \__postnotes_set_label:nnnn { print } { #1 } { \int_use:N \c at page } { } }
+  { \__postnotes_set_label:nnnn { print } { #1 } { \c__postnotes_page_counter_tl } { } }
 \cs_generate_variant:Nn \__postnotes_set_print_page_label:n { e }
 \cs_new_protected:Npn \__postnotes_set_pre_print_label:n #1
   { \__postnotes_set_label:nnnn { preprint } { #1 } { } { } }
@@ -514,7 +522,7 @@
     \@bsphack
     \legacy_if:nT { @filesw }
       {
-        \iow_shipout_e:Nn \@auxout
+        \protected at write \@auxout { }
           { \token_to_str:N \postnote at setcounteraux { #1 } }
       }
     \@esphack
@@ -524,7 +532,7 @@
     \@bsphack
     \legacy_if:nT { @filesw }
       {
-        \iow_shipout_e:Nn \@auxout
+        \protected at write \@auxout { }
           { \token_to_str:N \postnote at addtocounteraux { #1 } }
       }
     \@esphack
@@ -561,15 +569,15 @@
                     { \int_set:Nn \c at postnote { \l__postnotes_tmpa_tl } }
                   \tl_clear:N \l__postnotes_tmpa_tl
                 }
-              \tl_set:Ne \l__postnotes_mark_tl { \thepostnote }
+              \protected at edef \l__postnotes_mark_tl { \thepostnote }
             }
             { \int_set:Nn \l__postnotes_counteraux_step_int { 0 } }
           \UseHook { postnotes/note/begin }
           \seq_gput_right:Ne \g__postnotes_queue_seq
             { \l_postnotes_note_id_tl }
-          \cs_set:Npn \@currentcounter { postnote }
-          \cs_set:Npe \@currentlabel { \p at postnote \l__postnotes_mark_tl }
-          \cs_gset:Npe \@currentHref
+          \tl_set:Nn \@currentcounter { postnote }
+          \protected at edef \@currentlabel { \p at postnote \l__postnotes_mark_tl }
+          \tl_gset:Ne \@currentHref
             { postnote. \l_postnotes_note_id_tl .mark }
           \__postnotes_store:nn { \l_postnotes_note_id_tl } {#2}
           \tl_set_eq:NN \l__postnotes_mark_typeset_tl \l__postnotes_mark_tl
@@ -657,14 +665,15 @@
             \bool_if:NTF \l__postnotes_print_plain_mark_stepcounter_bool
               {
                 \stepcounter { postnote }
-                \tl_set:Ne \l__postnotes_mark_typeset_tl { \thepostnote }
+                \protected at edef \l__postnotes_mark_typeset_tl { \thepostnote }
               }
               {
                 \group_begin:
                   \int_incr:N \c at postnote
-                  \exp_args:NNNe
+                  \protected at edef \l__postnotes_tmpa_tl { \thepostnote }
+                  \exp_args:NNNV
                     \group_end:
-                    \tl_set:Nn \l__postnotes_mark_typeset_tl { \thepostnote }
+                    \tl_set:Nn \l__postnotes_mark_typeset_tl \l__postnotes_tmpa_tl
               }
             \__postnotes_get_label_if_exist:N \l__postnotes_mark_typeset_tl
           }
@@ -709,7 +718,7 @@
           { postnotes@ \l__postnotes_note_label_str }
           { postnotes/mark }
           {
-            \tl_set:Ne #1
+            \protected at edef #1
               {
                 \property_ref:ee
                   { __postnotes_ \l__postnotes_note_label_str } { postnotes/mark }
@@ -767,11 +776,11 @@
 \property_new:nnnn { postnotes/mark } { now } { } { \l__postnotes_mark_tl }
 \NewDocumentCommand \postnoteref { s m }
   { \__postnotes_note_ref:nn {#1} {#2} }
-\tl_new:N \l__postnotes_note_ref_label_tl
+\str_new:N \l__postnotes_note_ref_label_str
 \cs_new_protected:Npn \__postnotes_note_ref:nn #1#2
   {
     \group_begin:
-      \tl_set:Nn \l__postnotes_note_ref_label_tl {#2}
+      \str_set:Nn \l__postnotes_note_ref_label_str {#2}
       \__postnotes_typeset_mark_wrapper:nnn
         {
           \bool_lazy_and:nnTF
@@ -804,7 +813,11 @@
       \keys_set:nn { postnotes/section } {#1}
       \__postnotes_set_section_page_label:e { \l_postnotes_note_id_tl }
       \bool_if:NTF \l__postnotes_section_exp_bool
-        { \__postnotes_store_section:ne { \l_postnotes_note_id_tl } {#2} }
+        {
+          \protected at edef \l__postnotes_tmpa_tl {#2}
+          \__postnotes_store_section:nV { \l_postnotes_note_id_tl }
+            \l__postnotes_tmpa_tl
+        }
         { \__postnotes_store_section:nn { \l_postnotes_note_id_tl } {#2} }
     \group_end:
   }
@@ -961,10 +974,10 @@
                     \__postnotes_prop_get:nnN
                       { \l_postnotes_print_note_id_tl }
                       { content } \l__postnotes_print_content_tl
-                    \cs_set:Npn \@currentcounter { postnotetext }
+                    \tl_set:Nn \@currentcounter { postnotetext }
                     \int_set:Nn \c at postnotetext
                       { \l__postnotes_print_counter_tl }
-                    \cs_set:Npe \@currentlabel
+                    \protected at edef \@currentlabel
                       { \p at postnote \l__postnotes_print_mark_tl }
                     \tl_set:Nn \l__postnotes_print_typeset_mark_tl
                       {
@@ -1305,31 +1318,37 @@
                     {
                       \tl_if_empty:NF \l__postnotes_prev_text_page_tl
                         {
-                          \prop_gput:Nee \g__postnotes_header_page_last_prop
-                            { \l__postnotes_prev_text_page_tl }
-                            { \l__postnotes_prev_mark_page_tl }
-                          \prop_gput:Nee \g__postnotes_header_chap_last_prop
-                            { \l__postnotes_prev_text_page_tl }
-                            { \l__postnotes_prev_mark_chap_tl }
-                          \prop_gput:Nee \g__postnotes_header_sect_last_prop
-                            { \l__postnotes_prev_text_page_tl }
-                            { \l__postnotes_prev_mark_sect_tl }
-                          \prop_gput:Nee \g__postnotes_header_name_last_prop
-                            { \l__postnotes_prev_text_page_tl }
-                            { \l__postnotes_prev_mark_name_tl }
+                          \prop_gput:NVV \g__postnotes_header_page_last_prop
+                            \l__postnotes_prev_text_page_tl
+                            \l__postnotes_prev_mark_page_tl
+                          \prop_gput:NVV \g__postnotes_header_chap_last_prop
+                            \l__postnotes_prev_text_page_tl
+                            \l__postnotes_prev_mark_chap_tl
+                          \prop_gput:NVV \g__postnotes_header_sect_last_prop
+                            \l__postnotes_prev_text_page_tl
+                            \l__postnotes_prev_mark_sect_tl
+                          \prop_gput:NVV \g__postnotes_header_name_last_prop
+                            \l__postnotes_prev_text_page_tl
+                            \l__postnotes_prev_mark_name_tl
                         }
-                      \prop_gput:Nee \g__postnotes_header_page_first_prop
-                        { \l__postnotes_curr_text_page_tl }
+                      \prop_gput:NVe \g__postnotes_header_page_first_prop
+                        \l__postnotes_curr_text_page_tl
                         { \__postnotes_extract_pageref:n { mark@ ##1 } }
-                      \prop_gput:Nee \g__postnotes_header_chap_first_prop
-                        { \l__postnotes_curr_text_page_tl }
-                        { \__postnotes_prop_item:nn {##1} { thechapter } }
-                      \prop_gput:Nee \g__postnotes_header_sect_first_prop
-                        { \l__postnotes_curr_text_page_tl }
-                        { \__postnotes_prop_item:nn {##1} { thesection } }
-                      \prop_gput:Nee \g__postnotes_header_name_first_prop
-                        { \l__postnotes_curr_text_page_tl }
-                        { \__postnotes_prop_item:nn {##1} { pnsectname } }
+                      \__postnotes_prop_get:nnN {##1} { thechapter }
+                        \l__postnotes_tmpa_tl
+                      \prop_gput:NVV \g__postnotes_header_chap_first_prop
+                        \l__postnotes_curr_text_page_tl
+                        \l__postnotes_tmpa_tl
+                      \__postnotes_prop_get:nnN {##1} { thesection }
+                        \l__postnotes_tmpa_tl
+                      \prop_gput:NVV \g__postnotes_header_sect_first_prop
+                        \l__postnotes_curr_text_page_tl
+                        \l__postnotes_tmpa_tl
+                      \__postnotes_prop_get:nnN {##1} { pnsectname }
+                        \l__postnotes_tmpa_tl
+                      \prop_gput:NVV \g__postnotes_header_name_first_prop
+                        \l__postnotes_curr_text_page_tl
+                        \l__postnotes_tmpa_tl
                       \__postnotes_get_pageref:Nn
                         \l__postnotes_prev_mark_page_tl { mark@ ##1 }
                       \__postnotes_prop_get:nnN {##1} { thechapter }
@@ -1346,18 +1365,18 @@
         }
       \tl_if_empty:NF \l__postnotes_prev_text_page_tl
         {
-          \prop_gput:Nee \g__postnotes_header_page_last_prop
-            { \l__postnotes_prev_text_page_tl }
-            { \l__postnotes_prev_mark_page_tl }
-          \prop_gput:Nee \g__postnotes_header_chap_last_prop
-            { \l__postnotes_prev_text_page_tl }
-            { \l__postnotes_prev_mark_chap_tl }
-          \prop_gput:Nee \g__postnotes_header_sect_last_prop
-            { \l__postnotes_prev_text_page_tl }
-            { \l__postnotes_prev_mark_sect_tl }
-          \prop_gput:Nee \g__postnotes_header_name_last_prop
-            { \l__postnotes_prev_text_page_tl }
-            { \l__postnotes_prev_mark_name_tl }
+          \prop_gput:NVV \g__postnotes_header_page_last_prop
+            \l__postnotes_prev_text_page_tl
+            \l__postnotes_prev_mark_page_tl
+          \prop_gput:NVV \g__postnotes_header_chap_last_prop
+            \l__postnotes_prev_text_page_tl
+            \l__postnotes_prev_mark_chap_tl
+          \prop_gput:NVV \g__postnotes_header_sect_last_prop
+            \l__postnotes_prev_text_page_tl
+            \l__postnotes_prev_mark_sect_tl
+          \prop_gput:NVV \g__postnotes_header_name_last_prop
+            \l__postnotes_prev_text_page_tl
+            \l__postnotes_prev_mark_name_tl
         }
     \group_end:
   }
@@ -1465,11 +1484,11 @@
       { \zref at localaddprop { main } { postnote at mark } }
     \NewDocumentCommand \postnotezref { s m }
       { \__postnotes_note_zref:nn {#1} {#2} }
-    \tl_new:N \l__postnotes_note_zref_zlabel_tl
+    \str_new:N \l__postnotes_note_zref_zlabel_str
     \cs_new_protected:Npn \__postnotes_note_zref:nn #1#2
       {
         \group_begin:
-          \tl_set:Nn \l__postnotes_note_zref_zlabel_tl {#2}
+          \str_set:Nn \l__postnotes_note_zref_zlabel_str {#2}
           \__postnotes_typeset_mark_wrapper:nnn
             {
               \bool_lazy_all:nTF
@@ -1916,13 +1935,13 @@
       {
         \tag_mc_end_push:
         \property_if_recorded:eeTF
-          { postnote at label@innote. \l__postnotes_note_ref_label_tl }
+          { postnote at label@innote. \l__postnotes_note_ref_label_str }
           { postnotes/tagsup at noteid }
           {
             \tl_set:Ne \l__postnotes_tmpa_tl
               {
                 \property_ref:ee
-                  { postnote at label@innote. \l__postnotes_note_ref_label_tl }
+                  { postnote at label@innote. \l__postnotes_note_ref_label_str }
                   { postnotes/tagsup at noteid }
               }
             \tag_struct_begin:n
@@ -1935,13 +1954,13 @@
           }
           {
             \property_if_recorded:eeTF
-              { postnote at label@option. \l__postnotes_note_ref_label_tl }
+              { postnote at label@option. \l__postnotes_note_ref_label_str }
               { postnotes/tagsup at noteid }
               {
                 \tl_set:Ne \l__postnotes_tmpa_tl
                   {
                     \property_ref:ee
-                      { postnote at label@option. \l__postnotes_note_ref_label_tl }
+                      { postnote at label@option. \l__postnotes_note_ref_label_str }
                       { postnotes/tagsup at noteid }
                   }
                 \tag_struct_begin:n
@@ -1969,12 +1988,12 @@
         \socket_new_plug:nnn { tagsupport/postnotes/postnotezref/begin } { default }
           {
             \tag_mc_end_push:
-            \zref at ifrefcontainsprop { \l__postnotes_note_zref_zlabel_tl }
+            \zref at ifrefcontainsprop { \l__postnotes_note_zref_zlabel_str }
               { postnotes at tagsup@noteid }
               {
                 \tl_set:Ne \l__postnotes_tmpa_tl
                   {
-                    \zref at extract { \l__postnotes_note_zref_zlabel_tl }
+                    \zref at extract { \l__postnotes_note_zref_zlabel_str }
                       { postnotes at tagsup@noteid }
                   }
                 \tag_struct_begin:n
@@ -1987,7 +2006,7 @@
               }
               {
                 \property_if_recorded:eeTF
-                  { postnote at zlabel@option. \l__postnotes_note_zref_zlabel_tl }
+                  { postnote at zlabel@option. \l__postnotes_note_zref_zlabel_str }
                   { postnotes/tagsup at noteid }
                   {
                     \tl_set:Ne \l__postnotes_tmpa_tl
@@ -1995,7 +2014,7 @@
                         \property_ref:ee
                           {
                             postnote at zlabel@option.
-                            \l__postnotes_note_zref_zlabel_tl
+                            \l__postnotes_note_zref_zlabel_str
                           }
                           { postnotes/tagsup at noteid }
                       }



More information about the tex-live-commits mailing list.