summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-lst.mkvi
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/strc-lst.mkvi')
-rw-r--r--tex/context/base/strc-lst.mkvi48
1 files changed, 26 insertions, 22 deletions
diff --git a/tex/context/base/strc-lst.mkvi b/tex/context/base/strc-lst.mkvi
index a814bdae4..4b428454f 100644
--- a/tex/context/base/strc-lst.mkvi
+++ b/tex/context/base/strc-lst.mkvi
@@ -161,45 +161,49 @@
\unexpanded\def\writedatatolist {\dotripleargument\strc_lists_write_data_to}
\unexpanded\def\writetolist {\dodoubleempty \strc_lists_write_to}
-\def\strc_lists_write_between[#tag][#settings]#command% we can overload location
- {\doif{\namedlistparameter{#tag}\c!state}\v!start
- {\strc_lists_inject_yes[#tag][#settings,\c!type=\s!command][\s!command={#command}]}}
-
-% \def\strc_lists_write_data_to[#tag][#settings][#userdata]% we can overload location
-% {\doif{\namedlistparameter{#tag}\c!state}\v!start
-% {\ifthirdargument
-% \strc_lists_inject[#tag][#settings,\c!type=\s!userdata][#userdata]%
-% \else
-% \strc_lists_inject[#tag][\c!type=\s!userdata][#settings]%
-% \fi}}
-
-\def\strc_lists_write_data_to[#tag]% we can overload location
+\def\strc_lists_write_between[#tag]%
{\begingroup
\edef\currentlist{#tag}%
- \doifelse{\namedlistparameter{#tag}\c!state}\v!start\strc_lists_write_data_to_yes\gobbletwooptionals}
+ \doifelse{\namedlistparameter{#tag}\c!state}\v!start
+ \strc_lists_write_between_yes
+ \strc_lists_write_between_nop}
-\def\strc_lists_write_data_to_yes[#settings][#userdata]% we can overload location
+\def\strc_lists_write_between_yes[#settings]#command%
+ {\strc_lists_inject_yes[#settings,\c!type=\s!command][command={#command}]}
+
+\def\strc_lists_write_between_nop[#settings]#command%
+ {\endgroup}
+
+\def\strc_lists_write_data_to[#tag]%
+ {\begingroup
+ \edef\currentlist{#tag}%
+ \doifelse{\namedlistparameter{#tag}\c!state}\v!start
+ \strc_lists_write_data_to_yes
+ \strc_lists_write_data_to_nop}
+
+\def\strc_lists_write_data_to_yes[#settings][#userdata]%
{\ifthirdargument % no need to have an extra step ... used seldom
\strc_lists_inject_yes[#settings,\c!type=\s!userdata][#userdata]%
\else
\strc_lists_inject_yes[\c!type=\s!userdata][#settings]%
\fi}
-% \def\strc_lists_write_to[#tag][#settings]#first#second% we can overload location
-% {\doif{\namedlistparameter{#tag}\c!state}\v!start
-% {\strc_lists_inject[#tag][\c!location=\v!here,#settings,\c!type=\s!simple][\s!first={#first},\s!second={#second}]}}
+\def\strc_lists_write_data_to_nop[#settings][#userdata]%
+ {\endgroup}
\def\strc_lists_write_to[#tag]%
{\begingroup
\edef\currentlist{#tag}%
- \doifelse{\namedlistparameter{#tag}\c!state}\v!start\strc_lists_write_to_yes\strc_lists_write_to_nop}
+ \doifelse{\namedlistparameter{#tag}\c!state}\v!start
+ \strc_lists_write_to_yes
+ \strc_lists_write_to_nop}
+
+\def\strc_lists_write_to_yes[#settings]#first#second% no \s!first because we don't expand user settings
+ {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][first={#first},second={#second}]}
\def\strc_lists_write_to_nop[#settings]#first#second%
{\endgroup} % \strc_lists_inject_nop[][]
-\def\strc_lists_write_to_yes[#settings]#first#second%
- {\strc_lists_inject_yes[\c!location=\v!here,#settings,\c!type=\s!simple][\s!first={#first},\s!second={#second}]}
-
%D When placing a list either one or a set can be giving. This makes
%D it possible to flush for instance an nested (or merged) table of
%D contents. Keep in mind that placing a list is what we do most (think