diff options
Diffstat (limited to 'tex/context/base/mkiv/pack-mrl.mkxl')
-rw-r--r-- | tex/context/base/mkiv/pack-mrl.mkxl | 82 |
1 files changed, 27 insertions, 55 deletions
diff --git a/tex/context/base/mkiv/pack-mrl.mkxl b/tex/context/base/mkiv/pack-mrl.mkxl index 7b09b2406..fd4153a6b 100644 --- a/tex/context/base/mkiv/pack-mrl.mkxl +++ b/tex/context/base/mkiv/pack-mrl.mkxl @@ -38,7 +38,7 @@ \installsimplecommandhandler \??blackrules {blackrules} \??blackrules -\unexpanded\def\blackrule +\permanent\protected\def\blackrule {\hpack\bgroup \doifelsenextoptionalcs\pack_black_rule_pickup\pack_black_rule_indeed} @@ -98,16 +98,10 @@ %D We could of course have implemented this macro using \type {\leaders}, but this %D would probably have taken more tokens. -\unexpanded\def\blackrules % probably never used +\permanent\tolerant\protected\def\blackrules[#1]% probably never used {\hpack\bgroup - \doifelsenextoptionalcs\pack_black_rules_pickup\pack_black_rules_indeed} - -\def\pack_black_rules_pickup[#1]% - {\setupcurrentblackrules[#1]% - \pack_black_rules_indeed} - -\def\pack_black_rules_indeed % no max handling here - {\scratchwidth \directblackrulesparameter\c!width + \ifarguments\or\setupcurrentblackrules[#1]\fi + \scratchwidth \directblackrulesparameter\c!width \scratchheight \directblackrulesparameter\c!height \scratchdepth \directblackrulesparameter\c!depth \scratchdistance\directblackrulesparameter\c!distance @@ -171,7 +165,7 @@ %D \showsetup{vl} %D \showsetup{hl} -\unexpanded\def\pack_rule_vl_indeed#1#2#3% +\protected\def\pack_rule_vl_indeed#1#2#3% {\dontleavehmode \begingroup \setbox\scratchbox\hbox @@ -184,10 +178,10 @@ \box\scratchbox \endgroup} -\def\pack_rule_vl[#1]% +\permanent\tolerant\protected\def\vl[#1]% {\pack_rule_vl_indeed{#1}{#1}{#1}} -\def\pack_rule_hl[#1]% +\permanent\tolerant\protected\def\hl[#1]% {\dontleavehmode \hbox {\vrule @@ -195,9 +189,6 @@ \s!height\linewidth \s!depth \zeropoint}} -\unexpanded\def\vl{\dosingleempty\pack_rule_vl} -\unexpanded\def\hl{\dosingleempty\pack_rule_hl} - \let\dovlwdhtdp\pack_rule_vl_indeed % used elsewhere %D \macros @@ -273,7 +264,7 @@ \newconstant\c_pack_thinrules_type -\unexpanded\def\thinrule +\permanent\protected\def\thinrule {\strut \bgroup \edef\p_height {\directthinrulesparameter\c!height}% @@ -362,15 +353,12 @@ \strut \carryoverpar\egroup} -\unexpanded\def\hairline +\permanent\protected\def\hairline % can be overloaded {\endgraf \thinrule \endgraf} -\unexpanded\def\thinrules - {\dosingleempty\pack_thinrules} - -\def\pack_thinrules[#1]% +\permanent\tolerant\protected\def\thinrules[#1]% {\bgroup \setupcurrentthinrules[#1]% \scratchcounter\directthinrulesparameter\c!n\relax @@ -533,7 +521,9 @@ \c!rulethickness=\linewidth, \c!distance=.5\emwidth] -\unexpanded\def\textrule +% can be done nicer with futureexpandis + +\permanent\protected\def\textrule {\dosingleempty\pack_textrule} \def\pack_textrule @@ -679,14 +669,14 @@ %D The grouped commands also supports bodyfont switching: -\unexpanded\def\starttextrule#1% +\permanent\protected\def\starttextrule#1% {\bgroup \def\pack_textrule_nop_indeed{\csname\??textrulealternatives\v!middle\endcsname}% \csname\??textrulealternatives\v!top\endcsname{#1}% \bgroup \usebodyfontparameter\directtextrulesparameter} -\unexpanded\def\stoptextrule +\permanent\protected\def\stoptextrule {\par \egroup \csname\??textrulealternatives\v!bottom\endcsname\empty @@ -713,7 +703,6 @@ %D \showsetup{fillinrules} %D \showsetup{setupfillinrules} - \installcorenamespace{fillinrules} \installdirectcommandhandler \??fillinrules {fillinrules} @@ -729,28 +718,20 @@ \c!style=, \c!color=] -\unexpanded\def\fillinrules - {\dosingleempty\pack_fillinrules} - -\def\pack_fillinrules[#1]% +\permanent\tolerant\protected\def\fillinrules[#1]#:#=#*#=% {\endgraf \begingroup \setupcurrentfillinrules[#1]% \let\pack_fillinrules_rule\thinrules - \dodoublegroupempty\pack_fillinrules_indeed} - -\def\pack_fillinrules_indeed#1#2% - {\directfillinrulesparameter\c!before + \directfillinrulesparameter\c!before \setupcurrentthinrules [\c!n=\directfillinrulesparameter\c!n, \c!interlinespace=\directfillinrulesparameter\c!interlinespace, \c!before=, \c!after=]% \scratchdistance\directfillinrulesparameter\c!distance\relax - \edef\m_fillinrules_one{#1}% - \edef\m_fillinrules_two{#2}% \noindent - \ifx\m_fillinrules_one\empty \else + \iftok{#2}\emptytoks\else \edef\p_width{\directfillinrulesparameter\c!width}% \ifx\p_width\v!fit \scratchdistance\zeropoint @@ -763,7 +744,7 @@ \bgroup \usefillinrulesstyleandcolor\c!style\c!color \strut - \m_fillinrules_one + #2% \hfill\directfillinrulesparameter\c!separator \hskip\scratchdistance \egroup @@ -771,10 +752,10 @@ \setupwhitespace[\v!big]% \ignorespaces \pack_fillinrules_rule - \ifx\m_fillinrules_two\empty \else + \iftok{#3}\emptytoks\else \kern\scratchdistance \usefillinrulesstyleandcolor\c!style\c!color - \m_fillinrules_two + #3% \strut \fi \endgraf @@ -789,18 +770,12 @@ %D %D \showsetup{fillintext} -\unexpanded\def\fillintext - {\dosingleempty\pack_fillintext} - -\def\pack_fillintext[#1]% ugly +\permanent\tolerant\protected\def\fillintext[#1]#:#=#*#=% {\endgraf \begingroup \setupcurrentfillinrules[#1]% - \dodoublegroupempty\pack_fillintext_indeed} - -\def\pack_fillintext_indeed#1#2% - {\def\pack_fillinrules_rule{\unhbox\nextbox\unskip}% - \dowithnextbox{\pack_fillinrules_indeed{#1}{\hfill#2}}% + \def\pack_fillinrules_rule{\unhbox\nextbox\unskip}% + \dowithnextbox{\pack_fillinrules_indeed{#2}{\hfill#3}}% \hbox\bgroup\let\par\egroup\ignorespaces} %D \macros @@ -842,10 +817,10 @@ \c!before=\blank, \c!after=\blank] -\unexpanded\def\pack_fillinline_before#1% +\protected\def\pack_fillinline_before#1% {} -\unexpanded\def\pack_fillinline_after#1% +\protected\def\pack_fillinline_after#1% {\begingroup \setupcurrentfillinlines[#1]% \ifhmode\unskip\hfill\fi @@ -865,10 +840,7 @@ \frozen\parfillskip\zeropoint\relax \endgroup} -\unexpanded\def\fillinline - {\dosingleempty\pack_fillinline} - -\def\pack_fillinline[#1]% +\permanent\tolerant\protected\def\fillinline[#1]% {\registerparwrapper {fillinline}% {\pack_fillinline_before{#1}}% |