From 622f28bc3cb9a918b1e50a77427c193c7b671cce Mon Sep 17 00:00:00 2001 From: Marius Date: Sat, 31 Dec 2011 19:20:21 +0200 Subject: beta 2011.12.31 18:06 --- tex/context/base/colo-run.mkiv | 42 ++-- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4083 -> 4076 bytes tex/context/base/context-version.png | Bin 102345 -> 101565 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 3 +- tex/context/base/mult-sys.mkiv | 1 - tex/context/base/pack-mrl.mkiv | 2 + tex/context/base/spac-adj.lua | 59 ++++++ tex/context/base/spac-adj.mkiv | 50 +++++ tex/context/base/spac-pag.mkiv | 149 +++++++------ tex/context/base/spac-par.lua | 59 ------ tex/context/base/spac-par.mkiv | 231 +++++++++++---------- tex/context/base/status-files.pdf | Bin 24515 -> 24509 bytes tex/context/base/status-lua.pdf | Bin 170138 -> 170107 bytes tex/context/base/status-mkiv.lua | 18 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 18 files changed, 348 insertions(+), 274 deletions(-) create mode 100644 tex/context/base/spac-adj.lua create mode 100644 tex/context/base/spac-adj.mkiv delete mode 100644 tex/context/base/spac-par.lua (limited to 'tex') diff --git a/tex/context/base/colo-run.mkiv b/tex/context/base/colo-run.mkiv index 7d24b1d89..1adb87f63 100644 --- a/tex/context/base/colo-run.mkiv +++ b/tex/context/base/colo-run.mkiv @@ -50,8 +50,11 @@ \fi} \gdef\colors_show_palet_vertical[#1][#2]% - {\localvbox - {\offinterlineskip + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip \setuppalet[#1] \tabskip\zeropoint \def\show_palet##1% @@ -65,8 +68,11 @@ \colors_process_palet[#1]\show_palet\crcr}}} \gdef\colors_show_palet_horizontal[#1][#2]% todo: bTABLE etc - {\localvbox - {\offinterlineskip + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip \setuppalet[#1] \tabskip\zeropoint \!!widtha\zeropoint @@ -119,8 +125,11 @@ \fi} \gdef\colors_compare_palet_indeed#1[#2]% - {\localvbox - {\offinterlineskip + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip \setuppalet[#2] \getcommacommandsize[\getvalue{\??colorpalet#2}] \!!widtha2em\relax @@ -149,8 +158,11 @@ {\doifinsetelse\v!vertical{#2} \colors_show_group_vertical \colors_show_group_horizontal [#1][#2]}} \gdef\colors_show_group_horizontal[#1][#2]% - {\localvbox - {\offinterlineskip + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip \setuppalet \tabskip\zeropoint \def\colorformatseparator{\strut\cr} @@ -173,8 +185,11 @@ \show_group5\show_group6\show_group7\show_group8}}} \gdef\colors_show_group_vertical[#1][#2]% - {\localvbox - {\offinterlineskip + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \offinterlineskip \setuppalet \tabskip\zeropoint \def\show_group##1% @@ -200,8 +215,11 @@ \colors_compare_group_indeed\graycolor[#1]}}} \gdef\colors_compare_group_indeed#1[#2]% - {\localvbox - {\!!counta\zerocount + {\vbox + {\forgetall + \setlocalhsize + \hsize\localhsize + \!!counta\zerocount \dorecurse{15}{\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}} \!!widtha2em\relax \hsize\!!counta\!!widtha diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 7b3648816..01b274991 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.12.31 15:44} +\newcontextversion{2011.12.31 18:06} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 7b0598078..e3f7740ab 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.12.31 15:44} +\newcontextversion{2011.12.31 18:06} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index bce83add9..d24b011a1 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png index b2b3c484b..d8a933563 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index f3c1bd3a5..a2c675c0b 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.12.31 15:44} +\edef\contextversion{2011.12.31 18:06} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 3885f396f..2bf51cade 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -23,7 +23,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2011.12.31 15:44} +\edef\contextversion{2011.12.31 18:06} %D For those who want to use this: @@ -231,6 +231,7 @@ \loadmarkfile{spac-pag} \loadmarkfile{spac-fnt} \loadmarkfile{spac-par} +%loadmarkfile{spac-adj} % no longer needed \loadmarkfile{spac-def} \loadmarkfile{spac-grd} diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv index 44f4dc8c3..954746eca 100644 --- a/tex/context/base/mult-sys.mkiv +++ b/tex/context/base/mult-sys.mkiv @@ -400,7 +400,6 @@ \definesystemvariable {al} % ALinea's \definesystemvariable {an} % ANchor \definesystemvariable {as} % AlignmentSwitch -\definesystemvariable {bj} % BlokJe \definesystemvariable {bg} % BleedinG \definesystemvariable {bm} % BookMark \definesystemvariable {bp} % BreakPoint diff --git a/tex/context/base/pack-mrl.mkiv b/tex/context/base/pack-mrl.mkiv index 7e053ef6f..46209d50c 100644 --- a/tex/context/base/pack-mrl.mkiv +++ b/tex/context/base/pack-mrl.mkiv @@ -135,6 +135,8 @@ \c!distance=.25\emwidth, \c!color=] +%D Marginrules will either become obsolete or be redone. + %D The next commands can be used to draw margin rules. We %D support two methods: \marginrule{one for in||line use} and %D one that acts on a paragraph. Drawing a margin rule is diff --git a/tex/context/base/spac-adj.lua b/tex/context/base/spac-adj.lua new file mode 100644 index 000000000..4cba2f91e --- /dev/null +++ b/tex/context/base/spac-adj.lua @@ -0,0 +1,59 @@ +if not modules then modules = { } end modules ['spac-adj'] = { + version = 1.001, + comment = "companion to spac-adj.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- sort of obsolete code + +local attribute = attributes.private('graphicvadjust') + +local nodecodes = nodes.nodecodes + +local hlist_code = nodecodes.hlist +local vlist_code = nodecodes.vlist + +local remove_node = nodes.remove +local hpack_node = node.hpack +local vpack_node = node.vpack +local has_attribute = node.has_attribute + +function nodes.handlers.graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only + if groupcode == "" then -- mvl only + local h, p, done = head, nil, false + while h do + local id = h.id + if id == hlist_code or id == vlist_code then + local a = has_attribute(h,attribute) + if a then + if p then + local n + head, h, n = remove_node(head,h) + local pl = p.list + if n.width ~= 0 then + n = hpack_node(n,0,'exactly') -- todo: dir + end + if pl then + pl.prev = n + n.next = pl + end + p.list = n + done = true + else + -- can't happen + end + else + p = h + h = h.next + end + else + h = h.next + end + end + return head, done + else + return head, false + end +end diff --git a/tex/context/base/spac-adj.mkiv b/tex/context/base/spac-adj.mkiv new file mode 100644 index 000000000..3a72d2a5a --- /dev/null +++ b/tex/context/base/spac-adj.mkiv @@ -0,0 +1,50 @@ +%D \module +%D [ file=spac-adj, % moved from spac-par.mkiv +%D version=2009.10.16, % 1997.03.31, was core-spa.tex +%D title=\CONTEXT\ Spacing Macros, +%D subtitle=Paragraphs, +%D author=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. + +\writestatus{loading}{ConTeXt Spacing Macros / Adjustments} + +\unprotect + +% Very nasty but needed for margin stuff inside colored +% paragraphs. Obsolete anyway. + +\registerctxluafile{spac-adj}{1.001} + +\definesystemattribute [graphicvadjust] [public] + +\unexpanded\def\enablegraphicvadjust + {\ctxlua{nodes.tasks.enableaction("finalizers","nodes.handlers.graphicvadjust")}% + \glet\enablegraphicvadjust\relax} + +\unexpanded\def\graphicvadjust % currently not enabled ... nasty bidi handling + {\enablegraphicvadjust % and no longer needed anyway + \dowithnextboxcontentcs\forgetall\spacings_graphic_vadjust_finish\vbox} + +\def\spacings_graphic_vadjust_finish + {\vadjust + {\vbox attr \graphicvadjustattribute \plusone + {\unvbox\nextbox + % corrects for one line paragraphs + \nointerlineskip + \kern-\struttotal + \nointerlineskip + \verticalstrut}}} + +\unexpanded\def\fakedvadjust + {\dowithnextboxcs\spacings_faked_vadjust_finish\vtop} + +\def\spacings_faked_vadjust_finish + {\setbox\nextbox\hbox{\llap{\lower\strutdepth\box\nextbox}}% + \smashedbox\nextbox} + +\protect \endinput diff --git a/tex/context/base/spac-pag.mkiv b/tex/context/base/spac-pag.mkiv index 264fbd108..9745a76ca 100644 --- a/tex/context/base/spac-pag.mkiv +++ b/tex/context/base/spac-pag.mkiv @@ -15,15 +15,17 @@ \unprotect -%D A quick way to determine left|/|middle|/|right states -%D (experimental). +%D The code here has evolved over time and might not be the best +%D around. Maybe much will be gone a some point. -\setvalue{\??as\v!left }{0} -\setvalue{\??as\v!middle}{1} -\setvalue{\??as\v!right }{2} +\installcorenamespace {alignswitch} + +\letvalue{\??alignswitch\v!left }\zerocount +\letvalue{\??alignswitch\v!middle}\plusone +\letvalue{\??alignswitch\v!right }\plustwo \def\setalignmentswitch#1% - {\chardef\alignmentswitch0\csname\??as#1\endcsname\relax} + {\chardef\alignmentswitch\csname\??alignswitch\ifcsname\??alignswitch#1\endcsname#1\else\v!left\fi\endcsname} \newcount \noftrackedpagestates \newif \ifpagestatemismatch @@ -132,82 +134,79 @@ % we can make more of these on top, but how to deal with mixed frozen states -\definetwopasslist\s!paragraph \newcount \nofraggedparagraphs +\definetwopasslist\s!paragraph \newcount\nofraggedparagraphs \def\signalrightpage {\dotrackpagestate \s!paragraph\nofraggedparagraphs} \def\doifrightpageelse{\doifrightpagestateelse\s!paragraph\nofraggedparagraphs} -\newcount\pagesignallevel - -\unexpanded\def\startsignalrightpage % one may do a \postsignalrightplace - {\advance\pagesignallevel\plusone - \presignalrightpage - \let\signalrightpage\relax - \let\presignalrightpage\relax - \let\startsignalrightpage\relax - \doifrightpageelse\donothing\donothing - \freezepagestate} - -\unexpanded\def\stopsignalrightpage - {\ifcase\pagesignallevel\or\postsignalrightpage\fi - \advance\pagesignallevel\minusone} - -% \def\setraggedparagraphmode -% {\signalrightpage\doifrightpageelse} % move it there - -\ifx\swapmargins\undefined \let\swapmargins\undefined \fi % todo - -\def\doifswappedrightpageelse#1#2% alleen in box construction ! - {\doifrightpageelse - {#1} - {\scratchcounter\realpageno - \realpageno\realpagestateno\relax - \swapmargins - \realpageno\scratchcounter - #2}} - -\newbox\signaledrightpage % this way we can avoid interference, i.e. postpone placement - -\def\presignalrightpage {\global\setbox\signaledrightpage\hbox{\signalrightpage}} -\def\postsignalrightpage{\ifvoid\signaledrightpage\else\box\signaledrightpage\fi} - -% The next feature is is used in: +% no longer used % -% \definenumber[test][way=bypage] +% \newcount\pagesignallevel % -% \def\Test -% {\incrementnumber[test]\rawnumber[test]/% -% \incrementnumber[test]\rawnumber[test]/% -% \incrementnumber[test]\rawnumber[test]\space -% \checkpagechange{oeps}\changedpage{oeps}\space -% \ifpagechanged TRUE\else FALSE\fi} +% \unexpanded\def\startsignalrightpage % one may do a \postsignalrightplace +% {\advance\pagesignallevel\plusone +% \presignalrightpage +% \let\signalrightpage\relax +% \let\presignalrightpage\relax +% \let\startsignalrightpage\relax +% \doifrightpageelse\donothing\donothing +% \freezepagestate} % -% \Test\page \Test\par \Test\page \Test\par \Test\page \Test\page +% \unexpanded\def\stopsignalrightpage +% {\ifcase\pagesignallevel\or\postsignalrightpage\fi +% \advance\pagesignallevel\minusone} % -% (adapted from cont-new.tex:) - -\newif\ifpagechanged \let\lastchangedpage\empty - -\def\docheckpagestatechange#1#2#3% - {\pagechangedfalse - \doforcedtrackpagestate{#2}{#3}% - \findtwopassdata{#2}{\number#3}% - \ifconditional\twopassdatafound - \ifnum\twopassdata>0\getvalue{#2:p:#1}\relax - \pagechangedtrue - \fi - \fi - \ifpagechanged - \letgvalue{#2:p:#1}\twopassdata - \globallet\lastchangedpage\twopassdata - \else - \globallet\lastchangedpage\realfolio - \fi} - -\def\changedpagestate#1#2% - {\executeifdefined{#2:p:#1}{0}} - -\def\checkpagechange#1{\docheckpagestatechange{#1}\s!paragraph\nofraggedparagraphs} -\def\changedpage #1{\changedpagestate{#1}\s!paragraph} +% \ifx\swapmargins\undefined \let\swapmargins\undefined \fi % todo +% +% \def\doifswappedrightpageelse#1#2% alleen in box construction ! +% {\doifrightpageelse +% {#1} +% {\scratchcounter\realpageno +% \realpageno\realpagestateno\relax +% \swapmargins +% \realpageno\scratchcounter +% #2}} +% +% \newbox\signaledrightpage % this way we can avoid interference, i.e. postpone placement +% +% \def\presignalrightpage {\global\setbox\signaledrightpage\hbox{\signalrightpage}} +% \def\postsignalrightpage{\ifvoid\signaledrightpage\else\box\signaledrightpage\fi} +% +% % The next feature is is used in: +% % +% % \definenumber[test][way=bypage] +% % +% % \def\Test +% % {\incrementnumber[test]\rawnumber[test]/% +% % \incrementnumber[test]\rawnumber[test]/% +% % \incrementnumber[test]\rawnumber[test]\space +% % \checkpagechange{oeps}\changedpage{oeps}\space +% % \ifpagechanged TRUE\else FALSE\fi} +% % +% % \Test\page \Test\par \Test\page \Test\par \Test\page \Test\page +% +% \newif\ifpagechanged \let\lastchangedpage\empty +% +% \def\docheckpagestatechange#1#2#3% +% {\pagechangedfalse +% \doforcedtrackpagestate{#2}{#3}% +% \findtwopassdata{#2}{\number#3}% +% \ifconditional\twopassdatafound +% \ifnum\twopassdata>0\getvalue{#2:p:#1}\relax +% \pagechangedtrue +% \fi +% \fi +% \ifpagechanged +% \letgvalue{#2:p:#1}\twopassdata +% \globallet\lastchangedpage\twopassdata +% \else +% \globallet\lastchangedpage\realfolio +% \fi} +% +% \def\changedpagestate#1#2% +% {\executeifdefined{#2:p:#1}{0}} +% +% \def\checkpagechange#1{\docheckpagestatechange{#1}\s!paragraph\nofraggedparagraphs} +% \def\changedpage #1{\changedpagestate{#1}\s!paragraph} \protect \endinput diff --git a/tex/context/base/spac-par.lua b/tex/context/base/spac-par.lua deleted file mode 100644 index f695e11e9..000000000 --- a/tex/context/base/spac-par.lua +++ /dev/null @@ -1,59 +0,0 @@ -if not modules then modules = { } end modules ['spac-par'] = { - version = 1.001, - comment = "companion to spac-par.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- sort of obsolete code - -local attribute = attributes.private('graphicvadjust') - -local nodecodes = nodes.nodecodes - -local hlist_code = nodecodes.hlist -local vlist_code = nodecodes.vlist - -local remove_node = nodes.remove -local hpack_node = node.hpack -local vpack_node = node.vpack -local has_attribute = node.has_attribute - -function nodes.handlers.graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only - if groupcode == "" then -- mvl only - local h, p, done = head, nil, false - while h do - local id = h.id - if id == hlist_code or id == vlist_code then - local a = has_attribute(h,attribute) - if a then - if p then - local n - head, h, n = remove_node(head,h) - local pl = p.list - if n.width ~= 0 then - n = hpack_node(n,0,'exactly') -- todo: dir - end - if pl then - pl.prev = n - n.next = pl - end - p.list = n - done = true - else - -- can't happen - end - else - p = h - h = h.next - end - else - h = h.next - end - end - return head, done - else - return head, false - end -end diff --git a/tex/context/base/spac-par.mkiv b/tex/context/base/spac-par.mkiv index 834840012..0b0356f4c 100644 --- a/tex/context/base/spac-par.mkiv +++ b/tex/context/base/spac-par.mkiv @@ -23,7 +23,7 @@ %D inside the group are forgotten afterwards. (I must %D not forget its existence). -\def\carryoverpar#1% #1 can be \endgroup or \egroup or ... +\def\carryoverpar#1% #1 can be \endgroup or \egroup or ... expandable ! {\normalexpanded {\noexpand#1% \hangindent\the\hangindent @@ -43,30 +43,54 @@ \unexpanded\def\flushparagraphproperties {\popmacro\currentparagraphproperties} -% beware, changing this will break some code (like pos/backgrounds) +% Beware, changing this will break some code (like pos/backgrounds) but +% it has been changed anyway so let's see where things go wrong. -\newtoks\everyfirstparagraphintro -\newtoks\everynextparagraphintro -\newtoks\@@everyparagraphtoks +\installcorenamespace{paragraphintro} -\newconstant\everyparagraphintrostate +\let\insertparagraphintro\relax % hook into everypar + +\newtoks\t_spacings_paragraphs_intro_first +\newtoks\t_spacings_paragraphs_intro_next +\newtoks\t_spacings_paragraphs_intro_each + +\newtoks\c_spacings_paragraphs_intro_first +\newtoks\c_spacings_paragraphs_intro_next +\newtoks\c_spacings_paragraphs_intro_each \unexpanded\def\setupparagraphintro - {\dodoubleempty\dosetupparagraphintro} - -\def\dosetupparagraphintro[#1][#2]% - {\processallactionsinset - [#1] - [ \v!reset=>\global\everyparagraphintrostate\zerocount - \global\everyfirstparagraphintro\emptytoks - \global\everynextparagraphintro \emptytoks, - \v!first=>\global\everyparagraphintrostate\plusone - \doglobal\appendtoks#2\to\everyfirstparagraphintro, - \v!next=>\ifcase\everyparagraphintrostate\global\everyparagraphintrostate\plusone\fi - \doglobal\appendtoks#2\to\everynextparagraphintro, - \v!each=>\ifcase\everyparagraphintrostate\global\everyparagraphintrostate\plustwo\fi - \doglobal\appendtoks#2\to\everyfirstparagraphintro - \doglobal\appendtoks#2\to\everynextparagraphintro]} + {\dodoubleempty\spacings_paragraphs_intro} + +\unexpanded\def\spacings_paragraphs_intro[#1][#2]% + {\def\spacings_paragraphs_intro_step##1% + {\csname\??paragraphintro\ifcsname\??paragraphintro##1\endcsname##1\fi\endcsname{#2}}% + \processcommacommand[#1]\spacings_paragraphs_intro_step} + +\letvalue{\??paragraphintro\empty}\gobbleoneargument + +\setvalue{\??paragraphintro\v!reset}#1% + {\global\setfalse\c_spacings_paragraphs_intro_first + \global\setfalse\c_spacings_paragraphs_intro_next + \global\setfalse\c_spacings_paragraphs_intro_each + \global\t_spacings_paragraphs_intro_first\emptytoks + \global\t_spacings_paragraphs_intro_next \emptytoks + \global\t_spacings_paragraphs_intro_each \emptytoks + \glet\insertparagraphintro\relax} + +\setvalue{\??paragraphintro\v!first}#1% + {\global\settrue\c_spacings_paragraphs_intro_first + \global\t_spacings_paragraphs_intro_first\expandafter{\the\t_spacings_paragraphs_intro_first#1}% + \glet\insertparagraphintro\spacings_paragraphs_flush_intro} + +\setvalue{\??paragraphintro\v!next}#1% + {\global\settrue\c_spacings_paragraphs_intro_next + \global\t_spacings_paragraphs_intro_next\expandafter{\the\t_spacings_paragraphs_intro_next#1}% + \glet\insertparagraphintro\spacings_paragraphs_flush_intro} + +\setvalue{\??paragraphintro\v!each}#1% + {\global\settrue\c_spacings_paragraphs_intro_each + \global\t_spacings_paragraphs_intro_each\expandafter{\the\t_spacings_paragraphs_intro_each#1}% + \glet\insertparagraphintro\spacings_paragraphs_flush_intro} %D We can say: %D @@ -79,36 +103,7 @@ %D \starttyping %D \flushatparagraph{\index{Zapf}} %D \stoptyping - -\def\flushatparagraph#1% - {\global\everyparagraphintrostate\plusone - \global\appendtoks{#1}\to\everyfirstparagraphintro - \global\let\insertparagraphintro\doinsertparagraphintro} - -\def\doinsertparagraphintro % can be merged with the next - {\ifcase\everyparagraphintrostate\else\@EA\dodoinsertparagraphintro\fi} - -\def\dodoinsertparagraphintro - {\begingroup - \everypar\emptytoks - \ifcase\everyparagraphintrostate\relax - % no data - \@@everyparagraphtoks\emptytoks - \or - % first data - \global\everyparagraphintrostate\plustwo - \@@everyparagraphtoks\everyfirstparagraphintro - \global\everyfirstparagraphintro\emptytoks - \or - % next data - \@@everyparagraphtoks\everynextparagraphintro - \fi - \the\@@everyparagraphtoks - \global\let\insertparagraphintro\relax - \endgroup} - -\let\insertparagraphintro\relax - +%D %D \starttyping %D \setupparagraphintro[first][\hbox to 3.5em{\tt FIRST \hss}] %D \setupparagraphintro[first][\hbox to 3.5em{\tt TSRIF \hss}] @@ -120,84 +115,92 @@ %D some paragraph \par %D some paragraph \par %D some paragraph \par +%D some paragraph \par %D -%D \definelabel[parnumber] -%D -%D \setupparagraphintro[reset,each][\inleft{\slxx\parnumber}] +%D \setupparagraphintro[first][\hbox to 3.5em{\tt FIRST \hss}] +%D \setupparagraphintro[first][\hbox to 3.5em{\tt TSRIF \hss}] %D %D some paragraph \par %D some paragraph \par +%D +%D \setupparagraphintro[reset] +%D %D some paragraph \par %D \stoptyping - + +\unexpanded\def\flushatparagraph#1% + {\global\c_spacings_paragraphs_intro_first\plusone + \global\t_spacings_paragraphs_intro_first\expandafter{\the\t_spacings_paragraphs_intro_first#1}% + \glet\insertparagraphintro\spacings_paragraphs_flush_intro} + +%D Here comes the flusher (we misuse the one level expansion of token +%D registers to feed a nice stream into the paragraph.) + +\unexpanded\def\spacings_paragraphs_flush_intro % we make sure that the token lists expand directly after another + {\normalexpanded{% % so the first code is there twice + \ifconditional\c_spacings_paragraphs_intro_each + \ifconditional\c_spacings_paragraphs_intro_next + \glet\insertparagraphintro\spacings_paragraphs_flush_intro_next + \else + \glet\insertparagraphintro\spacings_paragraphs_flush_intro_each + \fi + \ifconditional\c_spacings_paragraphs_intro_first + \global\setfalse\c_spacings_paragraphs_intro_first + \global\t_spacings_paragraphs_intro_first\emptytoks + \the\t_spacings_paragraphs_intro_first + \fi + \the\t_spacings_paragraphs_intro_each + \else + \ifconditional\c_spacings_paragraphs_intro_next + \glet\insertparagraphintro\spacings_paragraphs_flush_intro_next + \fi + \ifconditional\c_spacings_paragraphs_intro_first + \global\setfalse\c_spacings_paragraphs_intro_first + \global\t_spacings_paragraphs_intro_first\emptytoks + \the\t_spacings_paragraphs_intro_first + \fi + \fi}} + +\unexpanded\def\spacings_paragraphs_flush_intro_next + {\normalexpanded{% + \global\setfalse\c_spacings_paragraphs_intro_next + \global\t_spacings_paragraphs_intro_next\emptytoks + \ifconditional\c_spacings_paragraphs_intro_each + \glet\insertparagraphintro\spacings_paragraphs_flush_intro_each + \the\t_spacings_paragraphs_intro_next + \the\t_spacings_paragraphs_intro_each + \else + \glet\insertparagraphintro\relax + \the\t_spacings_paragraphs_intro_next + \fi}} + +\unexpanded\def\spacings_paragraphs_flush_intro_each + {\the\t_spacings_paragraphs_intro_each} + %D \macros %D {flushatnextpar} %D %D This macro collects data that will be flushed at the next paragraph. %D By using this macro you can avoid interfering nodes (writes, etc). -\newbox\postponednodedata -\let\flushpostponednodedata\relax +\let\flushpostponednodedata\relax % hook into everypar -\def\flushatnextpar - {\bgroup - \global\let\flushpostponednodedata\doflushpostponednodedata - \dowithnextboxcs\doflushatnextpar\hbox} +\newbox\b_spacings_postponed_data -\def\doflushatnextpar - {\global\setbox\postponednodedata\hbox - {\box\postponednodedata\box\nextbox}% - \egroup} +\unexpanded\def\flushatnextpar + {\begingroup + \glet\flushpostponednodedata\spacings_flush_at_next_par_insert + \dowithnextboxcs\spacings_flush_at_next_par_finish\hbox} + +\def\spacings_flush_at_next_par_finish + {\global\setbox\b_spacings_postponed_data\hbox + {\box\b_spacings_postponed_data\box\nextbox}% + \endgroup} -\def\doflushpostponednodedata - {\ifvoid\postponednodedata\else - \hbox{\smashedbox\postponednodedata}% +\def\spacings_flush_at_next_par_insert + {\ifvoid\b_spacings_postponed_data\else + \hbox{\smashedbox\b_spacings_postponed_data}% \fi - \global\let\flushpostponednodedata\relax} - -% Very nasty but needed for margin stuff inside colored -% paragraphs. - -\registerctxluafile{spac-par}{1.001} - -\definesystemattribute [graphicvadjust] [public] - -\let\normalvadjust\vadjust - -\def\enablegraphicvadjust - {\ctxlua{nodes.tasks.enableaction("finalizers","nodes.handlers.graphicvadjust")}% - \glet\enablegraphicvadjust\relax} - -\def\graphicvadjust % currently not enabled; nasty bidi handling - {\enablegraphicvadjust - \dowithnextboxcontent - {\forgetall} - {\vadjust{\vbox attr \graphicvadjustattribute \plusone - {\unvbox\nextbox - % corrects for one line paragraphs - \nointerlineskip - \kern-\struttotal - \nointerlineskip - \verticalstrut}}}% - \vbox} - -%D This works only in a properly strutted line, and is meant -%D for deeply burried operations, like in heads. - -\def\fakedvadjust - {\dowithnextbox - {\setbox\nextbox\hbox{\llap{\lower\strutdepth\box\nextbox}}% - \smashedbox\nextbox}% - \vtop} - -\def\localvbox#1#% used? - {\vbox#1\bgroup - \forgetparskip - \setlocalhsize - \hsize\localhsize - \forgetparindent - \forgetbothskips - \forgeteverypar - \let\next=} + \glet\flushpostponednodedata\relax} \protect \endinput diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index d751c9c39..8ec405f9f 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 90853d062..ae59662a5 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua index 049512fdd..5fd2f6b8a 100644 --- a/tex/context/base/status-mkiv.lua +++ b/tex/context/base/status-mkiv.lua @@ -456,7 +456,8 @@ return { { filename = "pack-mrl", marktype = "mkiv", - status = "unknown", + status = "todo", + comment = "this is something to be done on a rainy day" }, { filename = "pack-bck", @@ -559,25 +560,26 @@ return { status = "unknown", }, { - filename = "spac-hor", + filename = "spac-ali", marktype = "mkiv", - status = "unknown", + status = "okay", + comment = "maybe some tuning is needed / will happen", }, { - filename = "spac-ver", + filename = "spac-hor", marktype = "mkiv", status = "unknown", }, { - filename = "spac-ali", + filename = "spac-ver", marktype = "mkiv", status = "unknown", - comment = "will be rewritten", }, { filename = "spac-pag", marktype = "mkiv", - status = "unknown", + status = "okay", + comment = "this needs to be checked occasionally", }, { filename = "spac-fnt", @@ -587,7 +589,7 @@ return { { filename = "spac-par", marktype = "mkiv", - status = "unknown", + status = "okay", }, { filename = "spac-def", diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 5c5666d9d..443916f93 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 12/31/11 15:44:57 +-- merge date : 12/31/11 18:06:27 do -- begin closure to overcome local limits and interference -- cgit v1.2.3