%D \module
%D   [       file=publ-imp-list,
%D        version=2014.06.16,
%D          title=\CONTEXT\ Publication Support,
%D       subtitle=Lists,
%D         author=Alan Braslau and Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\unprotect

\starttexdefinition unexpanded btx:list:inject:text #content
    \ifconditional\btxinteractivetext
        \ifx\currentbtxinternal\empty
            #content
        \else
            \goto {
                #content
            } [
                \s!internal(\currentbtxinternal)
            ]
        \fi
    \else
        #content
    \fi
\stoptexdefinition

\startsetups \s!btx:\s!list:text
   \texdefinition {\s!btx:\s!list:inject:text} {
        \btxflushlisttext
        \ifx\currentbtxcombis\empty \else
            \btxrenderingparameter\c!separator
            \btxflushlistcombis
        \fi
   }
\stopsetups

\starttexdefinition unexpanded btx:list:inject:number #content
    \ifconditional\btxinteractivenumber
        \ifx\currentbtxinternal\empty
            #content
        \else
            \goto {
                #content
            } [
                \s!internal(\currentbtxinternal)
            ]
        \fi
    \else
        #content
    \fi
\stoptexdefinition

\starttexdefinition unexpanded btx:list:helpers:concat
    \space
\stoptexdefinition

\startsetups[\s!btx:\s!list:\s!numbering]
    \texdefinition {\s!btx:\s!list:inject:number} {
        \currentbtxfirst
        \btxparameter\c!stopper
    }
\stopsetups

\starttexdefinition unexpanded btx:list:numbering #variant
    \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:#variant]
        \btxusecommand[\currentbtxspecification:\s!list:\s!numbering:#variant] {
            \fastsetup{\s!btx:\s!list:\s!numbering}
        }
    \btxstopstyleandcolor
\stoptexdefinition

\startsetups[\s!btx:\s!list:\s!numbering:default]
    \texdefinition {\s!btx:\s!list:\s!numbering} {default}
\stopsetups

\startsetups[\s!btx:\s!list:\s!numbering:num]
    \texdefinition {\s!btx:\s!list:\s!numbering} {num}
\stopsetups

\startsetups[\s!btx:\s!list:\s!numbering:short]
    \texdefinition {\s!btx:\s!list:\s!numbering} {short}
\stopsetups

\startsetups[\s!btx:\s!list:\s!numbering:tag]
    \texdefinition {\s!btx:\s!list:\s!numbering} {tag}
\stopsetups

\startsetups[\s!btx:\s!list:\s!numbering:index]
    \texdefinition {\s!btx:\s!list:\s!numbering} {index}
\stopsetups

\protect
